Add Records
Table of Contents
Overview
This API adds one or more records to a form in your Zoho Creator application. Subject to validations, each JSON object in the input file will be added as a record. A maximum of 200 records can be created per request.
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 Add Records API below:
Request Details
Request URL
https://<base_url>/publishapi/v2/<account_owner_name>/<app_link_name>/form/<form_link_name>
Request method
POST
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 |
form_link_name | the link name of the target form |
Mandatory Parameters
privatelink | Form private link |
Setting Field Values
- The Add 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
Records will be added to the target form provided your data passes its validations, 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.
- Allow one entry per user: When enabled, this property ensures that the target form accepts only one entry per application user, who are identified via the OAuth token in the API request.
- Allow one entry per IP address: When enabled, this property ensures that the target form accepts only one entry per public IP address.
- Form availability: This property restricts the target form's availability to the predefined duration.
- Maximum entries: This property restricts the target form to accept the predefined number of entries.
- 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 Add Records API includes the following keys:
- result
This key will contain the details about the records created 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 creating records for each JSON object (given as part of the API request). 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 Added Successfully" or the message that's configured for the target form's show message property, 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 Added Successfully"
- data
This key will list the ID of the records created. It will also list other field values from the created records 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 the direct to form property or a redirection action as part of workflows. 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 complete list of error codes and messages.
Sample Request for Production environment (for C6 users)
Copiedcurl "https://creator.zoho.com/publishapi/v2/jason18/zylker-store/form/Orders?privatelink=1223456789poiuyytrewq"
-X POST
-d "@newrecords.json"
Sample input to add one record
Copied{
"data": {
"Name": {
"first_name": "Jason",
"last_name": "Bowley"
},
"Address": {
"address_line_1": "Addr Line 1",
"address_line_2": "Addr Line 2",
"district_city": "Burlington",
"state_province": "Idaho",
"postal_Code": "52601",
"country": "United States"
},
"Rich_Text": "test1<div>test2</div><div>test3</div>",
"Phone_Number": "202-555-0182",
"Single_Line": "abcdefgh",
"Multi_Line": "test\ntest\ntest",
"Email": "jason@zylker.com",
"Dropdown": "Choice 1",
"Radio": "Choice 3",
"Multi_Select": [
"Choice 1",
"Choice 2",
"Choice 3"
],
"Checkbox": [
"Choice 1",
"Choice 2"
],
"Decision_box": "true",
"Number": "1000",
"Decimal": "1000.03",
"Date_field": "10-Jan-2020",
"Time": "22:12:10",
"Date_Time": "10-Jan-2020 22:12:10",
"Url": {
"value": "Google",
"url": "www.gmap.com",
"title": "okok"
},
"Percent": "100.1",
"Currency": "150.00",
"Lookup": "2000000053950",
"SubForm": [
{
"Name": {
"first_name": "Fredd",
"last_name": "Jake"
},
"Email": "fredjake@zylker.com",
"Single_Line": "test 1"
},
{
"Name": {
"first_name": "Susan",
"last_name": "Tanks"
},
"Email": "susantanks@zylker.com",
"Single_Line": "test 2"
},
{
"Name": {
"first_name": "Carla",
"last_name": "Maeve"
},
"Email": "carlamae@zylker.com",
"Single_Line": "test 3"
}
]
},
"result": {
"fields": [
"Single_Line",
"Email"
],
"message": true,
"tasks": true
}
}