Update Record

Update record in Zoho Desk

Overview

This task is used to update a record using its ID in the specified Zoho Desk module.

Syntax

<variable> =zoho.desk.update(<orgId>, <module_name>,<record_id>, <record_value>, <connection>);

where,

ParameterData typeDescription

<variable>

KEY-VALUE

specifies the response returned by Zoho Desk. It represents the values of the updated record.

<orgId>

NUMBER

specifies the organization ID of the account in which the record will be updated. This can be found in Zoho Desk Settings > Developer Space > API.  

<module_name>

TEXT

specifies the module in which the record will be updated.

The following is the list of applicable modules.

  • Tickets

  • Contacts

  • Accounts

  • Tasks

  • Products

  • Contracts

<record_id>

NUMBER

specifies the ID of the record which will be updated.

Learn how to fetch the record ID after creatingsearching or fetching records.

<record_value>

KEY-VALUE

specifies the new values of the record that needs to be updated.

To learn about the field names, click here and go to <ModuleName> -> Update <ModuleName>

<connection>

(optional)*

TEXT

specifies the name of the connection.

The scopes which need to be selected are: 
- Desk.contacts.UPDATE
- Desk.tasks.UPDATE
- Desk.tickets.UPDATE
- Desk.settings.UPDATE

*Note: This is a mandatory param when used in Zoho Creator.

Example

The following example updates the record of ID - 168XXXXXXXXXXXX001 with the specified values in the Zoho Desk module - Tickets.

recordValue = {"subject":"Update ticket", "email":"shawn@zylker.com", "phone":"+1 234 XXX XXXX"}; 
response = zoho.desk.update(641XXXXXX, "tickets", 168XXXXXXXXXXXX001, recordValue, "desk_connection");

where,

response
variable which will hold the response returned by Zoho Desk. It represents the values of the updated record.
641XXXXXX
is the NUMBER that represents the organization ID
"tickets"
is the TEXT that represents the name of the module in which the record needs to be updated
168XXXXXXXXXXXX001
is the NUMBER that represents the ID of the record that needs to be updated
recordValue
is the KEY-VALUE variable that holds the new values of the record that needs to be updated
"subject"
"email"
"phone"
are the TEXT keys that represent the attribute names as given in the Zoho Desk API.
"desk_connection"
is the TEXT that represents the name of the connection.

Sample Response

Success Response

  • The success response returned is of the following format.

      {
      "ticketNumber": "118",
      "modifiedTime": "2018-10-19T06:36:59.251Z",
      "subCategory": null,
      "statusType": "Open",
      "subject": "Update 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-15T07:18:01.000Z",
      "modifiedBy": "100XXXXXXXX005",
      "id": "100XXXXXXXX001",
      "isResponseOverdue": false,
      "email": "shawn@zylker.com",
        "customerResponseTime": "2018-10-15T10:26:02.019Z",
      "productId": null,
      "contactId": "168XXXXXXXXXXXX005",
      "threadCount": "0",
      "priority": null,
      "classification": null,
      "assigneeId": "100XXXXXXXX020",
      "commentCount": "0",
      "taskCount": "0",
      "accountId": "100XXXXXXXX002",
      "phone": "92114XXXXX,
      "webUrl": "https://desk.zoho.com/support/smith/ShowHomePage.do#Cases/dv/a23592d4XXXXXXXXXXXXXXXXXXXXc6c0",
      "teamId": null,
      "attachmentCount": "0",
      "category": null,
      "status": "open"
      }

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":"FORBIDDEN",
      "message":"You are not authorized to access this resource."
      }

Related Links

Share this post : FacebookTwitter

Still can't find what you're looking for?

Write to us: support@zohodeluge.com