Adding note to a record in Zoho CRM using deluge script and connectors



Hi
In this article i will demonstrate how to use the new deluge run time environment which Zoho released earlier this year (2018)

Connectors are used to generate an abstraction to the new Zoho CRM API V2, which was released earlier in 2018.
In the past we would have had to persist Authtokens inside the code, or a CRM variable, which was a potential failure point, security issue and required maintenance (if for example we would have canceled a token and wanted to replace it…things could suddenly stop working…)

For creating a connector log into Zoho CRM and follow this path : Setup -> Develpoer Space -> Connections

Choose Add connection

Today, we can define using a simple interface a connector with the appropriate scope (for example, connector to leads module with read only permissions, see above example).
After defining a connector we can simply use simple deluge script like this:

    noteMap.put("Note_Title", "My Title");
    noteMap.put("Note_Content", "My Content");
    callingLeadID=  123456789;
    module = "Leads";
    url ="https://www.zohoapis.com/crm/v2/"+module+"/"+callingLeadID+"/Notes";
    cl = "{";
    cr = "}";
    sl = "[";
    sr = "]";
    d = "\"data\"";
    col = ":";
    data = cl  + d + col + sl + noteMap + sr + cr;
    info data;
    response = invokeUrl [
            url : url
            type : POST
            parameters : data
            connection : YOUR_CONNECTION_NAME
    ];
    info response;

Its that simple
No direct api Post calls

No oAuth 2.0 token refreshing managment.
hope it helps
Cheers
Tal



Leave a Reply

Your email address will not be published. Required fields are marked *