Table of Contents

Send Leads to Zoho CRM

Abby Updated by Abby

This guide walks through how to send leads to Zoho CRM. In order to do so it's necessary to authenticate with the Zoho CRM API using a Self Client.

Step 1: Register a Self Client in Zoho

  1. Go to api-console.zoho.com
  2. Click Add Client → select Self Client

  1. In the scope you'll add: zohocrm.modules.all Set the expiry to 10 minutes to allow yourself enough time to finish setting up the integration.

If it expires before you are able to test the first webhook, you will need to go back and create it again. In the description make a note that this is for Landbot.

  1. Once you've clicked on Create it will generate a one time temporary grant code that you will use to create a permanent refresh token. Copy that code.

⚠️ Important: This code expires fast and can only be used once. Do the next step immediately.

  1. Click on the Client Secret tab and note down your Client ID and Client Secret - you'll need both going forward

Step 2: Exchange the grant code for a refresh token

Use a separate webhook block to make a POST request, replacing the placeholders for your credentials:

https://accounts.zoho.com/oauth/v2/token?code=YOUR_TEMPORARY_CODE&grant_type=authorization_code&client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET&scope=zohocrm.modules.all

If successful, you'll get back JSON like:

200

{
"access_token": "1000.xxxxxxxx",
"refresh_token": "1000.yyyyyyyy",
"scope": "ZohoCRM.modules.ALL",
"api_domain": "https://www.zohoapis.com",
"token_type": "Bearer",
"expires_in": 3600
}

Save the refresh_token somewhere safe. This is the credential your integration will reuse from now on - it doesn't expire on its own.

Step 3: Use the refresh token to get an access token in Landbot

In Landbot you will need two webhook blocks; the first will generate the access token, and the second will use that access token to send the lead to Zoho.

Every time your script needs to call the CRM API, you must pass through the first webhhook block to request a fresh access token (they expire after 1 hour):

https://accounts.zoho.com/oauth/v2/token?refresh_token=YOUR_REFRESH_TOKEN&grant_type=refresh_token&client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET&scope=zohocrm.modules.all

This returns a new access_token you can use immediately. You need to store this access token in a variable (to save individual variables click on the purple banner):

Step 4: Call the CRM API

In the second webhook block use the access token in the Authorization header (to test the webhook you will need to use the real value):

curl -X POST https://www.zohoapis.com/crm/v8/Leads \
-H "Authorization: Zoho-oauthtoken YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"data": [
{
"Lead Name": "@name",
"Company": "@company",
"Last_Name": "@last_name",
"Email": "@email",
"Phone": "@phone"
}
]
}'

To send fields from landbot you need to use this syntax: "@variable"

Was this article helpful?

Shopify in Landbot: Get Order Information

Contact