You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
// Allows multiple clients, could also use 'new' to be clear about that but not necessaryvarclient=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 neededclient.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 neededclient.contact.add({...},callback)// I'm not a promise fanboy, yet you could also return a promise if no callbackclient.contact.add(arg1,arg2,arg3).then(function(res){console.log(res)))
Activity
jasonshouse commentedon Feb 6, 2015
👍 for node examples
temsa commentedon Feb 24, 2016
👍
kressaty commentedon Mar 3, 2016
@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 ?
temsa commentedon Mar 9, 2016
@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
xmlrpcwould be ok :)kressaty commentedon Mar 9, 2016
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)temsa commentedon Mar 15, 2016
For a library, maybe something more like this ?