Examples of Zoho CRM API requests in Node

I couldn’t find any examples of using Zoho’s Node SDK to query CRM, so here are some examples for you.

Authentication:

See my previous post on the subject: https://medium.com/@ismayilkhayredinov/weirded-out-by-zoho-crm-api-6e3fd637237d

Get records from a module

To query records from a module, you will need to know the module name. To see all the modules and their names, go to Zoho CRM, click on the settings icon in the top right corners, go to Developer Space > APIs, and click on API Names button next to Usage. If you click on the module name, you will also see the entire schema of the record, which will be helpful for creating new records or updating existing ones.

Get a single record by ID

Search records in a module

To search records, you will need to use criteria param. Criteria, according to docs, looks something like:

criteria=(((Last_Name:equals:Steve) and (Company:equals:Zillum)) or (Lead_Status:equals:Contacted))

You will therefore need to know what each field in your module is called, which can be seen in the response of the get request. I didn’t find parameter names in the Zoho UI.

It looks like criteria supports only two operators equals and starts_with . You can query by multiple criteria using and and or logical operators, e.g. ((Course_Type:equals:A) or (Course_Type:equals:B)) . Basically this method is not suitable for anything more complex than basic string searches, i.e. you won’t be able to retrieve records, where a date is before or after a specified timestamp, or make some fancy regex matches. Sad.

Insert record(s)

Now, this is when you realize Zoho SDK and docs are far from perfect. After numerous trials and errors, many unhelpful error responses, I had to dig into the source code and focus on Curl docs: I have come to realize that they expect an input as an array of records in the post body.

Also be warned! In case of a duplicate record you get a success response, not an error. The response is not a newly created record, but only an id and some timestamps.

Update record(s)

Other non-standard requests

To make requests outside of stadard module CRUD, you can use `zcrmsdk` utils.

Here is an example of retrieving notes attached to a contact (you should check the Zoho API docs for a specific URL and expected params).

This should do it. I hope this is helpful and you spend less time than I did on getting this seemingly simple operations working.

Full-stack developer, passionate about front-end frameworks, design systems and UX.