Skip to content

juliencousineau/BaseCRM

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BaseCRM

BaseCRM Official API V2 library client for NodeJS

Installation

$ npm install basecrm

Usage

var BaseCRM = require('basecrm');

Build

Using this api without authentication gives an error

var crm = new BaseCRM({
  accessToken: '<YOUR_PERSONAL_ACCESS_TOKEN>'
});

Options

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

Resources and actions

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) {})
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) {})

License

MIT

Bug Reports

Report here.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%