-
staticZOHO.CRM.API.addNotes(config){Promise}
-
Add Notes to a record
Name |
Type |
Description |
config |
Object
|
Configuration Object.
Name |
Type |
Description |
Entity |
String
|
SysRefName of the module. |
RecordID |
Long
|
RecordID to associate the notes. |
Title |
String
|
Notes Title. |
Content |
String
|
Notes Content. |
|
Returns:
Type |
Description |
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
{
"data": [
{
"code": "SUCCESS",
"details": {
"Modified_Time": "2017-12-20T14:08:56+05:30",
"Modified_By": {
"name": "NareshTesting",
"id": "1000000031157"
},
"Created_Time": "2017-12-20T14:08:56+05:30",
"id": "1000000044101",
"Created_By": {
"name": "NareshTesting",
"id": "1000000031157"
}
},
"message": "record added",
"status": "success"
}
]
}
-
staticZOHO.CRM.API.approveRecord(config){Promise}
-
approve the record
Name |
Type |
Description |
config |
object
|
configuration object
Name |
Type |
Description |
Entity |
string
|
SysRefName of module |
RecordID |
string
|
id of the record. |
actionType |
string
|
type of action Allowed values "approve" | "delegate" | "resubmit" | "reject" |
comments |
string
|
comments (optional) |
user |
string
|
only for delegate |
|
Returns:
Type |
Description |
Promise
|
Resolved with the details of approval |
Example
var config = {
Entity:"Leads",
RecordID:"111155000000036014",
actionType:"approve"
}
ZOHO.CRM.API.approveRecord(config).then(function(data){
console.log(data);
});
//prints
{
"code": "SUCCESS",
"details": {
"id": "111155000000036014"
},
"message": "Record approved successfully",
"status": "success"
}
-
staticZOHO.CRM.API.attachFile(config){Promise}
-
To delink the relation between the records
Name |
Type |
Description |
config |
object
|
Configuration Object
Name |
Type |
Description |
Entity |
String
|
SysRefName of the module. |
RecordID |
String
|
RecordID to associate the notes. |
File |
object
|
File Object
Name |
Type |
Description |
Name |
String
|
File Name |
Content |
object
|
File Content |
|
|
Returns:
Type |
Description |
Promise
|
Resolved user Upload acknowledgement |
Example
ZOHO.CRM.API.attachFile({Entity:"Leads",RecordID:"1000000031092",File:{Name:"myFile.txt",Content:blob}}).then(function(data){
console.log(data);
});
//prints
{
"data": [
{
"code": "SUCCESS",
"details": {
"Modified_Time": "2017-12-20T14:22:30+05:30",
"Modified_By": {
"name": "NareshTesting",
"id": "1000000031157"
},
"Created_Time": "2017-12-20T14:22:30+05:30",
"id": "1000000044106",
"Created_By": {
"name": "NareshTesting",
"id": "1000000031157"
}
},
"message": "attachment uploaded successfully",
"status": "success"
}
]
}
-
staticZOHO.CRM.API.coql(queryObject){Promise}
-
Get records from the module through COQL query API.
Name |
Type |
Description |
queryObject |
Object
|
Config Json.
Name |
Type |
Description |
select_query |
String
|
Select query. |
|
Returns:
Type |
Description |
Promise
|
Resolved with list of record(s) matching the query. |
Example
var config = {
"select_query": "select Last_Name, First_Name, Full_Name from Contacts where Last_Name = 'Boyle' and First_Name is not null limit 2"
}
ZOHO.CRM.API.coql(config).then(function(data){
console.log(data);
});
//prints
{
"data": [
{
"First_Name": null,
"Last_Name": null,
"id": "111118000000047003"
}
],
"info": {
"count": 1,
"more_records": false
}
}
-
staticZOHO.CRM.API.deleteRecord(config){Promise}
-
To delete a record from a module
Name |
Type |
Description |
config |
Object
|
Configuration Object.
Name |
Type |
Description |
Entity |
String
|
SysRefName of the module. |
RecordID |
String
|
RecordID to associate the notes. |
|
Returns:
Type |
Description |
Promise
|
Resolved with Response to update record |
Example
ZOHO.CRM.API.deleteRecord({Entity:"Leads",RecordID: "1000000049031"})
.then(function(data){
console.log(data)
})
//prints
{
"data": [
{
"code": "SUCCESS",
"details": {
"id": "3000000040015"
},
"message": "record deleted",
"status": "success"
}
]
}
-
-
To delink the relation between the records
Name |
Type |
Description |
config |
object
|
Configuration Object
Name |
Type |
Description |
Entity |
String
|
SysRefName of the module. |
RecordID |
String
|
RecordID to associate the notes. |
RelatedListName |
String
|
SysRefName of the relatedList. |
RelatedRecordID |
String
|
Related Record ID |
|
Returns:
Type |
Description |
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
{
"data": [
{
"code": "SUCCESS",
"details": {
"id": "3000000040055"
},
"message": "record deleted",
"status": "success"
}
]
}
-
staticZOHO.CRM.API.getAllActions(config){Promise}
-
We can view all the available actions that can be performed on a particular record.
Name |
Type |
Description |
config |
object
|
Configuration Object
Name |
Type |
Description |
Entity |
String
|
SysRefname of module |
RecordID |
String
|
id of the particular record. |
|
Returns:
Type |
Description |
Promise
|
Resolved List of actions be the specified module record. |
Example
var config = {
Entity: "Leads",
RecordID : "518440000000222778"
}
ZOHO.CRM.API.getAllActions(config)
.then(function(data){
console.log(data)
})
//prints
{
"actions": [
{
"http_method": "GET",
"name": "custom_links",
"href": "/v2/Leads/111155000000036014/actions/custom_links"
},
{
"http_method": "POST",
"name": "change_owner",
"href": "/v2/Leads/111155000000036014/actions/change_owner"
},
{
"http_method": "POST",
"name": "approvals",
"href": "/v2/Leads/111155000000036014/actions/approvals",
"params": [
{
"name": "action",
"type": "text",
"value": [
"approve",
"delegate",
"reject",
"resubmit"
]
},
{
"name": "comments",
"type": "text"
}
]
}
]
}
The above response is obtained if the record is waiting for the approval and if the caller has administrator access.
If the record has no valid approval pending or the record id is invalid, the following is the response obtained.
{
"actions": [
{
"http_method": "GET",
"name": "custom_links",
"href": "/v2/Leads/111155000000036014/actions/custom_links"
},
{
"http_method": "POST",
"name": "change_owner",
"href": "/v2/Leads/111155000000036014/actions/change_owner"
}
]
}
-
staticZOHO.CRM.API.getAllProfiles(){Promise}
-
To get all the profiles in the app
Returns:
Type |
Description |
Promise
|
Resolved with all the profiles present in the app |
Example
ZOHO.CRM.API.getAllProfiles().then(function(data){
console.log(data);
});
//prints
{
"profiles": [
{
"created_time": null,
"modified_time": null,
"name": "Administrator",
"modified_by": null,
"description": "This profile will have all the permissions. Users with Administrator profile will be able to view and manage all the data within the organization *. * account by default.",
"id": "12000000029855",
"category": false,
"created_by": null
},
{
"created_time": null,
"modified_time": null,
"name": "Standard",
"modified_by": null,
"description": "This profile will have all the permissions except administrative privileges.",
"id": "12000000029858",
"category": false,
"created_by": null
},
{
"created_time": "2018-02-05T14:20:38+05:30",
"modified_time": "2018-02-05T17:44:58+05:30",
"name": "TestUser",
"modified_by": {
"name": "Arun ",
"id": "12000000032013"
},
"description": "TestUser API",
"id": "12000000033045",
"category": true,
"created_by": {
"name": "Arun ",
"id": "12000000032013"
}
}
]
}
-
staticZOHO.CRM.API.getAllRecords(config){Promise}
-
get list of all records in a module
Name |
Type |
Description |
config |
Object
|
Configuration Object.
Name |
Type |
Description |
Entity |
String
|
SysRefName of the module. |
sort_order |
String
|
optional
To sort records. allowed values {asc|desc} |
converted |
String
|
optional
To get the list of converted records |
approved |
String
|
optional
To get the list of approved records |
page |
String
|
optional
To get the list of records from the respective pages |
per_page |
String
|
optional
To get the list of records available per page |
|
Returns:
Type |
Description |
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
{
"data": [
{
"Owner": {
"name": "NareshTesting ",
"id": "3000000031045"
},
"Company": "Testrec1",
"Email": null,
"Description": null,
"$currency_symbol": "$",
"$photo_id": null,
"Website": null,
"Twitter": null,
"$upcoming_activity": null,
"Salutation": null,
"Last_Activity_Time": "2017-12-16T09:54:37+05:30",
"First_Name": null,
"Full_Name": "Testrec1",
"Lead_Status": null,
"Industry": null,
"Modified_By": {
"name": "NareshTesting ",
"id": "3000000031045"
},
"Skype_ID": null,
"$converted": false,
"$process_flow": false,
"Phone": null,
"Street": null,
"Zip_Code": null,
"id": "3000000032009",
"Email_Opt_Out": false,
"$approved": true,
"Designation": null,
"$approval": {
"delegate": false,
"approve": false,
"reject": false
},
"Modified_Time": "2017-12-16T09:54:37+05:30",
"Created_Time": "2017-12-16T09:54:37+05:30",
"$converted_detail": {},
"$followed": false,
"$editable": true,
"City": null,
"No_of_Employees": null,
"Mobile": null,
"Last_Name": "Testrec1",
"State": null,
"$status": "cv_1",
"Lead_Source": null,
"Country": null,
"Created_By": {
"name": "NareshTesting ",
"id": "3000000031045"
},
"Fax": null,
"Annual_Revenue": null,
"Secondary_Email": null
},
{
"Owner": {
"name": "NareshTesting ",
"id": "3000000031045"
},
"Company": "Testrec2",
"Email": null,
"Description": null,
"$currency_symbol": "$",
"$photo_id": null,
"Website": null,
"Twitter": null,
"$upcoming_activity": null,
"Salutation": null,
"Last_Activity_Time": "2017-12-16T09:54:58+05:30",
"First_Name": null,
"Full_Name": "Testrec2",
"Lead_Status": null,
"Industry": null,
"Modified_By": {
"name": "NareshTesting ",
"id": "3000000031045"
},
"Skype_ID": null,
"$converted": false,
"$process_flow": false,
"Phone": null,
"Street": null,
"Zip_Code": null,
"id": "3000000032091",
"Email_Opt_Out": false,
"$approved": true,
"Designation": null,
"$approval": {
"delegate": false,
"approve": false,
"reject": false
},
"Modified_Time": "2017-12-16T09:54:58+05:30",
"Created_Time": "2017-12-16T09:54:58+05:30",
"$converted_detail": {},
"$followed": false,
"$editable": true,
"City": null,
"No_of_Employees": null,
"Mobile": null,
"Last_Name": "Testrec2",
"State": null,
"$status": "c_1",
"Lead_Source": null,
"Country": null,
"Created_By": {
"name": "NareshTesting ",
"id": "3000000031045"
},
"Fax": null,
"Annual_Revenue": null,
"Secondary_Email": null
}
],
"info": {
"per_page": 2,
"count": 2,
"page": 1,
"more_records": true
}
}
-
staticZOHO.CRM.API.getAllUsers(config){Promise}
-
To retrieve list of users in ZohoCRM
Name |
Type |
Description |
config |
object
|
Configuration Object
Name |
Type |
Description |
Type |
String
|
Allowed values "AllUsers | ActiveUsers | DeactiveUsers | ConfirmedUsers | NotConfirmedUsers | DeletedUsers | ActiveConfirmedUsers | AdminUsers | ActiveConfirmedAdmins" |
page |
number
|
optional
To get the list of users from the respective pages |
per_page |
number
|
optional
To get the list of users available per page |
|
Returns:
Type |
Description |
Promise
|
Resolved List of users matching specified Type |
Example
ZOHO.CRM.API.getAllUsers({Type:"AllUsers"})
.then(function(data){
console.log(data)
})
//prints
{
"users": [
{
"confirm": true,
"full_name": "NareshTesting ",
"role": {
"name": "CEO",
"id": "3000000029719"
},
"territories": [],
"profile": {
"name": "Administrator",
"id": "3000000029725"
},
"last_name": null,
"alias": null,
"id": "3000000031045",
"first_name": "NareshTesting",
"email": "naresh.babu+dev2@zylker.com",
"zuid": "5073288",
"status": "active"
}
],
"info": {
"per_page": 200,
"count": 1,
"page": 1,
"more_records": false
}
}
-
staticZOHO.CRM.API.getApprovalById(config){Promise}
-
To get details of the particular approval.
Name |
Type |
Description |
config |
object
|
configuration object
Name |
Type |
Description |
id |
string
|
id of the approval |
|
Returns:
Type |
Description |
Promise
|
Resolved details of the approval. |
Example
var config = {
id:"518440000000222786"
}
ZOHO.CRM.API.getApprovalById(config).then(function(d){
console.log(d);
})
//prints
{
"data": [
{
"owner": {
"phone": null,
"name": "milestone2 ",
"mobile": null,
"id": "111155000000032023",
"history": [],
"email": "uk@zylker.com"
},
"initiated_time": "2018-07-16T10:16:54+05:30",
"criteria": [
{
"api_name": "Annual_Revenue",
"field_label": "Annual Revenue",
"value": "$1.00"
}
],
"module": "Leads",
"rule": {
"name": "Name",
"id": "111155000000036006"
},
"id": "518440000000222786",
"type": "approval",
"entity": {
"name": "uk",
"id": "111155000000036014"
},
"default_layout": true,
"waiting_for": {
"name": "uk ",
"id": "111155000000035012"
}
}
],
"info": {
"per_page": 200,
"count": 1,
"page": 1,
"more_records": false
}
}
-
staticZOHO.CRM.API.getApprovalRecords(config){Promise}
-
This method is called by the one who has to approve.If it is called by others, they will get 204 response.
"others_awaiting" gives the list of all approvals pending regardless of who has to approve it. Usually, Super Admin and administrator will be able to use this API whereas standard user will still get a 204 empty response.
Name |
Type |
Description |
config |
object
|
configuration object
Name |
Type |
Description |
type |
string
|
Allowed values "awaiting | others_awaiting" |
|
Returns:
Type |
Description |
Promise
|
Resolved List of records for waiting the approval. |
Example
Example 1
ZOHO.CRM.API.getApprovalRecords()
.then(function(data){
console.log(data)
})
It returns the pending approval records of the current user
Example 2
var config = {type:"others_awaiting"}
ZOHO.CRM.API.getApprovalRecords(config)
.then(function(data){
console.log(data)
})
It returns the pending approval records which should be approve by other user.
//prints
{
"data": [
{
"owner": {
"phone": null,
"name": "milestone2 ",
"mobile": null,
"id": "111155000000032023",
"email": "uk@zylker.com"
},
"initiated_time": "2018-07-16T10:16:54+05:30",
"module": "Leads",
"rule": {
"name": "Name",
"id": "111155000000036006"
},
"id": "111155000000036021",
"type": "approval",
"entity": {
"name": "uk",
"id": "111155000000036014"
},
"default_layout": true,
"waiting_for": {
"name": "uk ",
"id": "111155000000035012"
}
}
],
"info": {
"per_page": 200,
"count": 1,
"page": 1,
"more_records": false
}
}
-
staticZOHO.CRM.API.getApprovalsHistory(){Promise}
-
View the history of records put up for approval
Returns:
Type |
Description |
Promise
|
Resolved List of records for waiting the approval. |
Example
ZOHO.CRM.API.getApprovalsHistory().then(function(data){
console.log(data);
});
//prints
{
"data": [
{
"audit_time": "2018-07-16T15:46:54+05:30",
"done_by": {
"name": "milestone2 ",
"id": "111155000000032023"
},
"module": "Leads",
"record": {
"name": "uk",
"id": "111155000000036014"
},
"related_module": null,
"action": "Submitted",
"rule": "111155000000036006",
"account": null,
"related_name": "milestone2 ",
"territory": null
}
],
"info": {
"per_page": 200,
"count": 1,
"page": 1,
"more_records": false
}
}
-
staticZOHO.CRM.API.getBluePrint(config){Promise}
-
Get blueprint details
Name |
Type |
Description |
config |
object
|
configuration object
Name |
Type |
Description |
Entity |
String
|
SysRefName of the module. |
RecordID |
String
|
RecordID to associate the notes. |
|
Returns:
Type |
Description |
Promise
|
Resolved with data of record matching with RecordID |
Example
var config =
{
"Entity": "Leads",
"RecordID": "111126000000036019"
}
ZOHO.CRM.API.getBluePrint(config).then(function(data){
console.log(data)
})
//prints
{
"blueprint": {
"process_info": {
"field_id": "111126000000000885",
"is_continuous": false,
"api_name": "Lead_Status",
"continuous": false,
"field_label": "Lead Status",
"name": "Lprint",
"column_name": "STATUS",
"field_value": "Pre Qualified",
"id": "111126000000035049",
"field_name": "Lead Status"
},
"transitions": [
{
"next_transitions": [
{
"name": "lost lead",
"id": "111126000000035025"
}
],
"data": {},
"next_field_value": "Not Qualified",
"name": "not qualify",
"criteria_matched": true,
"id": "111126000000035019",
"fields": [],
"criteria_message": null,
"percent_partial_save": 0
},
{
"next_transitions": [],
"data": {},
"next_field_value": "Contacted",
"name": "contact",
"criteria_matched": true,
"id": "111126000000035007",
"fields": [],
"criteria_message": null,
"percent_partial_save": 0
}
]
}
}
-
staticZOHO.CRM.API.getFile(){Promise}
-
get file from file id
Returns:
Type |
Description |
Promise
|
Resolved with data of file binary string |
Example
var config = {
id:"b12bb1b005f171ac797b3773040438ba7da026eb056f272271d511e95581689b"
}
ZOHO.CRM.API.getFile(config);
-
staticZOHO.CRM.API.getOrgVariable(){Promise}
-
get plugins configuration data
Returns:
Type |
Description |
Promise
|
Resolved with Plugin Configuration |
Example
Example - 1:
ZOHO.CRM.API.getOrgVariable("variableNamespace").then(function(data){
console.log(data);
});
//prints
{
"Success": {
"Content": "12345"
}
}
Example - 2:
var data = {apiKeys:["key1","key2","ke3"]};
ZOHO.CRM.API.getOrgVariable(data).then(function(data){
console.log(data);
});
{
"Success":
{
"content": {
"apikey": {
"value": "BNMMNBVHJ"
},
"authtoken": {
"value": "IUYTRERTYUI"
},
"apiscret": {
"value": "848ksmduo389jd"
}
}
}
}
-
staticZOHO.CRM.API.getProfile(config){Promise}
-
To get a particular profile's details with ProfileID as input
Name |
Type |
Description |
config |
Object
|
Configuration Object.
Name |
Type |
Description |
ID |
String
|
ProfileID |
|
Returns:
Type |
Description |
Promise
|
Resolved with the details of the profile for the given ProfileID |
Example
ZOHO.CRM.API.getProfile({ID:"12000000029858"}).then(function(data){
console.log(data);
});
//prints
{
"profiles": [{
"created_time": null,
"modified_time": null,
"permissions_details": [{
"display_label": "Email Integration ( POP3 / IMAP )",
"module": null,
"name": "Crm_Implied_Zoho_Mail_Integ",
"id": "12000000030788",
"enabled": true
},
{
"display_label": "BCC Dropbox",
"module": null,
"name": "Crm_Implied_BCC_Dropbox",
"id": "12000000030752",
"enabled": true
},
{
"display_label": "Show Chat Bar",
"module": null,
"name": "Crm_Implied_Chat_Bar",
"id": "12000000030806",
"enabled": true
},
{
"display_label": null,
"module": null,
"name": "Crm_Implied_Social_Integration",
"id": "12000000030734",
"enabled": false
}
],
"name": "Standard",
"modified_by": null,
"description": "This profile will have all the permissions except administrative privileges.",
"id": "12000000029858",
"category": false,
"created_by": null,
"sections": [{
"name": "template",
"categories": [{
"display_label": "Email & Chat Settings",
"permissions_details": [
"12000000030788",
"12000000030752",
"12000000030806"
],
"name": "email_chat"
},
{
"display_label": "Manage Templates",
"permissions_details": [
"12000000029984",
"12000000029987",
"12000000030698"
],
"name": "template"
}
]
}]
}]
}
-
staticZOHO.CRM.API.getRecord(config){Promise}
-
get all Details of a record
Name |
Type |
Description |
config |
Object
|
Configuration Object.
Name |
Type |
Default |
Description |
Entity |
String
|
|
SysRefName of the module. |
RecordID |
String
|
|
RecordID to associate the notes. |
approved |
String
|
true
|
optional
To get approved record |
|
Returns:
Type |
Description |
Promise
|
Resolved with data of record matching with RecordID |
Example
ZOHO.CRM.API.getRecord({
Entity: "Leads", approved: "both", RecordID:"1000000030132"
})
.then(function(data){
console.log(data)
})
//prints
{
"data": [
{
"Owner": {
"name": "NareshTesting ",
"id": "3000000031045"
},
"Company": "ZohoCorp",
"Email": null,
"Description": null,
"$currency_symbol": "$",
"$photo_id": null,
"Website": null,
"Twitter": null,
"$upcoming_activity": null,
"Salutation": null,
"Last_Activity_Time": "2017-12-22T03:27:23+05:30",
"First_Name": null,
"Full_Name": "Naresh",
"Lead_Status": null,
"Industry": null,
"Modified_By": {
"name": "NareshTesting ",
"id": "3000000031045"
},
"Skype_ID": null,
"$converted": false,
"$process_flow": false,
"Phone": null,
"Street": null,
"Zip_Code": null,
"id": "3000000040016",
"Email_Opt_Out": false,
"$approved": true,
"Designation": null,
"$approval": {
"delegate": false,
"approve": false,
"reject": false
},
"Modified_Time": "2017-12-22T03:27:23+05:30",
"Created_Time": "2017-12-22T03:27:23+05:30",
"$converted_detail": {},
"$followed": false,
"$editable": true,
"City": null,
"No_of_Employees": 0,
"Mobile": null,
"Last_Name": "Naresh",
"State": null,
"$status": "cv_1",
"Lead_Source": null,
"Country": null,
"Created_By": {
"name": "NareshTesting ",
"id": "3000000031045"
},
"Fax": null,
"Annual_Revenue": 0,
"Secondary_Email": null
}
]
}
-
-
To retrive related list records
Name |
Type |
Description |
config |
object
|
Configuration Object
Name |
Type |
Description |
Entity |
String
|
SysRefName of the module. |
RecordID |
String
|
RecordID to associate the notes. |
RelatedListName |
String
|
SysRefName of the relatedList. |
page |
Number
|
optional
To get the list of related records from the respective page. |
per_page |
Number
|
optional
To get the list of related records available per page. |
|
Returns:
Type |
Description |
Promise
|
Resolved user matching userID |
Example
ZOHO.CRM.API.getRelatedRecords({Entity:"Leads",RecordID:"1000000030132",RelatedList:"Notes",page:1,per_page:200})
.then(function(data){
console.log(data)
})
//prints
{
"data": [
{
"Owner": {
"name": "NareshTesting ",
"id": "3000000031045"
},
"Modified_Time": "2017-12-22T03:58:20+05:30",
"$attachments": null,
"Created_Time": "2017-12-22T03:58:20+05:30",
"Parent_Id": {
"name": "Peterson",
"id": "3000000040011"
},
"$editable": true,
"$se_module": "Leads",
"Modified_By": {
"name": "NareshTesting ",
"id": "3000000031045"
},
"$size": null,
"$voice_note": false,
"$status": null,
"id": "3000000040059",
"Created_By": {
"name": "NareshTesting ",
"id": "3000000031045"
},
"Note_Title": null,
"Note_Content": "Notes2"
},
{
"Owner": {
"name": "NareshTesting ",
"id": "3000000031045"
},
"Modified_Time": "2017-12-22T03:58:16+05:30",
"$attachments": null,
"Created_Time": "2017-12-22T03:58:16+05:30",
"Parent_Id": {
"name": "Peterson",
"id": "3000000040011"
},
"$editable": true,
"$se_module": "Leads",
"Modified_By": {
"name": "NareshTesting ",
"id": "3000000031045"
},
"$size": null,
"$voice_note": false,
"$status": null,
"id": "3000000040055",
"Created_By": {
"name": "NareshTesting ",
"id": "3000000031045"
},
"Note_Title": null,
"Note_Content": "Notes1"
}
],
"info": {
"per_page": 200,
"count": 2,
"page": 1,
"more_records": false
}
}
-
staticZOHO.CRM.API.getUser(config){Promise}
-
To retrieve list of users in ZohoCRM
Name |
Type |
Description |
config |
object
|
Configuration Object
Name |
Type |
Description |
ID |
String
|
UserID |
|
Returns:
Type |
Description |
Promise
|
Resolved user matching userID |
Example
ZOHO.CRM.API.getUser({ID:"3000000029719"})
.then(function(data){
console.log(data)
})
//prints
{
"users": [
{
"country": null,
"role": {
"name": "CEO",
"id": "3000000029719"
},
"customize_info": {
"notes_desc": null,
"show_right_panel": null,
"bc_view": null,
"show_home": false,
"show_detail_view": true,
"unpin_recent_item": null
},
"city": null,
"signature": null,
"name_format": "Salutation,First Name,Last Name",
"language": "en_US",
"locale": "en_US",
"personal_account": true,
"ntc_notification_type": [
3000000020985,
3000000020988,
3000000020991,
3000000020994,
3000000020997,
3000000021012,
3000000021003,
3000000021006,
3000000021009,
3000000021078,
3000000021072,
3000000021075,
3000000021069,
3000000021081,
3000000021084,
3000000021087
],
"default_tab_group": "0",
"street": null,
"alias": null,
"theme": {
"normal_tab": {
"font_color": "#FFFFFF",
"background": "#222222"
},
"selected_tab": {
"font_color": "#FFFFFF",
"background": "#222222"
},
"new_background": null,
"background": "#F3F0EB",
"screen": "fixed",
"type": "default"
},
"id": "3000000031045",
"state": null,
"country_locale": "en_US",
"fax": null,
"first_name": "NareshTesting",
"email": "naresh.babu+dev2@zylker.com",
"telephony_enabled": false,
"imap_status": false,
"zip": null,
"decimal_separator": "en_US",
"website": null,
"time_format": "hh:mm a",
"profile": {
"name": "Administrator",
"id": "3000000029725"
},
"mobile": null,
"last_name": null,
"time_zone": "Asia/Kolkata",
"zuid": "5073288",
"confirm": true,
"rtl_enabled": false,
"full_name": "NareshTesting ",
"ezuid": "6ca2127e9d60c217",
"territories": [],
"phone": null,
"dob": null,
"date_format": "MM/dd/yyyy",
"ntc_enabled": true,
"status": "active"
}
]
}
-
staticZOHO.CRM.API.insertRecord(config){Promise}
-
Insert record to a modue
Name |
Type |
Description |
config |
Object
|
Configuration Object.
Name |
Type |
Description |
Entity |
String
|
SysRefName of the module. |
Trigger |
list
|
The trigger input can be "workflow", "approval" or "blueprint". If the trigger is not mentioned, the workflows, approvals and blueprints related to the API will get executed. Enter the trigger value as [] to not execute the workflows |
APIData |
Object
|
RecordID to associate the notes. |
|
Returns:
Type |
Description |
Promise
|
Resolved with response data |
Examples
var recordData = {
"Company": "Zylker",
"Last_Name": "Peterson"
}
ZOHO.CRM.API.insertRecord({Entity:"Leads",APIData:recordData,Trigger:["workflow"]}).then(function(data){
console.log(data);
});
//prints
{
"data": [
{
"code": "SUCCESS",
"details": {
"Modified_Time": "2017-12-22T03:24:39+05:30",
"Modified_By": {
"name": "NareshTesting ",
"id": "3000000031045"
},
"Created_Time": "2017-12-22T03:24:39+05:30",
"id": "3000000040011",
"Created_By": {
"name": "NareshTesting ",
"id": "3000000031045"
}
},
"message": "record added",
"status": "success"
}
]
}
var data = [
{
"Company": "ZohoCorp",
"Last_Name": "Babu"
},
{
"Company": "ZohoCorp",
"Last_Name": "Naresh"
}
];
ZOHO.CRM.API.insertRecord({Entity:"Leads",APIData:data,Trigger:["workflow"]}).then(function(data){
console.log(data);
});
//prints
{
"data": [
{
"code": "SUCCESS",
"details": {
"Modified_Time": "2017-12-22T03:27:23+05:30",
"Modified_By": {
"name": "NareshTesting ",
"id": "3000000031045"
},
"Created_Time": "2017-12-22T03:27:23+05:30",
"id": "3000000040015",
"Created_By": {
"name": "NareshTesting ",
"id": "3000000031045"
}
},
"message": "record added",
"status": "success"
},
{
"code": "SUCCESS",
"details": {
"Modified_Time": "2017-12-22T03:27:23+05:30",
"Modified_By": {
"name": "NareshTesting ",
"id": "3000000031045"
},
"Created_Time": "2017-12-22T03:27:23+05:30",
"id": "3000000040016",
"Created_By": {
"name": "NareshTesting ",
"id": "3000000031045"
}
},
"message": "record added",
"status": "success"
}
]
}
-
staticZOHO.CRM.API.searchRecord(config, page, per_page){Promise}
-
To retrieve the records that matches your search criteria
Name |
Type |
Description |
config |
object
|
Configuration Object
Name |
Type |
Description |
Entity |
String
|
SysRefName of module |
Type |
String
|
Allowed values "email|phone|word|criteria" |
Query |
String
|
query String |
delay |
boolean
|
query String |
|
page |
String
|
Pagination - Page number |
per_page |
String
|
Pagination - per page limit |
Returns:
Type |
Description |
Promise
|
Resolved with search result |
Examples
ZOHO.CRM.API.searchRecord({Entity:"Leads",Type:"phone",Query:"123456789",delay:false})
.then(function(data){
console.log(data)
})
ZOHO.CRM.API.searchRecord({Entity:"Leads",Type:"email",Query:"test@zoho.com"})
.then(function(data){
console.log(data)
})
ZOHO.CRM.API.searchRecord({Entity:"Leads",Type:"word",Query:"ZohoCrop"})
.then(function(data){
console.log(data)
})
ZOHO.CRM.API.searchRecord({Entity:"Leads",Type:"criteria",Query:"(Company:equals:Zoho)"})
.then(function(data){
console.log(data)
})
ZOHO.CRM.API.searchRecord({Entity:"Leads",Type:"criteria",Query:"((Company:equals:Zoho)or(Company:equals:zylker))"})
.then(function(data){
console.log(data)
})
-
staticZOHO.CRM.API.updateBluePrint(config){Promise}
-
update blueprint details for particular record.
Name |
Type |
Description |
config |
Object
|
Configuration Object.
Name |
Type |
Description |
Entity |
String
|
SysRefName of the module. |
RecordID |
String
|
RecordID to associate the notes. |
BlueprintData |
object
|
blueprint data to update |
|
Returns:
Type |
Description |
Promise
|
Resolved with data of record matching with RecordID |
Example
var BlueprintData =
{
"blueprint": [
{
"transition_id": "111126000000035019",
"data": {
"Phone": "8940372937",
"Notes": "Updated via blueprint"
}
}
]
}
update attachment with blueprint
var BlueprintData =
{
"blueprint": [
{
"transition_id": "1000000031897",
"data": {
"Attachments": {
"$file_id": [
"59cf260313b6907ffc56957f4241bd94ba3e0b6aad53b50f8b38583a859d623a",
"59cf260313b6907ffc56957f4241bd94ba3e0b6aad53b50f8b38583a859d624d"
]
}
}
}
]
}
update link with blueprint
{
"blueprint": [
{
"transition_id": "2000000031536",
"data": {
"Attachments": {
"$link_url": "facebook.com"
},
"Notes": "Dileep checking Notes outside"
}
}
]
}
var config=
{
Entity:"Leads",
RecordID:"111126000000036019",
BlueprintData:BlueprintData
}
ZOHO.CRM.API.updateBluePrint(config).then(function(data){
console.log(data);
});
//prints
{
"code": "SUCCESS",
"details": {},
"message": "transition updated successfully",
"status": "success"
}
-
staticZOHO.CRM.API.updateProfile(config){Promise}
-
To update permissions for the given ProfileID
Name |
Type |
Description |
config |
Object
|
Configuration Object.
Name |
Type |
Description |
ID |
String
|
ProfileID |
APIData |
Object
|
Permission Data (PermissionID : true | false) |
|
Returns:
Type |
Description |
Promise
|
Resolved with a response message (Success or failure ) after updating the permissions |
Example
var permissionData = {
"profiles": [
{
"permissions_details": [
{
"id": "12000000030827",
"enabled": false
},
{
"id": "12000000029879",
"enabled": true
}
]
}
]
}
ZOHO.CRM.API.updateProfile({ID:"12000000033045",APIData:permissionData}).then(function(data){
console.log(data);
});
//prints
{
"profiles": [
{
"code": "SUCCESS",
"details": {},
"message": "profile updated successfully",
"status": "success"
}
]
}
-
staticZOHO.CRM.API.updateRecord(config){Promise}
-
To update a record in a module
Name |
Type |
Description |
config |
Object
|
Configuration Object.
Name |
Type |
Description |
Entity |
String
|
SysRefName of the module. |
Trigger |
list
|
The trigger input can be "workflow", "approval" or "blueprint". If the trigger is not mentioned, the workflows, approvals and blueprints related to the API will get executed. Enter the trigger value as [] to not execute the workflows |
APIData |
String
|
Update Record Data. |
|
Returns:
Type |
Description |
Promise
|
Resolved with data of update Record Response |
Example
var config={
Entity:"Leads",
APIData:{
"id": "1000000049031",
"Company": "Zylker",
"Last_Name": "Peterson"
},
Trigger:["workflow"]
}
ZOHO.CRM.API.updateRecord(config)
.then(function(data){
console.log(data)
})
//prints
{
"data": [
{
"code": "SUCCESS",
"details": {
"Modified_Time": "2017-12-22T03:29:57+05:30",
"Modified_By": {
"name": "NareshTesting ",
"id": "3000000031045"
},
"Created_Time": "2017-12-22T03:27:23+05:30",
"id": "3000000040016",
"Created_By": {
"name": "NareshTesting ",
"id": "3000000031045"
}
},
"message": "record updated",
"status": "success"
}
]
}
-
-
To update the relation between the records
Name |
Type |
Description |
config |
object
|
Configuration Object
Name |
Type |
Description |
Entity |
String
|
SysRefName of the module. |
RecordID |
String
|
RecordID to associate the notes. |
RelatedListName |
String
|
SysRefName of the relatedList. |
RelatedRecordID |
String
|
Related Record ID |
APIData |
String
|
Data to be updated in the related record |
|
Returns:
Type |
Description |
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
{
"data":[
{
"code": "SUCCESS",
"details": {
"id": 1000000080041
},
"message": "relation updated",
"status": "success"
}
]
}
-
staticZOHO.CRM.API.uploadFile(){Promise}
-
upload the files in to zoho server and return appname and id
Returns:
Type |
Description |
Promise
|
Resolved with data of file |
Example
var file = $("#attachmentinput")
var file = document.getElementById("attachmentinput").files[0];
var fileType = file.type;
var config = {
"CONTENT_TYPE": "multipart",
"PARTS": [{
"headers": {
"Content-Disposition": "file;"
},
"content": "__FILE__"
}],
"FILE": {
"fileParam": "content",
"file": file
}
}
ZOHO.CRM.API.uploadFile(config).then(function(data) {
console.log(data);
})
//prints
{
"data": [
{
"code": "SUCCESS",
"details": {
"name": "desk.png",
"id": "b12bb1b005f171ac797b3773040438ba7da026eb056f272271d511e95581689b"
},
"message": "desk.png uploaded Succeessfully",
"status": "success"
}
]
}
-
staticZOHO.CRM.API.upsertRecord(config){Promise}
-
Insert record or update matching existing record
Name |
Type |
Description |
config |
Object
|
Configuration Object.
Name |
Type |
Description |
Entity |
String
|
SysRefName of the module. |
Trigger |
list
|
The trigger input can be "workflow", "approval" or "blueprint". If the trigger is not mentioned, the workflows, approvals and blueprints related to the API will get executed. Enter the trigger value as [] to not execute the workflows |
APIData |
Object
|
insert json details |
duplicate_check_fields |
Object
|
this param will update existing record,add multiple fields with comma separated |
|
Returns:
Type |
Description |
Promise
|
Resolved with response data |
Example
var data = [
{
"Company": "zoho",
"Last_Name": "zylker",
"Email":"zylker@gmail.com",
"Mobile":"1234567890",
"Website":"https://www.zoho.com"
},
{
"Company": "zoho",
"Last_Name": "zylker",
"Email":"zylkder@gmail.com",
"Website":"http://www.google.com",
"Mobile":"8393749473934739"
},
];
ZOHO.CRM.API.upsertRecord({Entity:"Leads",APIData:data,duplicate_check_fields:["Website","Mobile"],Trigger : ["workflow"]}).then(function(data){
console.log(data);
});
//prints
[
{
"code": "SUCCESS",
"duplicate_field": "Mobile",
"action": "update",
"details": {
"Modified_Time": "2018-10-11T12:06:47+05:30",
"Modified_By": {
"name": "test ",
"id": "111134000000033383"
},
"Created_Time": "2018-10-11T11:55:10+05:30",
"id": "111134000000036225",
"Created_By": {
"name": "test ",
"id": "111134000000033383"
}
},
"message": "record updated",
"status": "success"
},
{
"code": "SUCCESS",
"duplicate_field": "Website",
"action": "update",
"details": {
"Modified_Time": "2018-10-11T12:06:47+05:30",
"Modified_By": {
"name": "test ",
"id": "111134000000033383"
},
"Created_Time": "2018-10-11T11:55:10+05:30",
"id": "111134000000036226",
"Created_By": {
"name": "test ",
"id": "111134000000033383"
}
},
"message": "record updated",
"status": "success"
}
]