Quantcast
Channel: Zoho Reports API
Viewing all articles
Browse latest Browse all 71

Deleting-Data :: Version5

$
0
0

Deleting Data




1. It is mandatory to use HTTPS in all API requests instead of HTTP request. HTTP is not supported

2. Always use https://reportsapi.zoho.com as the API request URL.


The data present in a table can be deleted using this API.

Sample

A sample request that deletes the records of all the employees in finance department.

URL

https://reportsapi.zoho.com/api/abc@zoho.com/EmployeeDB/EmployeeDetails?ZOHO_ACTION=DELETE
&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML
&authtoken=g38sl4j4856guvncrywox8251sssds&ZOHO_API_VERSION=1.0

Data Sent as POST parameters.

&ZOHO_CRITERIA=(%22Department%22%3D'Finance')

ZOHO_CRITERIA is encoded for the URL format. The values without encoding is given below:

ZOHO_CRITERIA=("Department" = 'Finance')


Note


It is recommended to use Zoho Reports Login Email Address in the API URL instead of Zoho Username.

Specifying the action

In the query string of the URL, the ZOHO_ACTION parameter should be "DELETE". For explanation about other mandatory query string parameters such as ZOHO_OUTPUT_FORMAT, refer this link.

Note: Value of ZOHO_ACTION parameter should be in the same case(UPPER CASE) as given in this document.

Criteria

If the ZOHO_CRITERIA parameter is not sent, then all the rows are deleted. If criteria is sent then the rows matching the criteria alone are deleted. Please view this link for more details about the format for ZOHO_CRITERIA.

Sample Success Response

The following code snippets provides the response in XML and JSON formats for the sample refered above.

XML

<?xml version="1.0" encoding="UTF-8" ?>
<response uri="/api/abc@zoho.com/EmployeeDB/EmployeeDetails" action="DELETE">
<criteria>&quot;Department&quot; = &apos;Finance&apos;</criteria>
<result>
<message>Deleted rows</message>
<deletedrows>4</deletedrows>
</result>
</response>

JSON

{

"response":
{
"uri": "/api/abc@zoho.com/EmployeeDB/EmployeeDetails",
"action": "DELETE",
"criteria": "\"Department\" = \'Finance\'",
"result":
{
"message": "Deleted rows",
"deletedrows":"4"
}
}
}


Viewing all articles
Browse latest Browse all 71

Trending Articles