ZOHO CRM SDK

ZOHO CRM SDK

staticZOHO.CRM.API.addNotes(config){Promise}

Add Notes to a record

NameTypeDescription
configObject Configuration Object.
NameTypeDescription
EntityString SysRefName of the module.
RecordIDLong RecordID to associate the notes.
TitleString Notes Title.
ContentString Notes Content.
Returns:
TypeDescription
Promise Resolved with notes creation status
Example
ZOHO.CRM.API.addNotes({Entity:"Leads",RecordID:"1475615000000292033",Title:"Notes Title",Content:"TitleContent"}).then(function(data){ console.log(data); }); //prints { "code": "SUCCESS", "details": { "created_time": "2017-01-12T04:56:33+05:30", "modified_time": "2017-01-12T04:56:33+05:30", "modified_by": { "name": "Naresh Babu Naresh Babu", "id": "1475615000000083003" }, "id": "1475615000000484005", "created_by": { "name": "Naresh Babu Naresh Babu", "id": "1475615000000083003" } }, "message": "record added", "status": "success" }

staticZOHO.CRM.API.deleteRecord(config){Promise}

To delete a record from a module

NameTypeDescription
configObject Configuration Object.
NameTypeDescription
EntityString SysRefName of the module.
RecordIDString RecordID to associate the notes.
Returns:
TypeDescription
Promise Resolved with Response to update record
Example
ZOHO.CRM.API.deleteRecord({Entity:"Leads",RecordID: "1000000049031"}) .then(function(data){ console.log(data) }) //prints [ { "data": [ { "message": "record updated", "details": { "created_by": { "id": "4108880000086001", "name": "Patricia Boyle" }, "id": "4108880000478060", "modified_by": { "id": "4108880000086001", "name": "Patricia Boyle" }, "modified_time": "2016-04-28T17:59:21+05:30", "created_time": "2016-04-28T17:59:21+05:30" }, "status": "success", "code": "SUCCESS" } ] } ] 

staticZOHO.CRM.API.delinkRelatedRecord(config){Promise}

To delink the relation between the records

NameTypeDescription
configobject Configuration Object
NameTypeDescription
EntityString SysRefName of the module.
RecordIDString RecordID to associate the notes.
RelatedListNameString SysRefName of the relatedList.
RelatedRecordIDString Related Record ID
Returns:
TypeDescription
Promise Resolved user matching userID
Example
ZOHO.CRM.API.delinkRelatedRecord({Entity:"Leads",RecordID:"1000000079113",RelatedList:"Campaigns",RelatedRecordID:"1000000080041"}) .then(function(data){ console.log(data) }) //prints [ { "code": "SUCCESS", "details": { "id": 1000000080041 }, "message": "relation updated", "status": "success" } ]

staticZOHO.CRM.API.getAllRecords(config){Promise}

get list of all records in a module

NameTypeDescription
configObject Configuration Object.
NameTypeDescription
EntityString SysRefName of the module.
sort_orderStringoptional To sort records. allowed values {asc|desc}
convertedStringoptional To get the list of converted records
approvedStringoptional To get the list of approved records
pageStringoptional To get the list of records from the respective pages
per_pageStringoptional To get the list of records available per page
Returns:
TypeDescription
Promise Resolved with data of record matching with RecordID
Example
ZOHO.CRM.API.getAllRecords({Entity:"Leads",sort_order:"asc",per_page:2,page:1}) .then(function(data){ console.log(data) }) //prints [ { "Owner": { "name": "asd devvv", "id": "1000000030132" }, "Company": "Zylkerssssss", "Email": null, "Description": null, "$photo_id": null, "Website": null, "Twitter": null, "$upcoming_activity": null, "Salutation": null, "Last_Activity_Time": "2017-01-19T17:10:04+05:30", "First_Name": null, "Full_Name": "Petersonssssss", "Lead_Status": null, "Industry": null, "Modified_By": { "name": "asd devvv", "id": "1000000030132" }, "Skype_ID": null, "$process_flow": false, "$converted": false, "Phone": null, "Street": null, "Zip_Code": null, "id": "1000000070208", "Email_Opt_Out": false, "$approved": true, "Designation": null, "$approval": { "delegate": false, "approve": false, "reject": false }, "Modified_Time": "2017-01-19T17:10:04+05:30", "Created_Time": "2017-01-19T17:09:28+05:30", "$converted_detail": { }, "$followed": false, "City": null, "No_of_Employees": 0, "Mobile": null, "Last_Name": "Petersonssssss", "State": null, "$status": "cmv_1-1", "Lead_Source": null, "Country": null, "Created_By": { "name": "asd devvv", "id": "1000000030132" }, "Fax": null, "Annual_Revenue": 0, "Secondary_Email": null }, { "Owner": { "name": "asd devvv", "id": "1000000030132" }, "Company": "Zylker", "Email": null, "Description": null, "$photo_id": null, "Website": null, "Twitter": null, "$upcoming_activity": null, "Salutation": null, "Last_Activity_Time": "2017-01-23T18:34:09+05:30", "First_Name": null, "Full_Name": "Peterson", "Lead_Status": null, "Industry": null, "Modified_By": { "name": "asd devvv", "id": "1000000030132" }, "Skype_ID": null, "$process_flow": false, "$converted": false, "Phone": "1234322", "Street": null, "Zip_Code": null, "id": "1000000070210", "Email_Opt_Out": false, "$approved": true, "Designation": null, "$approval": { "delegate": false, "approve": false, "reject": false }, "Modified_Time": "2017-01-23T18:34:09+05:30", "Created_Time": "2017-01-19T17:10:40+05:30", "$converted_detail": { }, "$followed": false, "City": null, "No_of_Employees": 0, "Mobile": null, "Last_Name": "Peterson", "State": null, "$status": "cmv_1-1", "Lead_Source": null, "Country": null, "Created_By": { "name": "asd devvv", "id": "1000000030132" }, "Fax": null, "Annual_Revenue": 0, "Secondary_Email": null } ]

staticZOHO.CRM.API.getAllUsers(config){Promise}

To retrieve list of users in ZohoCRM

NameTypeDescription
configobject Configuration Object
NameTypeDescription
TypeString Allowed values "AllUsers | ActiveUsers | DeactiveUsers | ConfirmedUsers | NotConfirmedUsers | DeletedUsers | ActiveConfirmedUsers | AdminUsers | ActiveConfirmedAdmins"
Returns:
TypeDescription
Promise Resolved List of users matching specified Type
Example
ZOHO.CRM.API.getAllUsers({Type:"AllUsers"}) .then(function(data){ console.log(data) })

staticZOHO.CRM.API.getRecord(config){Promise}

get all Details of a record

NameTypeDescription
configObject Configuration Object.
NameTypeDescription
EntityString SysRefName of the module.
RecordIDString RecordID to associate the notes.
Returns:
TypeDescription
Promise Resolved with data of record matching with RecordID
Example
ZOHO.CRM.API.getRecord({Entity:"Leads",RecordID:"1000000030132"}) .then(function(data){ console.log(data) }) //prints [ { "Owner": { "name": "asd devvv", "id": "1000000030132" }, "Company": "zoho", "Email": "", "Description": null, "$photo_id": null, "Website": null, "Twitter": null, "$upcoming_activity": null, "Salutation": "", "Last_Activity_Time": "2016-12-30T15:09:23+05:30", "First_Name": null, "Full_Name": "sridhar", "Lead_Status": null, "Industry": null, "Modified_By": { "name": "asd devvv", "id": "1000000030132" }, "Skype_ID": null, "$process_flow": false, "$converted": false, "Phone": null, "Street": null, "Zip_Code": null, "id": "1000000049009", "Email_Opt_Out": false, "$approved": true, "Designation": null, "$approval": { "delegate": false, "approve": false, "reject": false }, "Modified_Time": "2016-12-30T15:09:23+05:30", "Created_Time": "2016-12-30T06:09:44+05:30", "$converted_detail": { }, "$followed": false, "City": null, "No_of_Employees": 0, "Mobile": "+16692317086", "Last_Name": "sridhar", "State": null, "$status": "cmv_1-1", "Lead_Source": null, "Country": null, "Created_By": { "name": "asd devvv", "id": "1000000030132" }, "Fax": null, "Annual_Revenue": 0, "Secondary_Email": null } ]

staticZOHO.CRM.API.getRelatedRecords(config){Promise}

To retrive related list records

NameTypeDescription
configobject Configuration Object
NameTypeDescription
EntityString SysRefName of the module.
RecordIDString RecordID to associate the notes.
RelatedListNameString SysRefName of the relatedList.
Returns:
TypeDescription
Promise Resolved user matching userID
Example
ZOHO.CRM.API.getRelatedRecords({Entity:"Leads",RecordID:"1000000030132",RelatedList:"Notes"}) .then(function(data){ console.log(data) }) //prints [ { "$approval": { "delegate": false, "approve": false, "reject": false }, "Owner": { "name": "asd devvv", "id": "1000000030132" }, "Modified_Time": "2017-02-02T19:42:21+05:30", "$attachments": [], "Created_Time": "2017-02-02T19:42:21+05:30", "$followed": false, "Parent_Id": { "First_Name": null, "Last_Name": "Peterson", "name": "Peterson", "id": "1000000079113" }, "$se_module": "Leads", "Modified_By": { "name": "asd devvv", "id": "1000000030132" }, "$size": null, "$process_flow": false, "$voice_note": false, "id": "1000000080035", "Created_By": { "name": "asd devvv", "id": "1000000030132" }, "Note_Title": "", "Note_Content": "Deal closed" }, { "$approval": { "delegate": false, "approve": false, "reject": false }, "Owner": { "name": "asd devvv", "id": "1000000030132" }, "Modified_Time": "2017-02-02T19:42:12+05:30", "$attachments": [], "Created_Time": "2017-02-02T19:42:12+05:30", "$followed": false, "Parent_Id": { "First_Name": null, "Last_Name": "Peterson", "name": "Peterson", "id": "1000000079113" }, "$se_module": "Leads", "Modified_By": { "name": "asd devvv", "id": "1000000030132" }, "$size": null, "$process_flow": false, "$voice_note": false, "id": "1000000080031", "Created_By": { "name": "asd devvv", "id": "1000000030132" }, "Note_Title": "", "Note_Content": "Call Scheduled on 5th jan" }, { "$approval": { "delegate": false, "approve": false, "reject": false }, "Owner": { "name": "asd devvv", "id": "1000000030132" }, "Modified_Time": "2017-02-02T19:41:56+05:30", "$attachments": [], "Created_Time": "2017-02-02T19:41:56+05:30", "$followed": false, "Parent_Id": { "First_Name": null, "Last_Name": "Peterson", "name": "Peterson", "id": "1000000079113" }, "$se_module": "Leads", "Modified_By": { "name": "asd devvv", "id": "1000000030132" }, "$size": null, "$process_flow": false, "$voice_note": false, "id": "1000000080025", "Created_By": { "name": "asd devvv", "id": "1000000030132" }, "Note_Title": "", "Note_Content": "Followup Required" } ]

staticZOHO.CRM.API.getUser(config){Promise}

To retrieve list of users in ZohoCRM

NameTypeDescription
configobject Configuration Object
NameTypeDescription
IDString UserID
Returns:
TypeDescription
Promise Resolved user matching userID
Example
ZOHO.CRM.API.getUser({ID:"1000000030132"}) .then(function(data){ console.log(data) })

staticZOHO.CRM.API.insertRecord(config){Promise}

Insert record to a modue

NameTypeDescription
configObject Configuration Object.
NameTypeDescription
EntityString SysRefName of the module.
APIDataObject RecordID to associate the notes.
Returns:
TypeDescription
Promise Resolved with response data
Examples
var recordData = { "Company": "Zylker", "Last_Name": "Peterson" } ZOHO.CRM.API.insertRecord({Entity:"Leads",APIData:recordData}).then(function(data){ console.log(data); }); //prints [ { "code": "SUCCESS", "details": { "created_time": "2017-01-19T17:10:40+05:30", "modified_time": "2017-01-19T17:10:40+05:30", "modified_by": { "name": "asd devvv", "id": "1000000030132" }, "id": "1000000070210", "created_by": { "name": "asd devvv", "id": "1000000030132" } }, "message": "record added", "status": "success" } ]
var data = [ { "Company": "ZohoCorp", "Last_Name": "Babu" }, { "Company": "ZohoCorp", "Last_Name": "Suganya" } ]; ZOHO.CRM.API.insertRecord({Entity:"Leads",APIData:data}).then(function(data){ console.log(data); }); //prints [ { "code": "SUCCESS", "details": { "created_time": "2017-02-02T05:18:53+05:30", "modified_time": "2017-02-02T05:18:53+05:30", "modified_by": { "name": "asd devvv", "id": "1000000030132" }, "id": "1000000079113", "created_by": { "name": "asd devvv", "id": "1000000030132" } }, "message": "record added", "status": "success" }, { "code": "MANDATORY_NOT_FOUND", "details": { "api_name": "Last_Name" }, "message": "required field not found", "status": "error" } ]

staticZOHO.CRM.API.searchRecord(config){Promise}

To retrieve the records that matches your search criteria

NameTypeDescription
configobject Configuration Object
NameTypeDescription
EntityString SysRefName of module
TypeString Allowed values "email|phone|word|criteria"
QueryString query String
Returns:
TypeDescription
Promise Resolved with search result
Examples
ZOHO.CRM.API.searchRecord({Entity:"Leads",Type:"phone",Query:"12555036573"}) .then(function(data){ console.log(data) })
ZOHO.CRM.API.searchRecord({Entity:"Leads",Type:"email",email:""}) .then(function(data){ console.log(data) })

staticZOHO.CRM.API.updateRecord(config){Promise}

To update a record in a module

NameTypeDescription
configObject Configuration Object.
NameTypeDescription
EntityString SysRefName of the module.
APIDataString Update Record Data.
Returns:
TypeDescription
Promise Resolved with data of update Record Response
Example
var config={ Entity:"Leads", APIData:{ "id": "1000000049031", "Company": "Zylker", "Last_Name": "Peterson" } } ZOHO.CRM.API.updateRecord(config) .then(function(data){ console.log(data) }) //prints [ { "data": [ { "message": "record updated", "details": { "created_by": { "id": "4108880000086001", "name": "Patricia Boyle" }, "id": "4108880000478060", "modified_by": { "id": "4108880000086001", "name": "Patricia Boyle" }, "modified_time": "2016-04-28T17:59:21+05:30", "created_time": "2016-04-28T17:59:21+05:30" }, "status": "success", "code": "SUCCESS" } ] } ] 

staticZOHO.CRM.API.updateRelatedRecords(config){Promise}

To update the relation between the records

NameTypeDescription
configobject Configuration Object
NameTypeDescription
EntityString SysRefName of the module.
RecordIDString RecordID to associate the notes.
RelatedListNameString SysRefName of the relatedList.
RelatedRecordIDString Related Record ID
APIDataString Data to be updated in the related record
Returns:
TypeDescription
Promise Resolved user matching userID
Example
var APIData = { Description:"Test description" } ZOHO.CRM.API.updateRelatedRecords({Entity:"Leads",RecordID:"1000000079113",RelatedList:"Campaigns",RelatedRecordID:"1000000080041",APIData:APIData}) .then(function(data){ console.log(data) }) //prints [ { "code": "SUCCESS", "details": { "id": 1000000080041 }, "message": "relation updated", "status": "success" } ]

You Might Also Like