Get Record By ID From Zoho Projects
Table of Contents
Description
The zoho.projects.getRecordById task fetches the specified record from Zoho Projects using its ID.
Syntax
<response> = zoho.projects.getRecordById(<portal>, <project_id>, <module>, [<record_id>], [<connection>]);
where:
Params | Data type | Description |
<response> | KEY-VALUE | The details of the record that will be fetched from the specified Zoho Projects module. |
<portal> | TEXT/ NUMBER | The name or ID of the portal. Note: You can get the name or ID of the portal using the get portals task. Click here to learn more about it. |
<project_id> | NUMBER | The ID of the project. Note: You can get project_id using the get project details task. Click here to learn more about it. |
<module> | TEXT | The name of the module from which the record needs to be fetched. Allowed values:
|
<record_id> | NUMBER | The ID of the record that needs to be fetched. Note: You can get record_id using the get records task. Click here to learn more about it. |
<connection> (optional) | TEXT | The link name of the connection. Note: This parameter is applicable to all Zoho services that have connections support, except Zoho Creator. |
Example
The following script fetches the record with ID - 548XXXXXXXXXXX019 from the module - Tasks:
response = zoho.projects.getRecordById("zylker", 548XXXXXXXXXXX771, "tasks", 548XXXXXXXXXXX019);
where:
response
"zylker"
548XXXXXXXXXXX771
"tasks"
548XXXXXXXXXXX019
Response Format
Success Response
The success response will be returned in the following format:
{
"tasks": [
{
"milestone_id": "548XXXXXXXXXXX092",
"link": {
"timesheet": {
"url": "https://projects.zoho.com/restapi/portal/zylker/projects/548XXXXXXXXXXX771/tasks/548XXXXXXXXXXX019/logs/"
},
"self": {
"url": "https://projects.zoho.com/restapi/portal/zylker/projects/548XXXXXXXXXXX771/tasks/548XXXXXXXXXXX019/"
}
},
"is_comment_added": false,
"duration": "0",
"last_updated_time_long": 1566305897457,
"is_forum_associated": false,
"details": {
"owners": [
{
"name": "Unassigned"
}
]
},
"id": 548XXXXXXXXXXX019,
"key": "OR1-T7",
"created_person": "Shawn",
"created_time_long": 1566298139609,
"created_time": "08-20-2019",
"is_reminder_set": false,
"is_recurrence_set": false,
"created_time_format": "08-20-2019 04:18:59 PM",
"subtasks": false,
"work": "0:00",
"isparent": false,
"duration_type": "days",
"work_type": "work_hrs_per_day",
"task_followers": {
"FOLUSERS": "",
"FOLLOWERSIZE": -1,
"FOLLOWERS": [
]
},
"completed": false,
"priority": "High",
"created_by": "58131170",
"percent_complete": "0",
"last_updated_time": "08-20-2019",
"name": "Draft Documents",
"id_string": "54892000000047019",
"last_updated_time_format": "08-20-2019 06:28:17 PM",
"tasklist": {
"name": "General",
"id": "548XXXXXXXXXXX003"
},
"order_sequence": 3,
"status": {
"name": "Open",
"id": "548XXXXXXXXXXX001",
"type": "open",
"color_code": ""
}
}
]
}
Failure Response
The failure response for invalid project ID or record ID will be returned in the following format:
{
"error": {
"code": 6404,
"message": "Resource Not Found"
}
}The failure response for invalid portal name will be returned in the following format:
{
"error": {
"code": 6504,
"message": "Domain Not Available"
}
}The failure response for invalid portal ID will be returned in the following format:
{
"error": {
"code": 6500,
"message": "General Error"
}
}