activecampaign-rest

0.1.0 • Public • Published

Node.js Client for ActiveCampaign's v3 - REST API

Build Status codecov Maintainability

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': 'john@wick.com',
  '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': 'john@wick.com',
  '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)
})

Readme

Keywords

Package Sidebar

Install

npm i activecampaign-rest

Weekly Downloads

6

Version

0.1.0

License

MIT License

Unpacked Size

23.6 kB

Total Files

12

Last publish

Collaborators

  • android86