Zoho CRM - XML/JSON - Add Lead

Custom integration that creates/updates contacts directly in a client's Zoho CRM.

Step 1

Credentials

Ask the client to setup their credentials to their console you can provide the following URL with the placeholder replaced

{console}.postclickmarketing.com/Admin/Integration/ExternalServices

 

Within the Custom Category the client needs to create two new entries (suggested labels Zoho CRM API Credentials and Zoho CRM API Auth URL/Refresh Token).

 

In the first entry (Zoho CRM API Credentials) they place their clientID as username and the clientSecret as Password.

 

In the second entry (Zoho CRM API Auth URL/Refresh Token) they place their region specific authentication URL as username e.g.: https://accounts.zoho.com/oauth/v2/token for the Americas. And enter place the refreshtoken as Password value

 

Example: Zoho CRM API Credentials

Example: Zoho CRM API Auth URL/Refresh Token

 

In order to retrieve the refresh token the client needs to follow the self-client instructions (Step 2 to 4) from the Zoho CRM documentation. We can't really help them with those steps as one of them has only a life time of up to 10 minutes. Thus a slow method like e-mail communication would lead to expiry of that token before we can usually react.

 

Step 2: https://www.zoho.com/crm/developer/docs/api/v3/auth-request.html#self-client

Step 3: https://www.zoho.com/crm/developer/docs/api/v3/access-refresh.html

Step 4: https://www.zoho.com/crm/developer/docs/api/v3/refresh.html

The suggested scrope is ZohoCRM.modules.leads

Step 2

Fieldmapping

Setup the Fieldmapping based on the Worksheet provided by the client. And adjust the demo form in their console to match all the fields they want to collect.

 

Example: Zoho CRM - Add Lead fieldmapping

 

As this is a POST XML/JSON integtration also the JSON part will need to be adjusted for every field added.

Note: The access_token is not mapped directly in the JSON but is a dynamic variable  in the integration settings. However it is added to the fieldmapping to prevent submissions if it is missing.

 

Example: Zoho CRM - Add Lead settings

 

Recommendation: In order to keep Fieldmappings as flexible as possible only make the e-mail address required. This tends to allow the fieldmapping to be reused with a lot of variations of form in creative.

 

In order to dispel the concerns of the client. Fields can still be made required in the form in the creative to make sure all data they want is collected.

 

Certain field in Zoho can be left out completely or need special formatting. In order to completely remove them from the fieldmapping if they have no value they need to be generated/transformed by javascript code. See phone and productinterest examples in the field mapping.

Step 3

Integration

Setup the Integration using the Fieldmapping created in the previous step.

  • Ensure the Method for this call is set to POST
  • Add the HTTP content type as application/json
  • Add the additional HTTP Header
    • Using Authorization as name
    • Using Zoho-oauthtoken {{access_token}} as value

 

Example: Zoho CRM - Add Lead

Step 4

Server Scriptlet

Create a new Server scriptlet in their console.

You should be able to directly copy the code from the Server Scriptlet Example.

Depending on the names chosen for the credentials and the integrations itself the lines 2,3 and 4 might need to be updated to match the chosen names.

 

Example: Zoho CRM - Auth/RunIntegration

 

When triggered the scriptlet is running a request to the URL provided in the Credential Set Zoho CRM API Auth URL/Refresh Token using the clientID and clientSecret from Zoho CRM API Credentials.

And then triggers the integration named on line 4 e.g.: Zoho CRM - Add Lead

Step 5

Creative

Add the trigger for the Server Scriptlet. This is usually the submit button on the form. But can be placed anywhere that allows you to add Rules to an action or a Page.

 

Example: Zoho CRM - XML/JSON - Add Lead

 

Note: The Mark to re-run rule is integrated in the server scriptlet on line 57 (actionMarkReexport)

Footer Headline Goes Here

Address, State, Country

1-800-000-0000

help@emailhere.com