Giter Site home page Giter Site logo

zoho-crm's Introduction

@effco/zoho-crm

Another WORK IN PROGESS tool from us!

v0.2 works with V2 of Zoho API, for V1 use v0.1 of the library

Wrapper around Zoho CRM API. Built with the intention of abstracting the limitations of Zoho API in Node environment. Should work with any module although targeted and tested for 'deals'.

It takes and returns plain standard JSON objects, retrieves more than 200 results by iterating through the module data and is promise based so async/await ready.

Install

yarn add @effco/zoho-crm

or

npm i -S @effco/zoho-crm

Usage

Environmental variables

In order to satisfy OAuth2 requirements of Zoho API few values are required to be provided via env. Available from accounts.zoho.com/developerconsole

  • ZOHO_CLIENT_ID
  • ZOHO_CLIENT_SECRET
  • ZOHO_GRANT_TOKEN - only needed once, to generate access & refresh token. Generated in the Self Client menu (click the ... button to the right once application is created). Enter 'aaaserver.profile.READ,ZohoCRM.users.all,ZohoCRM.settings.all,ZohoCRM.modules.all' as scope
  • API_URL - only needed once, to generate access & refresh token. In developer console enter API_URL/oauth/zoho, here just API_URL
  • ZOHO_LOCATION - Zoho instance, default is 'com' - other options currently are: 'eu', 'com.cn'

Example

Require lib

const zoho = require('@effco/zoho-crm')

Users

// Retrieve all active Users
const users = await zoho.get('users')

Deals (or any other module)

get()
// Retrieve all Deals
const deals = await zoho.get('deals')

// Retrieve all Deals - select columns returned (id is always returned)
const deals = await zoho.get('deals', {}, ['Column 1', 'Column 2'])

// Retrieve all Deals owned by a User
const deals = await zoho.get('deals', { ownerId: 'ownerId' })

// Retrieve one Deal byId
const deal = await zoho.get('deals', { id: 'dealId' })

// Retrieve one Deal byId - select columns returned (id is always returned)
const deal = await zoho.get('deals', { id: 'dealId' }, ['Column 1', 'Column 2'])

// Retrieve multiple Deals
const deal = await zoho.get('deals', { id: ['dealId1', 'dealId2'] })

// Retrieve multiple Deals byId - select columns returned (id is always returned)
const deal = await zoho.get('deals', { id: ['dealId1', 'dealId2']}, ['Column 1', 'Column 2'] )
update()
// Update one Deal
zoho.update('Deals', {
  id: 'dealId'
  Stage: 'Qualification',
  'Custom field': 'New Value'
})

// Update multiple Deals
zoho.update('Deals', [{
  id: 'dealId1'
  Stage: 'Qualification',
},
  { id: 'DEAL_ID2',
  'Custom field': 'New Value'
}])

zoho-crm's People

Contributors

tkostus avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.