Choose where you’d like to start

Get record by ID from SDP cloud

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

Overview

The zoho.sdp.getRecordById task fetches a record from the specified module of SDP Cloud using its ID.

This integration task is based on the SDP Cloud API - Get Request.

Syntax

<response> = zoho.sdp.getRecordById(<module>, <record_id>, <app_account_name>, <connection>);
ParamsData typeDescription

<response> 

KEY-VALUE

The details of the record that will be fetched.

<module>

TEXT

The name of the module from which the record will be fetched.

Currently, only "Request" is the applicable module.

<record_id>

NUMBER

The ID of the record that needs to be fetched.

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

<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:

 response = zoho.sdp.getRecordById("Request", 317XXXXXXXXXX655, "", "sdp_connection");

where:

response
The KEY-VALUE response variable that holds the details of the record that will be fetched.
"Request"
The TEXT that represents the name of the module from which the record will be fetched.
317XXXXXXXXXX348
The NUMBER that represents the ID of the record that will be fetched.
""
Empty TEXT to denote that record should be fetched from 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:
     {
     "request": {
     "subject": "OS installation",
     "resolution": null,
     "linked_to_request": null,
     "mode": null,
     "lifecycle": null,
     "is_read": false,
     "assets": [
     ],
     "is_trashed": false,
     "id": "3173000000115348",
     "assigned_time": null,
     "group": null,
     "requester": {
     "email_id": null,
     "is_technician": false,
     "sms_mail": null,
     "phone": null,
     "name": "Tom",
     "mobile": null,
     "id": "3173000000115338",
     "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 20, 2019 05:01 PM",
     "value": "1568979089117"
     },
     "has_notes": false,
     "udf_fields": {
     },
     "impact_details": null,
     "subcategory": {
     "name": "Windows XP",
     "id": "3173000000006747"
     },
     "deleted_time": null,
     "email_cc": [
     ],
     "status": {
     "in_progress": true,
     "internal_name": "Open",
     "stop_timer": false,
     "color": "#0066ff",
     "name": "Open",
     "id": "3173000000006657"
     },
     "template": {
     "name": "Default Request",
     "id": "3173000000006655"
     },
     "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": "3173000000006705"
     }
     },
     "response_status": {
     "status_code": 2000,
     "status": "success"
     }
     }

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

Related Links

Get Started Now

Execute