-1

I am newbie of Zoho service. I want to use Zoho API in my Node JS application. The application is wrote in Javascript. But I could not find a Javascript example in Zoho REST API Documentation https://www.zoho.com/crm/help/api/v2/#create-bulk-read-op.

Most samples given there are using curl commands…

Could you please check my questions and tell me how to use Zoho API in Node Js Application?

lei lei
  • 1,753
  • 4
  • 19
  • 44
  • Possible duplicate of [How to make remote REST call inside Node.js? any CURL?](https://stackoverflow.com/questions/5643321/how-to-make-remote-rest-call-inside-node-js-any-curl) – Vasan Nov 26 '18 at 23:13
  • Zoho also has a [nodejs sdk](https://www.zoho.com/crm/help/developer/server-side-sdks/node-js.html) which you might be interested in – Vasan Nov 26 '18 at 23:14
  • I have put together an article with some tips and examples, because it was not as straightforward as one would hope: https://medium.com/@ismayilkhayredinov/examples-of-zoho-crm-api-requests-in-node-787462fa78e4 – hypeJunction Jun 28 '19 at 17:03

1 Answers1

4

Use superagent library (npm i superagent):

var superagent = require('superagent')

superagent.
  post('https://www.zohoapis.com/crm/bulk/v2/read').
  set('Authorization', 'Zoho-oauthtoken d92d401c803988c5cb849d0b4215f52').
  send({
    query: {
      module: 'Leads'
    },
    callback: { //optional
      url: 'https://sampledomain.com/getzohoresponse',
      method: 'post'
    }
  }).
  end((err, res) => {
    console.log(err, res.body)
  })
Afanasii Kurakin
  • 3,330
  • 2
  • 24
  • 26