Delete Records

REST API v1 - Delete Records

  • Zoho Creator's v1 APIs will reach their end-of-life on February 3rd, 2021. We strongly recommend you to migrate to the new v2 APIs. Refer to this post to learn more.
  • Accounts in Zoho's Australia data center (.com.au) can only use Creator's v2 APIs
  • Corresponding v2 APIs: Delete Records and Delete Record by ID

URL

When accessed by the application owner:

https://creator.zoho.com/api/<ownername>/<format>/<applicationName>/form/<formName>/record/delete

When accessed by a shared user:

https://creator.zoho.com/api/<ownername>/<format>/<applicationName>/view/<viewName>/record/delete

where,

<ownername>This is the admin username which can be obtained using zoho.adminuser or zoho.appuri variables (refer to this page). You can also view your app's URL in the URL bar of your web browser.
<applicationName> , <formName> and <viewName>These are the link names of your application, form and report (that is shared with the users), respectively. They can be found here.
<format>This is the format in which you want the API to respond - xml or json

Formats

xml, json

HTTP Method

POST

Parameters

Parameter NameUsageDescription
authtokenRequiredA valid API authtoken. Refer to this page to generate authtoken
scopeRequiredSet its value to creatorapi
criteriaRequired

The criteria must be specified in the format <criteria column name> <operator> <value>
where <criteria column name> is the link name of the field to check <value> against
and <operator> is the operator to use. Some of the expamples for the operators supported are
!=, <=, >=,<, >, =

Example : (Name == "Jean" && DOB == "20-Jul-1981")

process_until_limitRecommended

For performance reasons, this API supports deleting a maximum of 200 records per call. Refer to this section to learn how to process when more than 200 records match the given criteria.

Prerequisites

Notes

  • The owner of the application with a valid auth token can delete a record in a Form
  • A user with a valid auth token and share permission can delete a record in a View with record deleting enabled

Sample Request

<form method="POST" action="https://creator.zoho.com/api/sampleapps/xml/sample/form/Employee/record/delete">
<input type="hidden" name ="authtoken" value="***********">
<input type="hidden" name ="scope" id="scope" value="creatorapi">
<input type="text" name="criteria" value="Name=Gary">
<input type="text" name="process_until_limit" value="true">

<input type="submit" value="Delete Record">
</form>

Sample Response

XML response

Below is an example of how this API's XML response will look when the API request includes process_until_limit=true and there are a maximum of 200 records that match the given criteria. Refer to this section for the response with regard to deleting more than 200 records.

<response>
     <result>
        <form name="Employee">
             <delete>
                  <criteria>Name=Gary</criteria>
                       <status>Success</status>
             </delete>
             <more_records>false</more_records>
        </form>
    </result>
</response>

JSON response

Below is an example of how this API's JSON response will look when the API request includes process_until_limit=true and there are a maximum of 200 records that match the given criteria. Refer to this section for the response with regard to deleting more than 200 records.
{"formname":["RestAPI",{"operation":["delete",{"criteria":"Name=Gary","status":"Success"}],"more_records":false}]}

Error Codes

  • When the operation is successful, the response message will be displayed with status "Success"
  • If there is an error in the request format, the corresponding error code with error message will be displayed. Please refer to the topic Error codes and descriptions to know about them.

Limits

For performance reasons, the Delete Records REST API supports deleting a maximum of 200 records per call. You'll have to include process_until_limit=true when hitting this API endpoint and loop your API requests till  more_records is returned as false in the response. The following table lists all the relevant scenarios:

Does the API request include process_until_limit=true ?Number of matching recordsResult
Yesup to 200All matching records will be deleted. The more_records key in the response will have the value false.
YesMore than 200First 200 matching records will be deleted and the more_records key in the response will have the value true.
You'll have to hit this API endpoint till the more_records key's value is returned as false.
Noup to 200All matching records will be deleted. Response will not contain the more_records key.
NoMore than 200

This API will fail and the response will contain:

  • Error code: 8009
  • Error message: The number of records matching the criteria is more than 200.

Share this post : FacebookTwitter

Still can't find what you're looking for?

Write to us: support@zohocreator.com