Update Record in SDP Cloud
Table of Contents
Overview
The zoho.sdp.update task updates the specified record with the given new values in SDP Cloud.
This integration task is based on the SDP Cloud API - Update Request.
Syntax
<response> = zoho.sdp.update(<module>, <record_id>, <data_map>, <app_account_name>, <connection>);
Params | Data type | Description |
<response> | KEY-VALUE | The details of the record that will be updated. |
<module> | TEXT | The name of the module in which the record will be updated. Currently, only "Request" is the applicable module. |
<record_id> | TEXT | The ID of the record that will be updated. Learn how to fetch the record ID after creating or fetching records. |
<data_map> | KEY-VALUE | The new values with which the record will be updated. The keys of this parameter should be specified as given in the SDP Cloud API. |
<app_account_name> | TEXT | The name of the account in which this task will be performed. Note:
|
<connection>
| TEXT | The name of the connection. Note:
|
Example
The following script updates the record of ID - 317XXXXXXXXXX348 in the SDP Cloud module - Request with the specified values:
// Create a KEY-VALUE variable to hold the new values of the record newValue = Map(); newValue.put("subcategory", {"name":"Mac OS X"}); //Execute the integration task to update new value to the specified record response = zoho.sdp.update("Request", 317XXXXXXXXXX348, newValue, "", "sdp_connection");
where:
response
"Request"
317XXXXXXXXXX348
newValue
""
"sdp_connection"
Response Format
Success Response
- The success response will be returned in the following format:{
"request": {
"subject": "OS installation",
"resolution": null,
"linked_to_request": null,
"mode": null,
"lifecycle": null,
"is_read": false,
"assets": [
],
"is_trashed": false,
"id": "317XXXXXXXXXX348",
"assigned_time": null,
"group": null,
"requester": {
"email_id": null,
"is_technician": false,
"sms_mail": null,
"phone": null,
"name": "Tom",
"mobile": null,
"id": "317XXXXXXXXXX338",
"photo_url": "https://contacts.zoho.com/file?exp=10&ID=-1&t=user&height=60&width=60",
"is_vip_user": false,
"department": null
},
"email_to": [
],
"created_time": {
"display_value": "Sep 20, 2019 05:01 PM",
"value": "1568979088854"
},
"item": null,
"level": null,
"approval_status": null,
"impact": null,
"sla": null,
"resolved_time": null,
"priority": null,
"created_by": {
"email_id": "shawn@zylker.com",
"is_technician": true,
"sms_mail": null,
"phone": null,
"name": "Shawn",
"mobile": null,
"id": "3173000000115318",
"photo_url": "https://contacts.zoho.com/file?exp=10&ID=58956160&t=user&height=60&width=60",
"is_vip_user": false,
"department": null
},
"first_response_due_by_time": null,
"is_escalated": false,
"last_updated_time": {
"display_value": "Sep 24, 2019 01:00 PM",
"value": "1569310205045"
},
"has_notes": false,
"udf_fields": {
},
"impact_details": null,
"subcategory": {
"name": "Mac OS X",
"id": "317XXXXXXXXXX755"
},
"deleted_time": null,
"email_cc": [
],
"status": {
"in_progress": true,
"internal_name": "Open",
"stop_timer": false,
"color": "#0066ff",
"name": "Open",
"id": "317XXXXXXXXXX657"
},
"template": {
"name": "Default Request",
"id": "317XXXXXXXXXX655"
},
"email_ids_to_notify": [
],
"attachments": [
],
"request_type": null,
"display_id": "1",
"time_elapsed": "0",
"notification_status": null,
"description": null,
"responded_time": null,
"is_service_request": false,
"urgency": null,
"has_request_initiated_change": false,
"department": null,
"is_reopened": false,
"has_draft": false,
"has_attachments": false,
"has_linked_requests": false,
"is_overdue": false,
"technician": null,
"has_problem": false,
"due_by_time": null,
"is_fcr": false,
"has_project": false,
"site": null,
"is_first_response_overdue": false,
"completed_time": null,
"email_bcc": [
],
"category": {
"deleted": false,
"name": "Operating System",
"id": "317XXXXXXXXXX705"
}
},
"response_status": {
"status_code": 2000,
"status": "success"
}
}
To fetch the ID of the updated record from the success response obtained, execute the following snippet:
info <response_variable>.get("request").get("id");
Failure Response
- The failure response for incorrect or non-existent record ID will be returned in the following format:{
"response_status": {
"status_code": 4000,
"messages": [
{
"status_code": 4007,
"type": "failed",
"message": "Invalid URL accessed"
}
],
"status": "failed"
}
} - The failure response for incorrect or non-existent field API name will be returned in the following format:"response_status": {
"messages": [
{
"status_code": 4001,
"type": "failed",
"message": "EXTRA_KEY_FOUND_IN_JSON"
}
],
"status": "failed"
}
} - The failure response for invalid values against the field API names will be returned in the following format:{
"response_status": {
"status_code": 4000,
"messages": [
{
"status_code": 4001,
"field": "subcategory",
"type": "failed"
}
],
"status": "failed"
}
}
Related Links
- SDP Cloud API
- Common error codes can be viewed here
- The possible response formats can be viewed here