Create a LEAD in ZOHO CRM using node js

Create a LEAD in ZOHO CRM using node js

In this article, I will explain you that, how we can insert a lead in ZOHO CRM with node js, for this we will create lead with XMLDATA using CURL request. You can create leads, accounts, contacts, deals, campaigns, tasks, cases, events, calls, solutions, products, vendors, pricebooks, quotes, salesorders, purchaseorders, invoices, custom, and notes also with ZOHO CRM. https://crm.zoho.com/crm/private/json/Leads/insertRecords API is used to insert a LEAD in ZOHO CRM with XMLDATA . 

We will install below dependencies in node js to insert lead with zoho CRM

  1. axios
  2. xml
  3. querystring

To insert LEAD in ZOHO CRM with node js auth_token is required. I'm using the following code to insert LEAD.

const axios = require('axios')
const xml = require('xml')
const querystring = require('querystring')
const xmlData = xml({
Leads: [
{
row: [
{ _attr: { no: '1' } },
{ FL: [{ _attr: { val: 'Company' } }, 'NoMeLoMe IT'] },
{ FL: [{ _attr: { val: 'First Name' } }, 'User'] },
{ FL: [{ _attr: { val: 'Last Name' } }, 'Test'] },
{ FL: [{ _attr: { val: 'Referred By' } }, 'blank'] },
{ FL: [{ _attr: { val: 'Email' } }, 'sdfsdfsd@dfg.hgfj'] }
]
}
]
})

axios({
url: 'https://crm.zoho.com/crm/private/json/Leads/insertRecords?authtoken=AUTH TOKEN HERE&scope=crmapi&xmlData='+xmlData,
method: 'POST',
data: {
foo: 'bar'
}
})

 

Hi, I'm Saurav, the developer behind usingphp. Donate to help me keep usingphp free and maintained.

Please let me know what your thoughts or comments are on this article. If you have any suggestion or found any mistake in this article then please let us know.

Latest Comments

Add your comment