activecampaign-rest
v0.1.0
Published
ActiveCampaign REST Nodejs SDK
Downloads
28
Readme
Node.js Client for ActiveCampaign's v3 - REST API
Install
This library is distributed on npm. To add it as a dependency, run the following command:
$ npm install activecampaign-rest
Usage
Basic Use Case - Contact.Sync()
const AC = require('activecampaign-rest')
let contact = new AC.Contact({
'url': 'https://xxx.api-us1.com',
'token': 'API_TOKEN'
})
let payload = {
'email': '[email protected]',
'firstName': 'john',
'lastName': 'wick',
'phone': '032-123-1234'
}
contact.sync(payload, (err, res) => {
if (err) {}
console.log(res)
})
Custom Fields Use Case - Contact.Sync()
const AC = require('activecampaign-rest')
let contact = new AC.Contact({
'url': 'https://xxx.api-us1.com',
'token': 'API_TOKEN'
})
let payload = {
'email': '[email protected]',
'firstName': 'john',
'lastName': 'wick',
'phone': '032-123-1234',
'fields': [
{
'name': 'Company',
'value':'ABC'
},
{
'name': 'License',
'value':'MIT'
},
]
}
contact.sync(payload, (err, res) => {
if (err) {}
console.log(res)
})