In the past few posts, we’ve been making use of the Zoho CRM API to get data like the list of active users or to be able to delete records from the CRM. Let’s talk a bit more about how the API works, as opposed to the CRM integration tasks that you get from Deluge. 

So we know that you can create a record, fetch all records, search, update, and get related records using the Deluge CRM tasks, but if you want to do other things, then you may need to use the actual Zoho CRM API. For example, if you want to be able to delete records, you can’t do that using deluge script but you definitely can do it via the API.

You can do everything that’s possible using the Deluge version and more. You’ve got the ability to convert leads and you can get deleted record IDs. You can delink relationships between parent and child records, upload files, delete files, upload photos, and get the list of all the modules available. You’ve got many extra options available to you. 

Integrating with the Zoho CRM API

If you stroll on over to the Zoho CRM API docs, you’ll see it provides a few mechanisms for integrating with the API. The first option is cURL:

or similarly low level equivalents in PHP/Ruby:

While this approach does work, it’s pretty clunky.

You’re much better off using an SDK. For example, here’s the equivalent Ruby SDK code:

Much simpler than the native HTTP option.

The simplest way yet is to use deluge script. The equivalent deluge script code would look something like:

record_data = zoho.crm.getRecordById(module_name, record_id, { "converted": false });

Due to the simplicity of the code and the lack of fussing around with OAuth, I usually prefer to use Deluge. See my article on standalone functions for more details.

When Deluge doesn’t work

However, there are some situations where you can’t use Deluge script wrappers:

  1. You want to use special API methods like COQL queries or delete records. Deluge doesn’t support that so you either have to use invoke_url inside Deluge script with a connection or use a different programming language.
  2. You are building an app that needs to work with multiple CRMs. For example, the Smooth Messenger mobile app needs to allow users from many different CRM accounts to log in and access their data (and no-one else’s). In that case, you’ll need to use a different programming language and store OAuth refresh tokens in your database.