I’m having a weird issue with the XML-RPC API.
I’m an active developer. I generate a token. It works on the REST API.
I try a call with the XML-RPC API using the same token. It responds with ‘Inactive Developer’
This doesn’t relate to the token - if the token expires, it responds with ‘Not Authorized’. Then, when I refresh the token, it goes back to Inactive Developer.
But, I just used my developer ID to refresh the token, and literally a couple of lines earlier in the code to successfully call the REST API, so I think that Inactive Developer must be an incorrectly returned error?
This is the code I’m using (using the node xmlrpc library)
setTimeout(function () {
const client = xmlrpc.createSecureClient('https://api.infusionsoft.com/crm/xmlrpc/v1?access_token=' + token)
client.methodCall(
'ContactService.linkContacts',
[[token.toString(), coreId, userId, relationshiptype]],
function (error, value) {
if (error) {
console.log(error)
console.log('req headers:', error.req && error.req._header)
console.log('res code:', error.res && error.res.statusCode)
console.log('res body:', error.body)
} else {
console.log('value:', value)
}
})
}, 1000)
And this is what I’m getting back
Error: Invalid XML-RPC message: Developer Inactive
at Deserializer.onDone (/Users/justinhandley/IdeaProjects/lcf/node_modules/xmlrpc/lib/deserializer.js:79:21)
at SAXStream.emit (events.js:159:13)
at SAXParser.SAXStream._parser.onend (/Users/justinhandley/IdeaProjects/lcf/node_modules/sax/lib/sax.js:190:10)
at emit (/Users/justinhandley/IdeaProjects/lcf/node_modules/sax/lib/sax.js:624:35)
at end (/Users/justinhandley/IdeaProjects/lcf/node_modules/sax/lib/sax.js:667:5)
at SAXParser.end (/Users/justinhandley/IdeaProjects/lcf/node_modules/sax/lib/sax.js:154:24)
at SAXStream.end (/Users/justinhandley/IdeaProjects/lcf/node_modules/sax/lib/sax.js:248:18)
at IncomingMessage.onend (_stream_readable.js:598:10)
at Object.onceWrapper (events.js:254:19)
at IncomingMessage.emit (events.js:164:20)
req headers: POST /crm/xmlrpc/v1 HTTP/1.1
User-Agent: NodeJS XML-RPC Client
Content-Type: text/xml
Accept: text/xml
Accept-Charset: UTF8
Connection: Keep-Alive
Content-Length: 318
Host: api.infusionsoft.com
res code: 401
res body: <h1>Developer Inactive</h1>
Any help is much appreciated.