Choose where you’d like to start

Associate Record in SDP Cloud

Note: This task is applicable to all Zoho services, except Zoho Creator.

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:

ParamsData typeDescription

<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:
  • The account_name can be obtained from the SDP Cloud URL. The URL is in the following format:
    https://sdpondemand.zoho.com/app/<account_name>/HomePage.do
  • You can specify an empty string for this param, in which case the task is performed in the default account.

<connection>

 

TEXT

The name of the connection.

Note:

  • In view of stopping new authtoken generation, a Zoho OAuth connection with appropriate scopes is mandatory for new integration tasks (created after the deadline specified in the post) to work as expected. Existing integration tasks will continue to work with or without the connections parameter unless the authtoken is manually deleted from accounts.
  • Add relevant scopes mentioned in SDP Cloud API document while creating the connection.
  • Refer to this post for the list of Zoho services that support the connections page.
  • Learn more about connections

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
The KEY-VALUE response that represents the details of the record that will be created, and associated with the specified request.
"Notes"
The TEXT that represents the name of the sub module in which the record needs to be created.
317XXXXXXXXXX348
The NUMBER that represents the ID of the record in the Request module with which the new note needs to be associated.
note_value
The KEY-VALUE variable that holds the values of the new record that needs to be created.
""
Empty TEXT to denote that the task will be performed in the default account.
"sdp_connection"
The connection link name in TEXT format.

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"
     }
     }

Related Links

  • ​SDP Cloud API - Notes ad Worklogs
  • Common error codes can be viewed here
  • The possible response formats can be viewed here

Get Started Now

Execute