Insert Records In Zoho Modules Using Deluge

In this tutorial, We are going to learn to Insert Records in  Zoho Modules Using Deluge.

API: https://www.zohoapis.com/crm/v2/{module_api_name}

Request URL:

https://www.zohoapis.com/crm/v2/Leads

Header:

Authorization: Zoho-oauthtoken 1000.XXXXXXXXXXXXXXXX.XXXXXXXXXXXX2

To the creation of access token and refresh token please follow Generate Refresh and Access Token, Access token from refresh token.

Full Source Code:

token = invokeurl 
[ 
  url:"https://accounts.zoho.com/oauth/v2/token?refresh_token=1000.XXXXXXXXXXXXXXXXXXXX.XXXXXXXX&client_id=1000.XXXXXXXXXXXXXXXXXXXX.XXXXXXXX&client_secret=1000.XXXXXXXXXXXXXXXXXXXX.XXXXXXXX&grant_type=refresh_token" 
  type :POST 
]; 
zoho_token = token.get('access_token'); 
info zoho_token; 

header_project = Map(); 
header_project.put("Authorization","Zoho-oauthtoken " + zoho_token);

new_project = Map();
new_project.put("Last_Name","Testing Name");
    
insert_leads_response = invokeurl 
[ 
  url : "https://www.zohoapis.com/crm/v2/Leads" 
  type : POST
  parameters : new_project
  headers : header_project 
]; 
data = insert_leads_response.get("data"); 
info insert_leads_response;

Thank You.

Submit a Comment

Your email address will not be published.

Subscribe

Select Categories