BaseCRM Official API V2 library client for NodeJS
$ npm install basecrm
var BaseCRM = require('basecrm');
Using this api without authentication gives an error
var crm = new BaseCRM({
accessToken: '<YOUR_PERSONAL_ACCESS_TOKEN>'
});
The following options are available while instantiating a client:
- accessToken: Personal access token
- baseUrl: Base url for the api
- userAgent: Default user-agent for all requests
- timeout: Request timeout
All requests use Promise with REST.
// RETRIEVE ACCOUNT DETAILS
crm.account()
.then(function(data) {})
// RETRIEVE DEAL'S ASSOCIATED CONTACTS
crm.associatedContacts.find(dealId[, params])
.then(function(items) {})
// CREATE AN ASSOCIATED CONTACT
crm.associatedContacts.create(dealId, data)
.then(function(data) {})
// REMOVE AN ASSOCIATED CONTACT
crm.associatedContacts.remove(dealId, contactId)
.then(function() {})
// RETRIEVE ORDER'S LINE ITEMS
crm.lineItems.find(orderId[, params])
.then(function(items) {})
// RETRIEVE A SINGLE LINE ITEM
crm.lineItems.find(orderId, lineItemId)
.then(function(items) {})
// CREATE A LINE ITEM
crm.lineItems.create(orderId, data)
.then(function(data) {})
// REMOVE A LINE ITEM
crm.lineItems.remove(orderId, lineItemId)
.then(function() {})
// RETRIEVE ALL PIPELINES
crm.pipelines([params])
.then(function(items) {})
// RETRIEVE ALL STAGES
crm.stages([params])
.then(function(items) {})
Contacts, Deal Sources, Deals, Lead Sources, Leads, Loss Reasons, Notes, Orders, Products, Tags and Tasks
var resource = crm.contacts; // or crm.dealSources, crm.deals, crm.leadSources, crm.leads, crm.lossReasons, crm.notes, crm.orders, crm.products, crm.tags and crm.tasks
// RETRIEVE ALL RESOURCES
resource.find([params])
.then(function(items) {})
// RETRIEVE A SINGLE RESOURCE
resource.find(id)
.then(function(data) {})
// CREATE A RESOURCE
resource.create(data)
.then(function(data) {})
// UPDATE A RESOURCE
resource.update(id[, data])
.then(function(data) {})
// DELETE A RESOURCE
resource.delete(id)
.then(function() {})
// RETRIEVE ALL USERS
crm.users.find([params])
.then(function(items) {})
// RETRIEVE A SINGLE USER
crm.users.find(id)
.then(function(data) {})
// RETRIEVE AN AUTHENTICATING USER
crm.users.self()
.then(function(data) {})
MIT
Report here.