Request Format

Tags:  

Request Format



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.

All API requests should be placed as HTTPS POST request. The request consists of the following components:

  • URI (Universal Resource Identifier. Also commonly known as URL)
  • Common Mandatory Parameters sent as Query String in the URL
  • Parameters sent via the body of the POST request.

URI

The URI points to the resource inside Zoho Reports over which the action is to be performed.

https://reportsapi.zoho.com/api/<zohologinemailaddress>/<databasename>/<tablename or reportname>

It consists of the following parts

  • The base URL "https://reportsapi.zoho.com/api"
  • <zohologinemailaddress>: This should be the Zoho Login Email Address of the owner of the database (e.g., abc@zoho.com)
  • <databasename>: This should be the name of the database on which the API is to be executed. (e.g., EmployeeDB)
  • <tablename or reportname>: The name of the view (table or report or query table or dashboard name) over which the action is to be executed. (e.g., EmployeeDetails)

Parameters to be passed in Query String

The following snippet shows the common parameters that should be passed as Query string with the URI defined above:

<URI>?ZOHO_ACTION=[IMPORT/EXPORT...]&ZOHO_OUTPUT_FORMAT=[XML/JSON/PDF/...]
&ZOHO_ERROR_FORMAT=[XML/JSON]&authtoken=<your auth token>
&ZOHO_API_VERSION=1.0

The control parameters such as "ZOHO_ACTION" is mandatory and have to be sent as part of the query string in the URL. Refer to Common Parameters document to know more about the possible parameters that could be passed in the Query String.


Parameters to be passed via the body of POST Request

Apart from the parameters passed in the Query string, additional information needed for specific actions (such as values of row in a Add Row operation etc.,) needs to be passed as POST parameters

<param>1=<value>1&<param2>=<value2>....

The parameters should be encoded in application/x-www-form-urlencoded format (This is the default format used by any simple html form).

Note: In the case of importing csv files multipart/form-data format should be used. (This is the default format used by html forms that contain file type fields used for uploading files)

Sample 

The below URL adds a row in EmployeeDetails table in EmployeeDB database in a CSV format.

https://reportsapi.zoho.com/api/abc@zoho.com/EmployeeDB/EmployeeDetails?ZOHO_ACTION=ADDROW&ZOHO_OUTPUT_FORMAT=XML
&ZOHO_ERROR_FORMAT=XML&authtoken=g38sl4j4856guvncrywox8251sssds&ZOHO_API_VERSION=1.0
Data Sent as POST parameter.
&Name=Gary&Date Of Birth=12-Jun-1980&Country=USA&Salary=10000

    Post a comment

    Your Name or E-mail ID (mandatory)

    Note: Your comment will be published after approval of the owner.




     RSS of this page