Update Record by ID
Table of Contents
Overview
This API updates a specific record displayed in a report of a Zoho Creator application. The record is identified by its ID value. The update operation is subject to data validations configured for the corresponding form. Learn more
OpenAPI Specification
The OpenAPI Specification(OAS) is the most widely used standard for API description and refers to a standard interface for describing REST APIs. Download the OAS for the Update Record by ID API below:
Request Details
Request URL
https://<base_url>/api/v2/<account_owner_name>/<app_link_name>/report/<report_link_name>/<record_ID>
Request method
PATCH
Header
Key | Value | Description |
Authorization | Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf | An authentication token (authtoken) allows users to access apps and APIs without having to enter their login credentials each time. |
environment | development/stage | Refers to the environment stage. |
demo_user_name | demouser_1, demouser_2, demouser_3.. | Demo users in your Creator app can be appended along with the environment. |
OAuth Scope
scope=ZohoCreator.report.UPDATE
where,
base_url | Zoho Creator: The base URL of your Creator account For example, it's creator.zoho.com if your account belongs to Zoho's US DC, and is creator.zoho.eu if it belongs to Zoho's EU DC. Zoho Creator On-premise: The base URL specific to your Zoho Creator On-premise account. This URL will be either https://host_name:port_number (learn more) or the hostname of the server where Creator On-prem is running. |
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 that you want to update |
Setting Field Values
- The Updates Records API allows you to set values for all field types except add notes, formula, auto number, section, file upload, audio, video, signature, prediction, sentiment analysis, keyword extraction, OCR, and object detection.
- Fields are identified by their link name.
- Text fields, except multi line and rich text, can accept up to 255 characters or the value set for their max characters property.
- The value for numeric fields is subject to their max digits and decimal places properties.
- When the value for the phone field includes the international calling code, the corresponding country will be set in the field subject to its Country code options property.
- The multi line and rich text fields can accept up to 64 KB of text.
- The value for the drop down and radio fields must be one of their predefined choices. When their Allow Other Choices property is enabled, these fields will accept a custom text that doesn't exceed 255 characters.
- The value for the multi select and checkbox fields must conform to their predefined choices.
- The value for the multi select, checkbox, and lookup (multi-select) fields must be comma-separated.
- The value for the lookup and integration fields must be a valid record ID.
- When configured to accept a URL input, the image field will accept the URL of an image. You may also use the upload file API to upload an image.
- You must use the upload file API to add/update the file upload, audio, video, and signature fields.
Data Validations in Creator
The target records will be updated provided your data passes the data validations set for the form, which include:
- Mandatory: When enabled, this field property ensures that input is set for the field.
- No duplicate values: When enabled, this field property ensures that the input value is unique in that field across the records, i.e., the input value is not already present in any of the existing records.
- Max characters: This field property applies to text fields. It ensures that the input value does not exceed the number of preset characters. By default, this is set to 255 for text fields except multi line and rich text, which accept up to 64 KB of text.
- Max digits and decimal places: These field properties apply to numeric fields. They ensure that the input value does not exceed the number of preset digits and decimal places, respectively.
- Form availability: This property restricts the target form's availability to the predefined duration.
- Custom validations configured for the target form.
Understanding the Response
The success or failure of the API will be conveyed in its response. The response of the Update Record by ID API includes the following keys:
- result
This key will contain the details about the records updated by this API.
- code
At the overall request's level, this key denotes its success or failure. Inside the "result" key, this key denotes the success or failure of the update operation. Refer to this page for the complete list of codes and messages.
- message
- When the API request includes "message": true, the response will contain "message":"Data Updated Successfully" or the message that's configured as part of a show message workflow action
- When the API request includes "message": false or does not include this the message key, the response will contain "message":"Data Updated Successfully"
- data
This key will contain the ID of the updated record. It will also list other field values from the updated record when you include the fields inside the "fields" key of your API request. Refer to the sample input and sample response sections on the right.
- tasks
When the API request includes this key with value true, the response will return the details of the form, report, page, or URL to which the target form is configured to redirect to upon successful form submission. Redirection can be set up using a redirection workflow action. The "type" key will contain the type of window in which the target URL is to open (same window, new window, or parent window). The "url" key will contain one of the following, for example:
- #Form:<form_link_name>
- #Report:<report_link_name>
- #Page:<page_link_name>
- https://www.zylker.com
Possible errors
Refer to this page for the list of error codes and messages.
Sample Request for Production environment (for C6 users)
Copiedcurl "https://creator.zoho.com/api/v2/jason18/zylker-store/report/All_Orders/3888833000000114027"
-X PATCH
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
This sample request will update the record with ID 3888833000000114027, which is displayed in the All Orders report of the Zylker Store application.
Sample Request for Development/ Stage environments (for C6 users)
Copiedcurl "https://creator.zoho.com/api/v2/jason18/zylker-store/report/All_Orders/3888833000000114027"
-X PATCH
-H 'Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf'
-H 'environment: development'
-H 'demo_user_name: demouser_1'
Sample Input
Copied{
"data": {
"Email": "jason@zylker.com",
"Phone_Number": "+16103948336",
"Name": {
"prefix": "Mr.",
"first_name": "Jason",
"last_name": "Bowley",
"suffix": "Jr"
},
"Address": {
"address_line_1": "4154 High Meadow Lane",
"address_line_2": "",
"district_city": "Scranton",
"state_province": "PA",
"postal_Code": "18503",
"country": "United States"
},
"Single_Line": "Single Line of Text",
"Multi_Line": "Multiple\nLines\nof text",
"Rich_Text": "Rich Text",
"Dropdown": "Choice 1",
"Radio": "Choice 2",
"Multi_Select": [
"Choice 1",
"Choice 3"
],
"Checkbox": [
"Choice 2",
"Choice 3"
],
"Decision_box": "true",
"Number": "1000",
"Decimal": "1000.03",
"Percent": "86.45",
"Currency": "789.32",
"Date_field": "10-Jan-2020",
"Time_field": "22:12:10",
"Date_Time": "10-Jan-2020 22:12:10",
"Url": {
"value": "Zylker",
"url": "www.zylker.com",
"title": "Zylker - Title"
},
"Lookup": "3888833000000114027",
"Integration": "3888833000000114007",
"SubForm": [
{
"Name": {
"first_name": "Barry",
"last_name": "McLead"
},
"Email": "barry@zylker.com",
"Single_Line": "SingleLine of Text - Subform record 1"
},
{
"Single_Line": "SingleLine of Text - Subform record 2",
"ID": "3888833000000114027",
"row_action": "update"
},
{
"ID": "3888833000000114007",
"row_action": "update"
}
]
},
"result": {
"fields": [
"Single_Line",
"Email"
],
"message": true,
"tasks": true
}
}
Sample Response
Copied{
"code": 3000,
"data": {
"Email": "jason@zylker.com",
"Single_Line": "Single Line of Text",
"ID": "3888833000000114027"
},
"message": "Data Updated Successfully!",
"tasks": {
"openurl": {
"type": "Same window",
"url": "http://www.zylker.com"
}
}
}