Create record in Zoho Desk
Table of Contents
Note:
- Each time the zoho.desk.create integration task is executed, it triggers an API request in the back-end. This call is deducted from the external calls limit available for the service from which the task is executed, based on your pricing plan.
- Only actual executions that receive a response (whether success or failure) are counted, not the number of times the task appears in the script. For example, if zoho.desk.create integration task is placed inside a for each task that iterates five times, the number of external calls consumed will be five, even though the task appears only once in the script.
Overview
This task is used to create a record in the specified Zoho Desk module.
Syntax
<variable> = zoho.desk.create(<orgId>, <module_name>, <record_value>, <connection>);
where,
| Parameter | Data type | Description |
| <variable> | KEY-VALUE | variable which will contain the response returned by Zoho Desk. It represents the values of the created record. |
| <orgId> | NUMBER | specifies the organization ID of the account in which the record will be created. This can be found in Zoho Desk Settings > Developer Space > API. ![]() |
| <module_name> | TEXT | specifies the module in which the record will be created The following is the list of supported modules.
|
| <record_value> | KEY-VALUE | specifies the values of the record that will be created. To learn about the mandatory fields, click here and go to <ModuleName> -> Create <ModuleName> |
<connection> (optional)* | TEXT | specifies the name of the connection The scopes which need to be selected are: *Note: This is a mandatory param when used in Zoho Creator. |
Example
The following script creates a new record in the Zoho Desk module - Tickets.
recordValue = {"subject" : "Create ticket", "departmentId":"168XXXXXXXXXXXXXX044", "contactId":"1689XXXXXXXXXXXXXX005"}; response = zoho.desk.create(641XXXXXX, "tickets", recordValue, "desk_connection");
where,
response641XXXXXX"tickets"recordValue"subject"
"departmentId"
"contactId""desk_connection""desk_connection"Sample Response
Success Response
The success response returned is of the following format.
{
"ticketNumber": "119",
"modifiedTime": "2018-10-19T06:34:43.000Z",
"subCategory": null,
"statusType": "Open",
"subject": "Create ticket",
"customFields": {},
"dueDate": null,
"departmentId": "168XXXXXXXXXXXX044",
"channel": "Phone",
"description": null,
"resolution": null,
"closedTime": null,
"approvalCount": "0",
"timeEntryCount": "0",
"channelRelatedInfo": null,
"responseDueDate": null,
"isDeleted": false,
"createdTime": "2018-10-19T06:34:43.000Z",
"modifiedBy": "168XXXXXXXXXXXX005",
"id": "168XXXXXXXXXXXX001",
"isResponseOverdue": false,
"email": null,
"customerResponseTime": "2018-10-19T06:34:43.000Z",
"productId": null,
"contactId": "168XXXXXXXXXXXX005",
"threadCount": "0",
"priority": null,
"classification": null,
"assigneeId": null,
"commentCount": "0",
"taskCount": "0",
"accountId": "168XXXXXXXXXXXX006",
"phone": null,
"webUrl": "https://desk.zoho.com/support/smith/ShowHomePage.do#Cases/dv/a23592d4XXXXXXXXXXXXXXXXXXXX68ec",
"teamId": null,
"attachmentCount": "0",
"category": null,
"status": "Open1"
}
To get the ID of the newly created record, execute the following script:
Failure Response
The failure response returned for incorrect or non-existent organization ID is of the following format.
{
"errorCode":"UNPROCESSABLE_ENTITY",
"message":"The value passed for the 'orgId' parameter is invalid."
}The failure response returned for incorrect or non-existent record ID is of the following format.
{
"errorCode":"URL_NOT_FOUND",
"message":"The URL you requested could not be found."
}The failure response returned for missing mandatory field in recordValue is of the following format.
{
"errorCode":"INVALID_DATA",
"message":"The data is invalid due to validation restrictions",
"errors":[{"fieldName":"/subject","errorType":"missing"}]}
