Get Record by ID
Table of Contents
Updates in V2.1
1. New parameters have been added:
- field_config parameter key allows you to decide what fields of the records you want to be fetched. Possible values: quick_view, detail_view, custom, all.
- fields parameter key defines the fields that need to be fetched when the custom value is parsed for field_config.
2. Response structures have been revised:
- In API V2, the display_value of subform and lookup fields in the fetched response included space separated values. Along with this, in V2.1, they are included as key-value pairs in zc_display_value. This helps in efficient parsing of values further.
- In API V2, all multivalue fields had the response structure as space separated values in a string. The response value structures for different fields in API V2.1 have been updated:
- Multiselect, Checkbox: [list_value]
- Single select lookup, Integration: {map}
- Multiselect lookup: [{map1},{map2},{map3}...]
This helps in efficient parsing of values further.
Overview
This API fetches the data of a specific record from a report. This record will be identified by the record ID that you supply in the request URL.
Request Details
Request URL
https://<base_url>/creator/v2.1/publish/<account_owner_name>/<app_link_name>/report/<report_link_name>/<record_ID>
Header
Key | Value | Description |
accept |
| The format in which the API response is displayed. Default value: application/json |
Request method
GET
where,
base_url | the base URL of your Creator account For example, it's www.zohoapis.com if your account belongs to Zoho's US DC, and is www.zohoapis.eu if it belongs to Zoho's EU DC. |
account_owner_name | the username of the Creator account's owner |
app_link_name | the link name of the target application |
report_link_name | the link name of the target report |
record_ID | the ID of the record from which you want to get data |
Parameters
field_config string
(Optional)
detail_view fetches only the fields included in the detailed view layout. quick_view fetches only the fields included in the quick view layout. custom fetches only the specified fields. all fetches the fields included both in the detailed view and quick view layout.Default value: quick_view
Note:
- This API will not fetch the record displayed in the related data blocks of the detail view.
- If the key value is given as custom, the fields key should also be included in the header.
(Optional)
The required fields' link names as individual comma-separated strings.Note: The field link names can be found in the field properties pane of each field in the form builder.- privatelink
(Mandatory)
Report private link
Possible Errors
Refer to this page for the list of error codes and messages.
Sample Request for Production environment (for C6 users)
Copiedcurl "https://www.zohoapis.com/creator/v2.1/publish/jason18/zylker-org/report/All_Employees/3888833000000114027?privatelink=1223456789poiuyytrewq"
-X GET
Copiedtry
{
response = invokeUrl
[
url: "https://www.zohoapis.com/creator/v2.1/publish/jason18/zylker-store/report/All_Orders/4445260000003624017?field_config=custom&fields=Single_Line%2CNumber&privatelink=1223456789poiuyytrewq"
type: GET
];
}
catch(e)
{
info "Exception while making the API request." ;
}
Copiedpackage org.example;
import okhttp3.HttpUrl;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import org.json.JSONObject;
public class PublishGetRecordById
{
public static void main(String[] args)
{
OkHttpClient client = new OkHttpClient();
HttpUrl.Builder urlBuilder = HttpUrl.parse("https://www.zohoapis.com/creator/v2.1/publish/jason18/zylker-store/report/All_Orders/4445260000003617067").newBuilder()
.addQueryParameter("field_config","custom")
.addQueryParameter("fields","Single_Line,Number")
.addQueryParameter("privatelink","1223456789poiuyytrewq");
Request request = new Request.Builder()
.url(urlBuilder.toString())
.method("GET", null)
.build();
try
{
JSONObject response = new JSONObject(client.newCall(request).execute().body().string());
}
catch (Exception e)
{
System.out.println("Exception while making the API request.");
}
}
}
Copiedtry {
let response = fetch("https://www.zohoapis.com/creator/v2.1/publish/jason18/zylker-store/report/All_Orders/4445260000003624017?field_config=custom&fields=Single_Line%2CNumber&privatelink=1223456789poiuyytrewq", {
method: "GET"
})
}
catch (exception) {
console.error(exception)
}
Copiedimport requests
api_parameters = {
"field_config": "custom",
"fields": "Single_Line,Number",
"privatelink": "1223456789poiuyytrewq"
}
try:
response = requests.get("https://www.zohoapis.com/creator/v2.1/publish/jason18/zylker-store/report/All_Orders/4445260000003617067", params=api_parameters)
except:
print("Exception while making the API request.")
This sample request will fetch all the fields that's displayed in the quick view layout of the record with ID 3888833000000114027 displayed by the All Employees report of the Zylker Org application.
Sample Response
Copied{
"code": 3000,
"data": {
"ID": "52129000008009043",
"Single_Line": "Warehouse",
"Email": "John@Lord.com",
"Currency": "1234723.90",
"Name": {
"zc_display_value": "John Lord",
"prefix": "",
"last_name": "Lord",
"suffix": "",
"first_name": "John"
},
"Address": {
"zc_display_value": "6, West Street, Phoenix, Phoenix, Arizona, 20532, USA",
"country": "USA",
"district_city": "Phoenix",
"address_line_1": "6, West Street",
"state_province": "Arizona",
"address_line_2": "Phoenix",
"postal_code": "20532"
},
"Image": "/api/v2.1/christinaclover/import/report/sample_report/52129000008009043/Image/download?filepath=1681379407888_John.jpeg",
"test_ss": {
"zc_display_value": "52129000008009170 - 13-Apr-2023 17:21:24 - christinaclover",
"Added_User": "christinaclover",
"ID": "52129000008009170",
"Added_Time": "13-Apr-2023 17:21:24"
},
"test_ss.Single_Line": "Portia",
"test_ss.Name": {
"zc_display_value": "Portia Lance",
"prefix": "",
"last_name": "Lance",
"suffix": "",
"first_name": "Portia"
},
"test_ms": [
{
"zc_display_value": "52129000008009051 - christinaclover - John - 13-Apr-2023 16:59:29",
"Modified_Time": "13-Apr-2023 16:59:29",
"Added_User": "christinaclover",
"ID": "52129000008009051",
"Name.first_name": "John"
},
{
"zc_display_value": "52129000008009170 - christinaclover - Portia - 13-Apr-2023 18:03:05",
"Modified_Time": "13-Apr-2023 18:03:05",
"Added_User": "christinaclover",
"ID": "52129000008009170",
"Name.first_name": "Portia"
}
],
"test_ms.Single_Line": [
"test",
"Portia"
],
"test_ms.Name": [
{
"zc_display_value": "John Lord",
"prefix": "",
"last_name": "Lord",
"suffix": "",
"first_name": "John"
},
{
"zc_display_value": "Portia Lance",
"prefix": "",
"last_name": "Lance",
"suffix": "",
"first_name": "Portia"
}
],
"SubForm": [
{
"zc_display_value": "John Lord 220B, Baker Street, London, London, 13455, United Kingdom 10-Apr-2023 52129000008009051 52129000008009051, 52129000008009084",
"Date_field": "10-Apr-2023",
"Address": {
"zc_display_value": "220B, Baker Street, London, London, 13455, United Kingdom",
"country": "United Kingdom",
"district_city": "London",
"address_line_1": "220B, Baker Street",
"state_province": "London",
"address_line_2": "",
"postal_code": "13455"
},
"test": {
"zc_display_value": "52129000008009051",
"ID": "52129000008009051"
},
"test_ms": [
{
"zc_display_value": "52129000008009051",
"ID": "52129000008009051"
},
{
"zc_display_value": "52129000008009084",
"ID": "52129000008009084"
}
],
"ID": "52129000008009023",
"Name": {
"zc_display_value": "John Lord",
"last_name": "Lord",
"first_name": "John"
}
},
{
"zc_display_value": " ",
"Date_field": "",
"Address": {
"zc_display_value": "",
"country": "",
"district_city": "",
"address_line_1": "",
"state_province": "",
"address_line_2": "",
"postal_code": ""
},
"test": {},
"test_ms": [],
"ID": "52129000008009029"
}
],
"Users_MS": [
"christinaclover",
"manish.koothrapalli"
]
}
}