Skip to content

Node examples? #4

Open
Open

Description

@molinto

Please add node examples guys

Activity

  1. jasonshouse commented on Feb 6, 2015

    @jasonshouse

    👍 for node examples

  2. temsa commented on Feb 24, 2016

    @temsa

    👍

  3. kressaty commented on Mar 3, 2016

    @kressaty

    @molinto @jasonshouse @temsa if there were a node library / examples, are there any good libraries you like that you prefer how they handle things? Have any of you used https://github.com/baalexander/node-xmlrpc ?

  4. temsa commented on Mar 9, 2016

    @temsa

    @kressaty : so far I've used with success infusionsoft ^0.3.7 which runs on top of xmlrpc 1.3.0. Yet, it does not wrap the whole API, and seems unmaintained.

    Raw code running on top of xmlrpc would be ok :)

  5. kressaty commented on Mar 9, 2016

    @kressaty

    Ok cool. So here's the next question - do we want a specific method for each API request? Or a wrapper system that handles OAuth for you, and then lets you specify the XML-RPC request you're going to make as an argument to a generic "request" method?

    infusionsoft.contactAdd(args, callback)

    vs

    infusionsoft.request('ContactService.add', args, callback)

  6. temsa commented on Mar 15, 2016

    @temsa

    For a library, maybe something more like this ?

    // Allows multiple clients, could also use 'new' to be clear about that but not necessary
    var client = require('infusionsoft').client()
    
    // Could also be 'client.ContactService.add' yet does not feel right
    // usual args could be given directly when few (less than 4) are needed
    client.contact.add(arg1, arg2, arg3, callback)
    
    // if you need more clarity regarding you API you may prefer 'client.contactService', yet 'Service' is not a very useful information in itself and gives less readability
    
    // or, keep it always supported, at least for more complicated arguments, an object containing everything needed
    client.contact.add({...}, callback)
    
    // I'm not a promise fanboy, yet you could also return a promise if no callback
    client.contact.add(arg1, arg2, arg3).then( function(res) { console.log(res) ))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions