Associate Record in SDP Cloud
Table of Contents
Note:
- Each time the zoho.sdp.associate 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.sdp.associate 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
The zoho.sdp.associate task creates a new record in the specified submodule and associates it with the parent record in the SDP Cloud module - Request.
This integration task is based on the SDP Cloud API modules - Notes and Worklogs.
Syntax
<response> = zoho.sdp.associate(<sub_module>, <record_id>, <data_map>, <app_account_name>, <connection>);
where:
| Params | Data type | Description |
| <response> | KEY-VALUE | The details of the record that will be associated. |
| <sub_module> | TEXT | The name of the submodule in which the record will be created. Applicable submodules are Notes and Worklogs. |
| <record_id> | NUMBER | The ID of the record in the Request module with which the new record will be associated. 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 - Notes and Worklogs module. |
| <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 fetches the record of ID - 317XXXXXXXXXX655 from the SDP Cloud module - Request:
note_value = Map(); note_value.put("description", "A new request has been initiated"); response = zoho.sdp.associate("Notes", 317XXXXXXXXXX348, note_value, "", "sdp_connection");
where:
response
"Notes"
317XXXXXXXXXX348
note_value
""
"sdp_connection"
Response Format
Success Response
The success response will be returned in the following format:
{
"response_status": {
"status_code": 2000,
"status": "success"
},
"request_note": {
"created_time": {
"display_value": "Sep 25, 2019 05:51 PM",
"value": "1569414114264"
},
"request": {
"display_id": "1",
"subject": "OS installation",
"id": "317XXXXXXXXXX348"
},
"show_to_requester": false,
"description": "A new request has been initiated",
"id": "317XXXXXXXXXX023",
"created_by": {
"email_id": "shawn@zylker.com",
"is_technician": true,
"sms_mail": null,
"phone": null,
"name": "Shawn",
"mobile": null,
"id": "317XXXXXXXXXX318",
"photo_url": "https://contacts.zoho.com/file?exp=10&ID=58XXXX60&t=user&height=60&width=60",
"is_vip_user": false,
"department": null
}
}
}
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 empty input values will be returned in the following format:
{
"response_status": {
"status_code": 4000,
"messages": [
{
"status_code": 4012,
"field": "description",
"type": "failed"
}
],
"status": "failed"
}
}