Zoho Analytics API offers wide range of functions to help developers build & manage powerful reporting and analytical capabilities for their business application needs. You can add powerful business intelligence capabilities to your product/application, build add-ons to analyze data from third-party business applications (eg., Google Ad-words, Google Analytics, CRM systems etc., ) that you use and do much more. In-fact Zoho Analytics API is used by many Zoho Applications ( Zoho CRM , Zoho Creator , Zoho Projects , Zoho Books …) for seamlessly providing Reporting and Analytical features based on Zoho Analytics to their users.
Easy to use programming language wrappers called “Client Libraries” are provided to conveniently use the Zoho Analytics API from within your familiar programming language like Java, C#, Python, PHP, GO and Google Applications.
Prerequisites
Users should have a valid Zoho login email address to use the API. If you do not have one, please Sign up into Zoho Analytics and create a login.
It is mandatory to use HTTPS in all API requests instead of HTTP request. HTTP is not supported
Zoho Analytics REST API supports OAuth 2.0 protocol to authorize and authenticate API calls. Follow the steps listed here to use OAuth 2.0 protocol in Zoho Analytics APIs.
Choose Client Type that suits your application type.
Client-based Applications: Applications that are built to run exclusively on browsers independent of web servers.
Server-based Applications: Web-based applications that are built to run with a dedicated HTTP server. NOTE:Server-based applications are chosen when your application is used by multiple users and requires user intervention during authorization.
Mobile-based Applications: Applications that are built to run on smartphones and tablets.
Non-browser Applications: Applications that run on devices without browsers such as smart TVs and printers.
Self Client: For standalone server-side application performing a back-end job, and you do not have a domain and a redirect URL. NOTE:Self Client type is recommended for users using ZohoAnalytics UploadTool and ZohoAnalytics Client Libraries.
After choosing the client type, provide the required details and click 'Create'.
On successful registration, you will be provided with a set of OAuth 2.0 credentials such as <Client_ID> and <Client_Secret> that will be only known to Zoho and your application. (Do not share this credentials anywhere)
Generating Code
After generating <Client_ID> and <Client_Secret>, a grant code has to be generated. Based on the client type the code can be generated in two ways.
After registration, click the Self Client method available on the Applications list.
Enter a valid scope. (Refer to Scopes for more details.)
Choose Time Duration. NOTE:Code value generated in this step will be expired after this period. Refresh Token (Step 3) have to be generated before the code expires.
The below URL is used to generate code.
https://accounts.zoho.com/oauth/v2/auth?scope=<SCOPE>&client_id=<CLIENT_ID>&state=testing&response_type=code&redirect_uri=<REDIRECT_URI>&access_type=offline&prompt=consent
Make a request to the below URI with the given parameters.
Scope (scope is nothing but a permission to access specific API) for which the token to be generated. Multiple scopes can be given which has to be separated by commas. Example: ZohoAnalytics.data.all,ZohoAnalytics.modeling.create Refer: available scopes
client_id *
<client_id> obtained during Client Registration (Step 1).
state
An opaque string that is round-tripped in the protocol; ie., whatever value given to this will be passed back to you.
response_type*
code (provide this literal string as the value)
redirect_uri *
One of the redirect URI given in above step. This param should be same redirect url mentioned while registering the Client (Step 1).
access_type
The allowed values are offline and online. The online access_type gives your application only the access_token which is valid for one hour. The offline access_type will give the application an access_token as well as a refresh_token. By default it is taken as online
prompt
Consent (provide this literal string as the value) Prompts for user consent each time your app tries to access user credentials. If you don't specify this parameter, the user will be prompted only the first time your app requests access.
Note: Fields with * are mandatory
On invoking this request, If you already signed in with Zoho then an user consent page will be shown, If you doesn't have an login session with Zoho then you will be redirected to the Zoho login page, and you need to enter your Zoho credentials to login. After authentication the user consent page will be shown.
Upon clicking “Accept”, the application gets authorized. The grant code is sent as a parameter in the redirect_uri.
A back-end script from your end needs to store the following details from the above URL.
code={grant_token} - This is used to generate access and refresh tokens.
location={domain} - This tells you the domain of the user from which you have to make API calls.
Note: This code is valid for only 60 seconds. Next Step have to be done within this time.
When the user clicks "Reject", the browser redirects to the redirect URI with the parameter error=access_denied, and your application is denied access to the user's data in Zoho Analytics.
Generating Tokens
REFRESH TOKEN
Refresh token is used to obtain new access tokens. This token has an unlimited lifetime, it can be revoked manually.
ACCESS TOKEN
A token that is sent to the resource server to access the protected resources of the user. Each access token will be valid only for an hour, and can be used only for the set of operations that is described in the scope.
After generating code, a POST request to be made for the following URI with the params given below, to generate refresh_token and access_token.
The below URL is used to generate access token and refresh token.
https://accounts.zoho.com/oauth/v2/token?code=<CODE>&client_id=<CLIENT_ID>&client_secret=<CLIENT_SECRET>&redirect_uri=<REDIRECT_URI>&grant_type=authorization_code
Parameter
Description
code*
<code> which is obtained in the above step (Step 2)
client_id*
<client_id> obtained during Client Registration (Step 1)
client_secret*
<client_secret> obtained during Client Registration (Step 1)
redirect_uri
This param should be same redirect url mentioned while adding Client (Step 1). This param is not required when self client application type is choosen during Client Registration (Step 1).
grant_type*
authorization_code (provide this literal string as value)
scope
Scope (scope is nothing but a permission to access specific API) for which the token to be generated. Multiple scopes can be given which has to be separated by commas. Example: ZohoAnalytics.data.all,ZohoAnalytics.modeling.create Refer: available scopes
state
An opaque string that is round-tripped in the protocol; that is to say, value will be passed back to the user.
Note: Fields with * are mandatory
In response, you will get both <access_token> and <refresh_token>.
1. The <access_token> will expire after an hour.
2. The <refresh_token> is permanent and will be used to regenerate new <access_token>, if the current access token expired.
NOTE: Each time a re-consent page is accepted, a new refresh token is generated. The maximum limit is 20 refresh tokens per user. If this limit is crossed, the first refresh token is automatically deleted to accommodate the latest one. This is done irrespective of whether the first refresh token is in use or not. (You can manually delete a refresh token by revoke request)
Refreshing Access Tokens
Access Tokens have limited validity. It expires in one hour. Once the access_token expires, user (or) the app will have to use the refresh token to request for a new access token. On using an expired access token, the request terminates throwing Invalid Oauthtoken.
NOTE: Using a refresh token a client can create up to ten access tokens in a span of ten minutes. If the limit is reached, the access token creation will be blocked for the rest of the ten minutes.
The following POST URI with the params given below, generates a new access token.
The below URL is used to Generating Access Token From Refresh Token.
https://accounts.zoho.com/oauth/v2/token?refresh_token=<REFRESH_TOKEN>&client_id=<CLIENT_ID>&client_secret=<CLIENT_SECRET>&redirect_uri=<REDIRECT_URI>&grant_type=refresh_token
Parameter
Description
refresh_token*
<refresh_token> which is obtained in the above step (Step 3)
client_id*
<client_id> obtained during Client Registration (Step 1)
client_secret*
<client_secret> obtained during Client Registration (Step 1)
redirect_uri
This param should be same redirect url mentioned while registering Client (Step 1). This param is not required when self client application type is choosen during Client Registration (Step 1).
grant_type*
refresh_token (provide this literal string as value)
In response, you will get a new <access_token>.
Calling an API using OAuth authentication
Access Token can be passed only in header and cannot be passed in the request param.
Header name = Authorization
Header value = Zoho-oauthtoken<space><access_token>
The below URL is used to revoke the refresh token.
https://accounts.zoho.com/oauth/v2/token/revoke?token=<REFRESH_TOKEN>
Parameter
Description
token
<refresh_token> which is to be revoked
SCOPE
Zoho Analytics APIs use selected scopes, which control the type of API's that the client application (or) end user can access. Tokens are usually created with specific scopes to restrict it from acceessing other API's. For example, You can generate a scope to create a view (or) to view metadata and so on.
Scopes contain three parameters — service name, scope name, and operation type.
List of scopes available in Zoho Analytics :
Scope
Description
data
To access data related APIs Availabe Scopes: ZohoAnalytics.data.read, ZohoAnalytics.data.delete, ZohoAnalytics.data.update, ZohoAnalytics.data.create, ZohoAnalytics.data.all
modeling
To access modeling related APIs Availabe Scopes: ZohoAnalytics.modeling.delete, ZohoAnalytics.modeling.update, ZohoAnalytics.modeling.create, ZohoAnalytics.modeling.all
metadata
To access metadata related APIs Availabe Scopes: ZohoAnalytics.metadata.read, ZohoAnalytics.metadata.all
share
To access sharing related APIs Availabe Scopes: ZohoAnalytics.share.delete, ZohoAnalytics.share.read, ZohoAnalytics.share.create, ZohoAnalytics.share.all
embed
To access embed related APIs Availabe Scopes: ZohoAnalytics.embed.read, ZohoAnalytics.embed.all
usermanagement
To access usermanagement related APIs Availabe Scopes: ZohoAnalytics.usermanagement.read, ZohoAnalytics.usermanagement.delete, ZohoAnalytics.usermanagement.update, ZohoAnalytics.usermanagement.create, ZohoAnalytics.usermanagement.all
fullaccess
To access all ZohoAnalytics APIs Availabe Scope: ZohoAnalytics.fullaccess.all
API Specification
Zoho Analytics API uses HTTP as the underlying transport protocol. It is based on REST principles. The following are the basic points of how the REST APIs are structured:
Every table/report/dashboard in a Zoho Analytics workspace can be uniquely identified using a URL.
The operation to be performed on the table/report/dashboard can be specified using the parameters in the URL.
The additional payload required to perform the operation should also be specified as parameters in the URL.
Every request has a response whose format can be controlled using parameters in the request URL.
It is important to understand the API specification clearly before referring to the actual API methods.
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.
Authorization Using OAuth 2.0
Access token have to be passed in the header for authorization purpose in the format given below.
Authorization: Zoho-oauthtoken <access_token>
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 or JSON 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)
Response Format
Sample Response : For ADDROW
Sample response to a request adding a row to the table.
XML Format:
<?xml version="1.0"encoding="UTF-8" ?>
<responseuri="/api/EmailAddress/WorkspaceName/TableName"action="ADDROW">
<result>
<!-- All the columns in the row , including formula columns -->
<row>
<columnname="Name">Gary</column>
<columnname="Date Of Birth">12-Jun-1980</column>
<columnname="Basic">10000</column>
<columnname="Country">USA</column>
</row>
</result>
<response>
The response format of the API request is controlled by the ZOHO_OUTPUT_FORMAT query parameter passed in the request. Currently Zoho Analytics supports XML and JSON response formats. CSV and PDF response formats are supported only for Export action.
Note: See this link for response formats in case of errors on API execution.
XML Format
The response will have the <response> tag as the root node. It might either contain a <result> or <error> node as it’s child, but not both. The <result> node will be present under normal circumstances, whereas <error> node will be present in case of error conditions.
Other formats such as CSV, PDF can be specified only when ZOHO_ACTION is EXPORT. These formats don’t have any generic parseable header/footer. See this link for more details about these formats.
Error handling
Sample error response : IMPORT DATA
Sample error response for import data in Table.
XML Format:
<?xml version="1.0"encoding="UTF-8"?>
<responseurl="/api/EmailAddress/WorkspaceName/TableName"action="IMPORT">
<error>
<code>7138</code>
<message>
Table "TableName" is not present in the workspace "WorkspaceName"
</message>
</error>
</response>
JSON Format:
{"response":
{"url": "/api/EmailAddress/WorkspaceName/TableName",
"action": "IMPORT",
"error":
{"code":7138,
"message": "Table "TableName" is not present in the workspace "WorkspaceName""}}}
API execution could result in Error conditions. In such cases, follow the below steps to identify an error condition and handle the same:
Check the http response code. If it is 4xx or 5xx (eg., 400, 500, 401 etc.,), then it is an error.
In case of error, the error information would be sent in the response body.
The format of the error content can be specified by the parameter ZOHO_ERROR_FORMAT. The value it can be either:
ZOHO_CRITERIA=("Department"='Finance')
ZOHO_CRITERIA is encoded for the url format. Unencoded value is provided below.
ZOHO_CRITERIA=("Department"='Finance')
Zoho Analytics API allows you to apply filter criteria while you execute the various actions. When you apply a criteria, the action will be performed only on the data that matches the filter criteria given.
You can apply criteria as part of the following API actions:
Update
Delete
Export
The filter criteria has to be passed as a parameter, named ZOHO_CRITERIA, to the action request. This should be part of the body of the POST request.
Format
The filter criteria that is passed as part of the request, should follow the same format as that of the SQL SELECT WHERE clause.
The generalized format of a simple criteria is given below:
(<columnname/SQL expression/SQL function calls> <relational operator> <value/column name/SQL expression/SQL function calls>)
On using ZOHO_CRITERIA for views which involves multiple tables having same column name, the criteria should append with tablename to avoid name clash.
<tablename>.<columnname> <relational operator> <value/column name/SQL expression/SQL function calls>
Description
The criteria follows the SQL SELECT WHERE condition like format. You could also use SQL in-built functions as part of the criteria. These built-in functions should be the functions supported by any of Oracle, MS SQL Server, MySQL, DB2, Sybase, ANSI SQL, Informix and PostgreSQL databases.
Name
Description
column name
Refers to the name of the column in table or query table on which you are applying a criteria
SQL Expression
You could provide any valid SQL Expression. The above expression subtract the value in the “Cost” column from value in the “Sales” column. You could use any of the Arithmetic operator supported in an SQL SELECT WHERE clause.Supported Arithmetic Operators: +, -, *, /
SQL Function call
Oracle, MS SQL Server, MySQL, DB2, Sybase, ANSI SQL, Informix and PostgreSQL databases Eg.: year(date_column) = 2008 . Note: All supported in-built function from different databases will be documented soon.
relational operator
This could be any of the relational operators supported in an SQL SELECT WHERE clause. Supported Relational Operators:
=
!=
<
>
<=
>=
LIKE
NOT LIKE
IN
NOT IN
BETWEEN
value
Refers to the exact value to match. Eg.: "Department" = 'Finance' here 'Finance' is a literal value to match.
NOTES FOR CRITERIA FORMATION:
You can combine any number of criteria that is defined in the above specified format using logical operators like AND and OR to form complex criteria, the same way as in SQL SELECT WHERE clause. Also use Braces ’()’ to group the criteria for ordering.
Enclose string literals (ie values) in single quotes.
Enclose tablename and columnname in double quotes.
EXPORT - To export table or report in different formats.
DATABASEMETADATA - To fetch information about the Workspaces and the reports created within it, in your Zoho Analytics account.
Note: Value of ZOHO_ACTION parameter should be in the same case(UPPER CASE) as given in this document.
ZOHO_OUTPUT_FORMAT
This parameter specifies the output format for the response. Following are the following supported formats:
XML
JSON
In-case ZOHO_ACTION is EXPORT then following additional formats are supported.
CSV
PDF
HTML
IMAGE
ZOHO_ERROR_FORMAT
Specifies the output format for the response in case an error occurs when trying to process the request. Following are the supported formats:
XML
JSON
ZOHO_API_VERSION
The API version of Zoho Analytics based on which the application(/service) has been written. This parameter allows the Zoho Analytics to handle applications based on the older versions.
The current API version is 1.0
Optional Parameters:
These parameters have to be sent in the body of the POST request.
ZOHO_DATE_FORMAT
This parameter can be used during Import of data, which has a date column, whose format is not properly identified by Zoho Analytics.
Example:
ZOHO_DATE_FORMAT=dd-MMM-yyyy
View this link for more details about how to construct a custom date format.
Data API
This section lists the APIs which can be used to perform data addition, bulk import, deletion and updates into your Zoho Analytics data tables. This also provides APIs to export your tables, reports & dashboards in PDF, Excel, JSON, HTML, Image and CSV formats.
email=zoho.encryption.urlEncode("");workspaceName=zoho.encryption.urlEncode("");viewName=zoho.encryption.urlEncode("");paramsMap=Map();oauthParams=Map();headers=Map();//AUTHENTICATION PARAMSoauthParams.put("client_id","********");oauthParams.put("client_secret","********");oauthParams.put("refresh_token","********");oauthParams.put("grant_type","refresh_token");tokenInfo=invokeurl[url:"https://accounts.zoho.com/oauth/v2/token"type:POSTparameters:oauthParams];if(tokenInfo.containKey("access_token")){accessToken=tokenInfo.get("access_token");headers.put("Authorization","Zoho-oauthtoken ".concat(accessToken));}else{infotokenInfo;return;}//COMMON PARAMSparamsMap.put("ZOHO_ACTION","ADDROW");paramsMap.put("ZOHO_OUTPUT_FORMAT","JSON");paramsMap.put("ZOHO_ERROR_FORMAT","JSON");paramsMap.put("ZOHO_API_VERSION","1.0");//VALUES TO BE ADDEDparamsMap.put("<column_name_1>","<value>");paramsMap.put("<column_name_2>","<value>");response=invokeurl[url:"https://analyticsapi.zoho.com/api/"+email+"/"+workspaceName+"/"+viewNametype:POSTparameters:paramsMapheaders:headers];inforesponse;
{"response":
{"url": "/api/EmailAddress/WorkspaceName/TableName",
"action": "ADDROW",
"result":
{"column_order":["Name","Date Of Birth","Salary","Country"],
"rows":["Gary","12-Jun-1980",10000,"USA"]}}}
Sample Response XML Format:
<?xml version="1.0"encoding="UTF-8" ?>
<response url ="/api/EmailAddress/WorkspaceName/TableName"action="ADDROW">
<result>
<!-- All the columns in the row , including formula columns -->
<row>
<columnname="Name">Gary</column>
<columnname="Date Of Birth">12-Jun-1980</column>
<columnname="Basic">10000</column>
<columnname="Country">USA</column>
</row>
</result>
</response>
This API allows you to add a single row into a specified table.
This parameter specifies the action to be performed by the API request. Note: Value of ZOHO_ACTION parameter should be in the same case(UPPER CASE) as given in this document.
ZOHO_OUTPUT_FORMAT
XML/JSON
This parameter specifies the output format for the response.
ZOHO_ERROR_FORMAT
XML/JSON
Specifies the output format for the response in case an error occurs when trying to process the request.
ZOHO_API_VERSION
1.0
The API version of Zoho Analytics based on which the application(/service) has been written. This parameter allows the Zoho Analytics to handle applications based on the older versions.The current API version is 1.0
Authorization
To make authenticated API request, append the access token in Authorization request header.
Header Name
Value
Description
Authorization
Zoho-oauthtoken<space><access_token>
The Access token provides a secure and temporary access to Zoho Analytics API's. Each access token will be valid only for an hour, and can be used only for the set of operations that is described in the scope.
ACTION SPECIFIC PARAMETERS (Data for the Row)
Parameter
Possible Values
Description
ZOHO_DATE_FORMAT (optional)
Format of the date. E.g. dd-MMM-YYYY
The format of date value. Specify this in-case any date field is being added and its format cannot be auto recognized by Zoho Analytics.
The column values for the row should be passed as POST parameters in <columnname>=<value> format. (The parameters should be in application/x-www-form-urlencoded format).
<columnname> - Refers to the name of the column in the table to which the value is added.
<value> - Refers to the corresponding value to be added for this column.
This parameter specifies the action to be performed by the API request. Note: Value of ZOHO_ACTION parameter should be in the same case(UPPER CASE) as given in this document.
ZOHO_OUTPUT_FORMAT
XML/JSON
This parameter specifies the output format for the response.
ZOHO_ERROR_FORMAT
XML/JSON
Specifies the output format for the response in case an error occurs when trying to process the request.
ZOHO_API_VERSION
1.0
The API version of Zoho Analytics based on which the application(/service) has been written. This parameter allows the Zoho Analytics to handle applications based on the older versions.The current API version is 1.0.
Authorization
To make authenticated API request, append the access token in Authorization request header.
Header Name
Value
Description
Authorization
Zoho-oauthtoken<space><access_token>
The Access token provides a secure and temporary access to Zoho Analytics API's. Each access token will be valid only for an hour, and can be used only for the set of operations that is described in the scope.
If that parameter is not sent, then all the rows are deleted. If criteria is sent the rows matching the criteria alone are deleted.Please view this link for more details about the format for ZOHO_CRITERIA.
ZOHO_VALID_JSON (optional)
true / false
Specific for JSON Response
By default it will be false. True - Returns a valid JSON data (with JSON escaping) False - Returns a JSON data with JS escaping.
ZOHO_CALLBACK_FUNCTION (optional)
Name of the json callback function
Specific for JSON Response
Processes JSON response elsewhere in the JavaScript code on the page
This parameter specifies the action to be performed by the API request. Note: Value of ZOHO_ACTION parameter should be in the same case(UPPER CASE) as given in this document.
ZOHO_OUTPUT_FORMAT
XML/JSON
This parameter specifies the output format for the response.
ZOHO_ERROR_FORMAT
XML/JSON
Specifies the output format for the response in case an error occurs when trying to process the request.
ZOHO_API_VERSION
1.0
The API version of Zoho Analytics based on which the application(/service) has been written. This parameter allows the Zoho Analytics to handle applications based on the older versions.The current API version is 1.0.
Authorization
To make authenticated API request, append the access token in Authorization request header.
Header Name
Value
Description
Authorization
Zoho-oauthtoken<space><access_token>
The Access token provides a secure and temporary access to Zoho Analytics API's. Each access token will be valid only for an hour, and can be used only for the set of operations that is described in the scope.
If that parameter is not sent, then all the rows are updated. If criteria is sent the rows matching the criteria alone are updated.For more details about the format for the criteria view this link.
ZOHO_DATE_FORMAT (optional)
Format of the date. E.g. dd-MMM-YYYY
The format of date value. Specify this in-case any date field is being updated and its format cannot be auto recognized by Zoho Analytics.
ZOHO_VALID_JSON
true / false
By default it will be false. True - Returns a valid JSON data (with JSON escaping) False - Returns a JSON data with JS escaping.
Specifying the data to be updated (POST params)
Pass the columns whose values you would like to update in a <columnname>=<value> format. (The parameters should be in application/x-www-form-urlencoded format).
<columnname> - Refers to the name of the column in the table whose value is to be updated.
<value> - Refers to the corresponding value to be updated in the column
For specifying empty (null) values, the parameter should be sent with empty values. In the example above, the Deduction value is taken to be empty.
from__future__importwith_statementfromReportClientimportReportClientimportsysclassSample:LOGINEMAILID="abc@zoho.com"CLIENTID="************"CLIENTSECRET="************"REFRESHTOKEN="************"DATABASENAME="Workspace Name"TABLENAME="Table Name"rc=Nonerc=ReportClient(REFRESHTOKEN, CLIENTID, CLIENTSECRET)defimportData(self,rc):uri=rc.getURI(self.LOGINEMAILID,self.DATABASENAME,self.TABLENAME)try:withopen('StoreSales.csv','r')asf:importContent=f.read()autoIdentify="true"onError="ABORT"exceptException,e:print"Error Check if file StoreSales.csv exists in
the current directory"print"("+str(e)+")"returnimpResult=rc.importData(uri,"APPEND",importContent,autoIdentify,onError,None)print"Added Rows :"+str(impResult.successRowCount)+" and Columns :"+str(impResult.selectedColCount)obj=Sample()obj.importData(obj.rc)
email=zoho.encryption.urlEncode("");workspaceName=zoho.encryption.urlEncode("");viewName=zoho.encryption.urlEncode("");paramsMap=Map();oauthParams=Map();headers=Map();//AUTHENTICATION PARAMSoauthParams.put("client_id","********");oauthParams.put("client_secret","********");oauthParams.put("refresh_token","********");oauthParams.put("grant_type","refresh_token");tokenInfo=invokeurl[url:"https://accounts.zoho.com/oauth/v2/token"type:POSTparameters:oauthParams];if(tokenInfo.containKey("access_token")){accessToken=tokenInfo.get("access_token");headers.put("Authorization","Zoho-oauthtoken ".concat(accessToken));}else{infotokenInfo;return;}file=invokeurl[url:""//download link of the file to be importedtype:GET];//COMMON PARAMSparamsMap.put("ZOHO_ACTION","IMPORT");paramsMap.put("ZOHO_OUTPUT_FORMAT","JSON");paramsMap.put("ZOHO_ERROR_FORMAT","JSON");paramsMap.put("ZOHO_API_VERSION","1.0");//ACTION SPECIFIC PARAMSparamsMap.put("ZOHO_IMPORT_TYPE","");paramsMap.put("ZOHO_AUTO_IDENTIFY","");paramsMap.put("ZOHO_ON_IMPORT_ERROR","");paramsMap.put("ZOHO_CREATE_TABLE","");queryParam="";keyList=paramsMap.keys();foreachkeyinkeyList{queryParam=queryParam+"&"+key+"="+paramsMap.get(key);}response=invokeurl[url:"https://analyticsapi.zoho.com/api/"+email+"/"+workspaceName+"/"+viewName+"?"+queryParamtype:POSTfiles:{"paramName":"ZOHO_FILE","content":file}headers:headers];inforesponse;
This parameter specifies the action to be performed by the API request. Note: Value of ZOHO_ACTION parameter should be in the same case(UPPER CASE) as given in this document.
ZOHO_OUTPUT_FORMAT
XML/JSON
This parameter specifies the output format for the response.
ZOHO_ERROR_FORMAT
XML/JSON
Specifies the output format for the response in case an error occurs when trying to process the request.
ZOHO_API_VERSION
1.0
The API version of Zoho Analytics based on which the application(/service) has been written. This parameter allows the Zoho Analytics to handle applications based on the older versions.The current API version is 1.0.
Authorization
To make authenticated API request, append the access token in Authorization request header.
Header Name
Value
Description
Authorization
Zoho-oauthtoken<space><access_token>
The Access token provides a secure and temporary access to Zoho Analytics API's. Each access token will be valid only for an hour, and can be used only for the set of operations that is described in the scope.
If that parameter is not sent, then all the rows are updated. If criteria is sent the rows matching the criteria alone are updated.
ZOHO_FILE or ZOHO_IMPORT_DATA (mandatory)
File or String
ZOHO_FILE - The file to be import.
In the case of importing 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)
Maximum allowed file size is 100 MB.
ZOHO_IMPORT_DATA - The string to be import.
ZOHO_IMPORT_FILETYPE (optional)
CSV/JSON
Default value is CSV. Format of the file to be imported. Supported formats are:
CSV
JSON
ZOHO_IMPORT_TYPE (mandatory)
APPEND/TRUNCATEADD/UPDATEADD
APPEND - Appends the data into the table.
TRUNCATEADD - Deletes all exisiting rows in the table and adds the imported data as new entry.
UPDATEADD - Updates the row if the mentioned column values are matched, else a new entry will be added.
ZOHO_AUTO_IDENTIFY (mandatory)
TRUE/FALSE
Used to specify whether to auto identify the CSV format.
ZOHO_ON_IMPORT_ERROR (mandatory)
ABORT/SKIPROW/SETCOLUMNEMPTY
This parameter controls the action to be taken incase there is an error during import.
ABORT - Incase of any error, abort the whole import.
SKIPROW - In case of any error, skip that specific row(s) which has the problem and continue importing the rest.
SETCOLUMNEMPTY - In case of any error, set the value of the error column for the row to empty and continue importing.
ZOHO_CREATE_TABLE (mandatory)
true/false.
Default is false.
In case it is true, then the table is created if the table referred in the URL doesn’t exists in the specified Workspace.
In case its false, no table is created even if the table referred in the URL does not exists in the Workspace.
ZOHO_SELECTED_COLUMNS (optional)
List of comma separated column names. E.g.,: Name, Department
Specify the columns to be imported into the Zoho Analytics table from the data being uploaded. Note: Incase of JSON files you need to specify the column names capturing the full JSON tree hierarchy eg., employee.Name, employee.Department
ZOHO_MATCHING_COLUMNS (mandatory only when the ZOHO_IMPORT_TYPE is UPDATEADD)
List of comma separated column names. E.g.,: Name,Department
The values in the columns to be matched will be used for comparison to check whether data row(s) being imported matches with an existing row(s) in the table. The existing rows in the table that match will be updated with values from data imported. The remaining rows are appended to the table as new rows.
ZOHO_SKIPTOP (optional)
<number>
Number of rows that are to be skipped from the top in the CSV file being imported.
ZOHO_THOUSAND_SEPARATOR (optional)
0 / 1 / 2 / 3
Default is 0. This parameter controls the action to be taken in case there is a thousand separator in the data. 0 - COMMA 1 - DOT 2 - SPACE 3 - SINGLE QUOTE
ZOHO_DECIMAL_SEPARATOR (optional)
0 / 1
Default is 0. This parameter controls the action to be taken in case there is a decimal separator in the data. 0 - DOT 1 - COMMA
ZOHO_DATE_FORMAT (optional)
Format of the date. E.g. dd-MMM-YYYY
The format of date value. Specify this in-case any date field is being imported and its format cannot be auto recognized by Zoho Analytics.
ZOHO_IMPORT_JSON_RETCOLNAMES (optional)
true/false.
Default value is false. This parameter is applicable only for importing JSON files. This defines how the columns names are to be constructed from the JSON file.
If set to true, then the final key attribute alone will be considered as column name.
If set to false, then the column name will be constructed by appending all the parent attributes separated by dot (.). This will result in column names which captures the full JSON tree hierarchy eg., employee.Name, employee.Department
ZOHO_COLUMN_DATEFORMAT (optional)
JSONObject with column name as key and date format as value. E.g.,:{"columnName1":"","columnName2":""} NOTE:do encode this value and use.
Specify this in case multiple date fields are being imported having different format each.
CSV Format Details
These parameters need to be specified if the ZOHO_AUTO_IDENTIFY is set to false.
Parameter
Possible Values
Description
ZOHO_COMMENTCHAR
<character>
Comment Character. If the character mentioned is found at the beginning of the row, the csv row will be skipped.
ZOHO_DELIMITER
0 / 1 / 2 / 3
Delimiter which separates the values in the file. 0 - if the delimiter is COMMA 1 - if the delimiter is TAB 2 - if the delimiter is SEMICOLON 3 - if the delimiter is SPACE
ZOHO_QUOTED
0 / 1 / 2
The Text Qualifier. 0 - None 1 - SINGLE QUOTE 2 - DOUBLE QUOTE
This parameter specifies the action to be performed by the API request. Note: Value of ZOHO_ACTION parameter should be in the same case(UPPER CASE) as given in this document.
ZOHO_OUTPUT_FORMAT
XML/JSON/CSV/PDF/HTML/IMAGE
This parameter specifies the output format for the response.
ZOHO_ERROR_FORMAT
XML/JSON
Specifies the output format for the response in case an error occurs when trying to process the request.
ZOHO_API_VERSION
1.0
The API version of Zoho Analytics based on which the application(/service) has been written. This parameter allows the Zoho Analytics to handle applications based on the older versions.The current API version is 1.0.
Authorization
To make authenticated API request, append the access token in Authorization request header.
Header Name
Value
Description
Authorization
Zoho-oauthtoken<space><access_token>
The Access token provides a secure and temporary access to Zoho Analytics API's. Each access token will be valid only for an hour, and can be used only for the set of operations that is described in the scope.
If that parameter is not sent, then all the rows are exported. If criteria is sent the rows matching the criteria alone are exported.For more details about the format for the criteria refer this link.
Literal SQL Query can be used as criteria. Export using joining tables and specific columns can be done using ZOHO_SQLQUERY. Note:Shared users are not allowed to use this parameter.
GENERATETOC (optional - only for dashboards)
true / false
true - To generate Table Of Contents.By default it will be false.
ZOHO_DASHBOARD_LAYOUT (optional - only for dashboards)
0 or 1
0 - For Each Report in New Page 1 - For Layout as in Dashboard
Additional optional parameters.
All the parameters that all defined below are optional one.
CSV Format
Parameter
Possible Values
Description
ZOHO_DELIMITER
Value between 0 - 3 0 - COMMA 1 - TAB 2 - SEMICOLON 3 - SPACE
The delimiter character used for separating the fields in a row in the CSV.
ZOHO_RECORD_DELIMITER
Value between 0 - 2 0 - DOS 1 - UNIX 2 - MAC
The record delimiter (newline character) to use.
ZOHO_QUOTED
Value between 0 - 1 0 - SINGLE 1 - DOUBLE
The quote character to use for quoting the values.
ZOHO_INCLUDE_HEADER
true / false
true - To include the column names in the first row of the CSV exported. false - To not include the column names in the CSV exported.
ZOHO_SHOW_HIDDENCOLS
true / false
Controls where the columns that have been hidden in the table/report have to be exported. true - To include the hidden columns of the table/report in the data exported false - To not include the hidden columns of the table/report in the data exported.
XML Format
Parameter
Possible Values
Description
ZOHO_SHOW_HIDDENCOLS
true / false
Controls where the columns that have been hidden in the table/report have to be exported. true - To include the hidden columns of the table/report in the data exported false - To not include the hidden columns of the table/report in the data exported.
HTML Format
Parameter
Possible Values
Description
ZOHO_SHOW_HIDDENCOLS
true / false
Controls where the columns that have been hidden in the table/report have to be exported. true - To include the hidden columns of the table/report in the data exported false - To not include the hidden columns of the table/report in the data exported.
PDF Format
Parameter
Possible Values
Description
ZOHO_PAPERSIZE
Value between 0 - 5 0 - LETTER 1 - LEGAL 2 - TABLOID 3 - A3 4 - A4 5 - AUTO
The size of the paper.
ZOHO_SHOW_TITLE
Value between 0 - 2 0 - AT TOP 1 - AT BOTTOM 2 - NONE
Controls the title positioning.
ZOHO_SHOW_DESC
Value between 0 - 2 0 - AT TOP 1 - AT BOTTOM 2 - NONE
Controls the description positioning.
ZOHO_EXPORT_LANGUAGE
Value between 0 - 4 0 - ENGLISH 1 - CHINESE 2 - JAPANESE 3 - EUROPEAN 4 - KOREAN
PDF will be rendered using the specified language Default - 0 (ENGLISH)
ZOHO_PAPERSTYLE
Portrait / Landscape
ZOHO_SHOW_HIDDENCOLS
true / false
Controls where the columns that have been hidden in the table/report have to be exported. true - To include the hidden columns of the table/report in the data exported false - To not include the hidden columns of the table/report in the data exported.
ZOHO_SELECTED_COLUMNS
List of comma separated column names
Controls the column names that need to be exported. If it is not given then all the columns, in the table/report, are exported.
Value between 0 - 5 0 - Leave it blank 1 - Include Title 2 - Current Date/Time 3 - Include Page number in the format “Page #” 4 - Include page number in the format “Page # Of #” 5 - CUSTOM - Include custom text in footer
The header or footer value that needs to be generated for each page at that particular position.
If any of the header/footer setting is 5 (.ie, CUSTOM) then the corresponding custom value/text should be passed.
IMAGE Format
Parameter
Possible Values
Description
ZOHO_WIDTH
<number>
The width of the image .
ZOHO_HEIGHT
<number>
The height of the image
ZOHO_TITLE
true / false
Controls whether the title of the report is to be added to the image. true - Include the title. false - Do not include title.
ZOHO_DESCRIPTION
true/false
Controls whether the description of the report is to be added to the image. true - Include the description. false - Do not include description.
ZOHO_LEGEND
true / false
Controls whether the legend is to be included in the image generated. true - Include the legend in the image. false - Do not include the legend in the image.
ZOHO_IMAGE_FORMAT
png / jpg
The format of the exported image. It could be either in PNG or JPG formats.
JSON Format
Parameter
Possible Values
Description
ZOHO_VALID_JSON
true / false
By default it will be false. True - Returns a valid JSON data (with JSON escaping) False - Returns a JSON data with JS escaping.
ZOHO_SHOW_HIDDENCOLS
true / false
Controls where the columns that have been hidden in the table/report have to be exported. true - To include the hidden columns of the table/report in the data exported false - To not include the hidden columns of the table/report in the data exported.
ZOHO_CALLBACK_FUNCTION
Name of the json callback function
Processes JSON response elsewhere in the JavaScript code on the page
KEY_VALUE_FORMAT
true / false
By default it will be false. True - Returns JSON data as ColumnName - Value pair. { "data":[ {"Rank":"1","Country":"United States","Gold":"46"}, {"Rank":"2","Country":"Great Britain","Gold":"27"}, {"Rank":"3","Country":"China","Gold":"26"} ] }
(This JSONArray alone can directly feed to the Import API).
False - Returns JSON data in traditional way. { "response":{ "uri":"\/api\/email\/WorkspaceName\/ViewName", "action":"EXPORT", "result":{ "column_order":["Rank","Country","Gold"], "rows":[ ["1","United States","46"], ["2","Great Britain","27"], ["3","China","26"] ] } } }
Export Using SQL:
Zoho Analytics has implemented the Zoho CloudSQL technology as an extension to its HTTP Web API. Using the Zoho Analytics HTTP API, users can query the workspace by providing SQL queries.
Refer to the documentation on Zoho Analytics CloudSQL for more details on how to use SQL SELECT query to fetch data from Zoho Analytics.
<responseuri="/api/EmailAddress/WorkspaceName"action="ADDROW">
<error>
<code>7103</code>
<message>
Workspace not found! Please check whether the workspace exists
</message>
</error>
</response>
Sample error JSON format:
{"response":
{"uri": "\/api\/email\/WorkspaceName",
"action": "ADDROW",
"error":
{"code":7103,
"message": "Workspace not found! Please check whether the workspace exists"}}}
This section lists all possible error response codes that could be sent from the Zoho Analytics server on failure of Data APIs. You can use this for appropriate error handling.
Error Codes
Error-Code
Reason
Solution
7103
The Workspace Name mentioned in the API URL does not exist.
Check the workspace name in the request URL and provide a valid workspace name.
7138
The view name specified in the API request URL does not exist.
Check the view name in the request URL and provide a valid view name.
7235
Not even a single column name provided in source file matches with the column data in table.
Check whether the column name in source data matches with column names present in analytics table. NOTE:Also check whether the parameter ZOHO_IMPORT_FILETYPE is provided with proper value.
7507
Value entered in the mentioned column does not follow the specified data-type.
Check the value of that column and provide value in the specified data-type.
7511
Mentioned Column is a mandatory column.
Should specify the value for that mandatory column.
8002
Specified criteria is invalid.
Provide valid criteria.
8004
The column mentioned in the criteria is not present in the table.
Check the column name and provide valid name.
8016
You need to have at-least one column for INSERT or UPDATE action.
You should provide at-least one column with value.
8504
The required parameter is not proper or has not been sent.
Send the parameter with valid data.
8506
The mentioned parameter has been sent more than the required count.
Check and remove that extra parameter mentioned in the response.
8516
Invalid value passed in the mentioned parameter.
Provide the valid data to the mentioned parameter.
8533
The user email address provided in the URL is an improper format.
Provide a valid email address.
In case of any error other than the above said, mail the API request URL parameters and error response details to support@zohoanalytics.com. Zoho Analytics Team will get back to you with the best possible solution.
Modeling API
This section lists all the modeling APIs. Modeling APIs can be used to add, delete & rename columns in a Zoho Analytics table. It also offers APIs to copy objects (workspaces, reports and formulas) from one workspace to another present in the same account or across different accounts.
This parameter specifies the action to be performed by the API request.
ZOHO_OUTPUT_FORMAT
XML/JSON
This parameter specifies the output format for the response.
ZOHO_ERROR_FORMAT
XML/JSON
Specifies the output format for the response in case an error occurs when trying to process the request.
ZOHO_API_VERSION
1.0
The API version of Zoho Analytics based on which the application(/service) has been written. This parameter allows the Zoho Analytics to handle applications based on the older versions.The current API version is 1.0.
Authorization
To make authenticated API request, append the access token in Authorization request header.
Header Name
Value
Description
Authorization
Zoho-oauthtoken<space><access_token>
The Access token provides a secure and temporary access to Zoho Analytics API's. Each access token will be valid only for an hour, and can be used only for the set of operations that is described in the scope.
ACTION SPECIFIC PARAMETERS
Parameter Name
Possible Values
Description
ZOHO_DATABASE_NAME (mandatory)
<workspace_name>
The Name of the Zoho Analytics Online Reporting workspace which can be taken from workspace URL.
This parameter specifies the action to be performed by the API request.
ZOHO_OUTPUT_FORMAT
XML/JSON
This parameter specifies the output format for the response.
ZOHO_ERROR_FORMAT
XML/JSON
Specifies the output format for the response in case an error occurs when trying to process the request.
ZOHO_API_VERSION
1.0
The API version of Zoho Analytics based on which the application(/service) has been written. This parameter allows the Zoho Analytics to handle applications based on the older versions.The current API version is 1.0.
Authorization
To make authenticated API request, append the access token in Authorization request header.
The Access token provides a secure and temporary access to Zoho Analytics API's. Each access token will be valid only for an hour, and can be used only for the set of operations that is described in the scope.
ACTION SPECIFIC PARAMETERS
Parameter Name
Possible Values
Description
ZOHO_DATABASE_NAME (mandatory)
<Workspace_name>
This parameter holds the name of the destination workspace
ZOHO_DATABASE_DESC (optional)
<Workspace_description>
This parameter holds the description of the destination workspace
ZOHO_COPY_WITHDATA (optional)
true/false
true - The data present in all tables of source workspace will be copied into destination workspace.
false - The data present in all tables of source workspace will not be copied into destination workspace
COPY_WITH_IMPORT_SOURCE (optional)
true/false
By default it will be false.
true - Import sources present in the source workspace will be copied into destination workspace.
false - Import sources present in the source workspace will not be copied into destination workspace
ZOHO_COPY_DB_KEY (mandatory)
<Workspace_key>
The secret key used for allowing the user to copy the Workspace / Reports. The source workspace Admin has to create the Copy Workspace Secret Key. For more about workspace key. Note: You need to provide the appropriate values in the above URL to generate the corresponding Copy Workspace Key for your setup.
The delete workspace API is used to delete the workspace from your Zoho Analytics Account. This API will delete the workspace present in the user account who is invoking this API, and not the workspace from other accounts. Please note that if a workspace is deleted using this API, the same workspace cannot be restored back.
This parameter specifies the action to be performed by the API request.
ZOHO_OUTPUT_FORMAT
XML/JSON
This parameter specifies the output format for the response.
ZOHO_ERROR_FORMAT
XML/JSON
Specifies the output format for the response in case an error occurs when trying to process the request.
ZOHO_API_VERSION
1.0
The API version of Zoho Analytics based on which the application(/service) has been written. This parameter allows the Zoho Analytics to handle applications based on the older versions.The current API version is 1.0.
Authorization
To make authenticated API request, append the access token in Authorization request header.
Header Name
Value
Description
Authorization
Zoho-oauthtoken<space><access_token>
The Access token provides a secure and temporary access to Zoho Analytics API's. Each access token will be valid only for an hour, and can be used only for the set of operations that is described in the scope.
ACTION SPECIFIC PARAMETERS
Parameter Name
Possible Values
Description
ZOHO_DATABASE_NAME (mandatory)
Workspace name
This parameter holds the name of the workspace to be deleted
<responseuri="/api/EmailAddress"action="ENABLEDOMAINDB">
<result>
<status>Success</status>
<message>Domain Feature has been enabled</message>
</result>
</response>
Sample Response JSON Format:
{"response":
{"uri": "\/api\/email",
"action": "ENABLEDOMAINDB",
"result":
{"status":"Success",
"message":"Domain Feature has been enabled"}}}
The Enable Workspace API is used to enable the workspace from your Zoho Analytics Account to White label account (custom domain).
This parameter specifies the action to be performed by the API request.
ZOHO_OUTPUT_FORMAT
XML/JSON
This parameter specifies the output format for the response.
ZOHO_ERROR_FORMAT
XML/JSON
Specifies the output format for the response in case an error occurs when trying to process the request.
ZOHO_API_VERSION
1.0
The API version of Zoho Analytics based on which the application(/service) has been written. This parameter allows the Zoho Analytics to handle applications based on the older versions.The current API version is 1.0.
Authorization
To make authenticated API request, append the access token in Authorization request header.
Header Name
Value
Description
Authorization
Zoho-oauthtoken<space><access_token>
The Access token provides a secure and temporary access to Zoho Analytics API's. Each access token will be valid only for an hour, and can be used only for the set of operations that is described in the scope.
ACTION SPECIFIC PARAMETERS
Parameter Name
Possible Values
Description
DBNAME (mandatory)
Workspace name
This parameter holds the name of the workspace to be enabled.
<responseuri="/api/EmailAddress"action="DISABLEDOMAINDB">
<result>
<status>Success</status>
<message>Domain Feature has been disabled</message>
</result>
</response>
Sample Response JSON Format:
{"response":
{"uri": "\/api\/email",
"action": "DISABLEDOMAINDB",
"result":
{"status":"Success",
"message":"Domain Feature has been disabled"}}}
The Disable Workspace API is used to disable the workspace from your Zoho Analytics Account to White label account (custom domain).
This parameter specifies the action to be performed by the API request.
ZOHO_OUTPUT_FORMAT
XML/JSON
This parameter specifies the output format for the response.
ZOHO_ERROR_FORMAT
XML/JSON
Specifies the output format for the response in case an error occurs when trying to process the request.
ZOHO_API_VERSION
1.0
The API version of Zoho Analytics based on which the application(/service) has been written. This parameter allows the Zoho Analytics to handle applications based on the older versions.The current API version is 1.0.
Authorization
To make authenticated API request, append the access token in Authorization request header.
Header Name
Value
Description
Authorization
Zoho-oauthtoken<space><access_token>
The Access token provides a secure and temporary access to Zoho Analytics API's. Each access token will be valid only for an hour, and can be used only for the set of operations that is described in the scope.
ACTION SPECIFIC PARAMETERS
Parameter Name
Possible Values
Description
DBNAME (mandatory)
Workspace name
This parameter holds the name of the workspace to be disabled.
This parameter specifies the action to be performed by the API request.
ZOHO_OUTPUT_FORMAT
XML/JSON
This parameter specifies the output format for the response.
ZOHO_ERROR_FORMAT
XML/JSON
Specifies the output format for the response in case an error occurs when trying to process the request.
ZOHO_API_VERSION
1.0
The API version of Zoho Analytics based on which the application(/service) has been written. This parameter allows the Zoho Analytics to handle applications based on the older versions.The current API version is 1.0.
Authorization
To make authenticated API request, append the access token in Authorization request header.
Header Name
Value
Description
Authorization
Zoho-oauthtoken<space><access_token>
The Access token provides a secure and temporary access to Zoho Analytics API's. Each access token will be valid only for an hour, and can be used only for the set of operations that is described in the scope.
ACTION SPECIFIC PARAMETERS
Parameter Name
Possible Values
Description
ZOHO_TABLE_DESIGN (mandatory)
Design content in JSON format
Table structure in JSON format (includes table name, description, folder name, column and lookup details).
<responseuri="/api/EmailAddress/WorkspaceName/TableName"action="ADDCOLUMN">
<result>
Column created successfully
</result>
</response>
Sample Response JSON Format:
{"response":
{"uri":"\/api\/email\/WorkspaceName\/TableName",
"action":"ADDCOLUMN",
"result": {"message":"Column created successfully"}}}
The Add Column API is used to add a column into Zoho Analytics Table. The account Administrator and the Workspace Admin alone can use this API to add a column in the Zoho Analytics table.
Note: In case of Workspace owner adding a column, they need to specify the login E-mail ID of the account Administrator only.
COMMON PARAMETERS
Parameter Name
Possible Values
Description
ZOHO_ACTION
ADDCOLUMN
This parameter specifies the action to be performed by the API request.
ZOHO_OUTPUT_FORMAT
XML/JSON
This parameter specifies the output format for the response.
ZOHO_ERROR_FORMAT
XML/JSON
Specifies the output format for the response in case an error occurs when trying to process the request.
ZOHO_API_VERSION
1.0
The API version of Zoho Analytics based on which the application(/service) has been written. This parameter allows the Zoho Analytics to handle applications based on the older versions.The current API version is 1.0.
Authorization
To make authenticated API request, append the access token in Authorization request header.
Header Name
Value
Description
Authorization
Zoho-oauthtoken<space><access_token>
The Access token provides a secure and temporary access to Zoho Analytics API's. Each access token will be valid only for an hour, and can be used only for the set of operations that is described in the scope.
ACTION SPECIFIC PARAMETERS
Parameter Name
Possible Values
Description
ZOHO_COLUMNNAME (mandatory)
<columnname>
The name of the column to be added into Zoho Analytics Table. Example:ZOHO_COLUMNNAME=Region . Note: The column name should be url encoded if the column name contain space or any special characters.
ZOHO_DATATYPE (mandatory)
Supported data types are:
PLAIN
MULTI_LINE
EMAIL
NUMBER
POSITIVE_NUMBER
DECIMAL_NUMBER
CURRENCY
PERCENT
DATE
BOOLEAN
URL
AUTO_NUMBER
The datatype of the column to be added into Zoho Analytics Table.
This parameter specifies the action to be performed by the API request.
ZOHO_OUTPUT_FORMAT
XML/JSON
This parameter specifies the output format for the response.
ZOHO_ERROR_FORMAT
XML/JSON
Specifies the output format for the response in case an error occurs when trying to process the request.
ZOHO_API_VERSION
1.0
The API version of Zoho Analytics based on which the application(/service) has been written. This parameter allows the Zoho Analytics to handle applications based on the older versions.The current API version is 1.0.
Authorization
To make authenticated API request, append the access token in Authorization request header.
Header Name
Value
Description
Authorization
Zoho-oauthtoken<space><access_token>
The Access token provides a secure and temporary access to Zoho Analytics API's. Each access token will be valid only for an hour, and can be used only for the set of operations that is described in the scope.
ACTION SPECIFIC PARAMETERS
Parameter Name
Possible Values
Description
ZOHO_COLUMNNAME (mandatory)
<columnname>
The name of the column to be added into Zoho Analytics Table. Example:ZOHO_COLUMNNAME=Region . Note: The column name should be url encoded if the column name contain space or any special characters.
This parameter specifies the action to be performed by the API request.
ZOHO_OUTPUT_FORMAT
XML/JSON
This parameter specifies the output format for the response.
ZOHO_ERROR_FORMAT
XML/JSON
Specifies the output format for the response in case an error occurs when trying to process the request.
ZOHO_API_VERSION
1.0
The API version of Zoho Analytics based on which the application(/service) has been written. This parameter allows the Zoho Analytics to handle applications based on the older versions.The current API version is 1.0.
Authorization
To make authenticated API request, append the access token in Authorization request header.
Header Name
Value
Description
Authorization
Zoho-oauthtoken<space><access_token>
The Access token provides a secure and temporary access to Zoho Analytics API's. Each access token will be valid only for an hour, and can be used only for the set of operations that is described in the scope.
ACTION SPECIFIC PARAMETERS
Parameter Name
Possible Values
Description
ZOHO_COLUMNNAME (mandatory)
<columnname>
The name of the column to be added into Zoho Analytics Table. Example:ZOHO_COLUMNNAME=Region . Note: The column name should be url encoded if the column name contain space or any special characters.
The Delete Column API is used to delete a column in Zoho Analytics Table. The account Administrator and the Workspace Admin alone can use this API to delete a column in a Zoho Analytics table.
Note: In case of Workspace admin deleting a column, they need to specify the login E-mail ID of the account Administrator only.
COMMON PARAMETERS
Parameter Name
Possible Values
Description
ZOHO_ACTION
DELETECOLUMN
This parameter specifies the action to be performed by the API request.
ZOHO_OUTPUT_FORMAT
XML/JSON
This parameter specifies the output format for the response.
ZOHO_ERROR_FORMAT
XML/JSON
Specifies the output format for the response in case an error occurs when trying to process the request.
ZOHO_API_VERSION
1.0
The API version of Zoho Analytics based on which the application(/service) has been written. This parameter allows the Zoho Analytics to handle applications based on the older versions.The current API version is 1.0.
Authorization
To make authenticated API request, append the access token in Authorization request header.
Header Name
Value
Description
Authorization
Zoho-oauthtoken<space><access_token>
The Access token provides a secure and temporary access to Zoho Analytics API's. Each access token will be valid only for an hour, and can be used only for the set of operations that is described in the scope.
CTION SPECIFIC PARAMETERS
Parameter Name
Possible Values
Description
ZOHO_COLUMNNAME (mandatory)
<columnname>
The name of the column to be deleted in Zoho Analytics Table. Example:ZOHO_COLUMNNAME=Region
The Rename Column API is used to rename the column in Zoho Analytics Table. The account Administrator and the Workspace Admin alone can use this API to rename a column in the Zoho Analytics table.
Note: In case of Workspace Admin renaming a column, they need to specify the login E-mail ID of the account Administrator only.
COMMON PARAMETERS
Parameter Name
Possible Values
Description
ZOHO_ACTION
RENAMECOLUMN
This parameter specifies the action to be performed by the API request.
ZOHO_OUTPUT_FORMAT
XML/JSON
This parameter specifies the output format for the response.
ZOHO_ERROR_FORMAT
XML/JSON
Specifies the output format for the response in case an error occurs when trying to process the request.
ZOHO_API_VERSION
1.0
The API version of Zoho Analytics based on which the application(/service) has been written. This parameter allows the Zoho Analytics to handle applications based on the older versions.The current API version is 1.0.
Authorization
To make authenticated API request, append the access token in Authorization request header.
Header Name
Value
Description
Authorization
Zoho-oauthtoken<space><access_token>
The Access token provides a secure and temporary access to Zoho Analytics API's. Each access token will be valid only for an hour, and can be used only for the set of operations that is described in the scope.
ACTION SPECIFIC PARAMETERS
Parameter Name
Possible Values
Description
OLDCOLUMNNAME (mandatory)
<oldcolumnname>
The name of the column to be renamed in Zoho Analytics Table. Example: OLDCOLUMNNAME=Region
NEWCOLUMNNAME (mandatory)
<newcolumnname>
The new name you wanted to give for the column.Example: NEWCOLUMNNAME=SalesRegion
The Hide Column API is used to hide the column in Zoho Analytics Table. The account Administrator and the Workspace Admin alone can use this API to hide a column in the Zoho Analytics table.
Note: In case of Workspace Admin hiding a column, they need to specify the login E-mail ID of the account Administrator only.
COMMON PARAMETERS
Parameter Name
Possible Values
Description
ZOHO_ACTION
HIDECOLUMN
This parameter specifies the action to be performed by the API request.
ZOHO_OUTPUT_FORMAT
XML/JSON
This parameter specifies the output format for the response.
ZOHO_ERROR_FORMAT
XML/JSON
Specifies the output format for the response in case an error occurs when trying to process the request.
ZOHO_API_VERSION
1.0
The API version of Zoho Analytics based on which the application(/service) has been written. This parameter allows the Zoho Analytics to handle applications based on the older versions.The current API version is 1.0.
Authorization
To make authenticated API request, append the access token in Authorization request header.
Header Name
Value
Description
Authorization
Zoho-oauthtoken<space><access_token>
The Access token provides a secure and temporary access to Zoho Analytics API's. Each access token will be valid only for an hour, and can be used only for the set of operations that is described in the scope.
ACTION SPECIFIC PARAMETERS
Parameter Name
Possible Values
Description
ZOHO_COLUMNNAME (mandatory)
<columnname>
The name of the column to be hidden in Zoho Analytics Table. Example: ZOHO_COLUMNNAME=Region. Note:More than one param is allowed.
The Show Column API is used to show the column in Zoho Analytics Table. The account Administrator and the Workspace Admin alone can use this API to show the column in the Zoho Analytics table.
Note: In case of Workspace Admin showing a column, they need to specify the login E-mail ID of the account Administrator only.
COMMON PARAMETERS
Parameter Name
Possible Values
Description
ZOHO_ACTION
SHOWCOLUMN
This parameter specifies the action to be performed by the API request.
ZOHO_OUTPUT_FORMAT
XML/JSON
This parameter specifies the output format for the response.
ZOHO_ERROR_FORMAT
XML/JSON
Specifies the output format for the response in case an error occurs when trying to process the request.
ZOHO_API_VERSION
1.0
The API version of Zoho Analytics based on which the application(/service) has been written. This parameter allows the Zoho Analytics to handle applications based on the older versions.The current API version is 1.0.
Authorization
To make authenticated API request, append the access token in Authorization request header.
Header Name
Value
Description
Authorization
Zoho-oauthtoken<space><access_token>
The Access token provides a secure and temporary access to Zoho Analytics API's. Each access token will be valid only for an hour, and can be used only for the set of operations that is described in the scope.
ACTION SPECIFIC PARAMETERS
Parameter Name
Possible Values
Description
ZOHO_COLUMNNAME (mandatory)
<columnname>
The name of the column to be shown in Zoho Analytics Table. Example: ZOHO_COLUMNNAME=Region. Note:More than one param is allowed.
The Autogenerate reports API is used to generate reports in Zoho Analytics Table. The account Administrator and the Workspace Admin alone can use this API to generate the reports.
This parameter specifies the action to be performed by the API request.
ZOHO_OUTPUT_FORMAT
XML/JSON
This parameter specifies the output format for the response.
ZOHO_ERROR_FORMAT
XML/JSON
Specifies the output format for the response in case an error occurs when trying to process the request.
ZOHO_API_VERSION
1.0
The API version of Zoho Analytics based on which the application(/service) has been written. This parameter allows the Zoho Analytics to handle applications based on the older versions.The current API version is 1.0.
Authorization
To make authenticated API request, append the access token in Authorization request header.
Header Name
Value
Description
Authorization
Zoho-oauthtoken<space><access_token>
The Access token provides a secure and temporary access to Zoho Analytics API's. Each access token will be valid only for an hour, and can be used only for the set of operations that is described in the scope.
ACTION SPECIFIC PARAMETERS
Parameter Name
Possible Values
Description
ZOHO_SOURCE (mandatory)
TABLE/COLUMN
TABLE - Reports generate for the particular table. COLUMN - Reports generate for the particular column.
ZOHO_CREATEAGAIN (optional)
true/false
True - It will generate duplicate reports if reports generated before. False - It will throw error message if reports generated before.
ZOHO_COLUMN_NAME (mandatory when SOURCE is COLUMN)
This parameter specifies the action to be performed by the API request.
ZOHO_OUTPUT_FORMAT
XML/JSON
This parameter specifies the output format for the response.
ZOHO_ERROR_FORMAT
XML/JSON
Specifies the output format for the response in case an error occurs when trying to process the request.
ZOHO_API_VERSION
1.0
The API version of Zoho Analytics based on which the application(/service) has been written. This parameter allows the Zoho Analytics to handle applications based on the older versions.The current API version is 1.0.
Authorization
To make authenticated API request, append the access token in Authorization request header.
Header Name
Value
Description
Authorization
Zoho-oauthtoken<space><access_token>
The Access token provides a secure and temporary access to Zoho Analytics API's. Each access token will be valid only for an hour, and can be used only for the set of operations that is described in the scope.
ACTION SPECIFIC PARAMETERS
Parameter Name
Possible Values
Description
ZOHO_VIEWTOCOPY (mandatory)
<existing_view_name>
This parameter holds the name of the view which has to be copied.
ZOHO_NEW_VIEWNAME (mandatory)
<new_view_name>
This parameter holds the name of the view which has to be created.
ZOHO_FOLDERNAME (optional)
<folder_name>
The name of folder where the created view to be placed.
ZOHO_DESCRIPTION (optional)
<description>
Description to the new view.
ZOHO_COPYDATA (optional)
true/false
true - The data present in view will be copied.
false - Only the structure of view wil be copied.
ZOHO_COPYLOOKUP (optional)
true/false
true - The lookup details present in view will be copied.
false - The lookup details won't get copied.
ZOHO_HUGEDATACOPY (optional)
true/false
true - Use when a table have more than two hundred thousand rows.
false - Use when a table have less than two hundred thousand rows.
This parameter specifies the action to be performed by the API request.
ZOHO_OUTPUT_FORMAT
XML/JSON
This parameter specifies the output format for the response.
ZOHO_ERROR_FORMAT
XML/JSON
Specifies the output format for the response in case an error occurs when trying to process the request.
ZOHO_API_VERSION
1.0
The API version of Zoho Analytics based on which the application(/service) has been written. This parameter allows the Zoho Analytics to handle applications based on the older versions.The current API version is 1.0.
Authorization
To make authenticated API request, append the access token in Authorization request header.
Header Name
Value
Description
Authorization
Zoho-oauthtoken<space><access_token>
The Access token provides a secure and temporary access to Zoho Analytics API's. Each access token will be valid only for an hour, and can be used only for the set of operations that is described in the scope.
ACTION SPECIFIC PARAMETERS
Parameter Name
Possible Values
Description
ZOHO_REFVIEW (mandatory)
Reference view name
This parameter holds the name of the reference view name.
ZOHO_FOLDERNAME (mandatory)
Destination folder name
This parameter holds the folder name where the views to be saved.
ISCOPYCUSTOMFORMULA (mandatory)
True / False
True - Custom formulas are copied in the new views also. False - Custom formulas are not handled in new views.
ISCOPYAGGFORMULA (mandatory)
True / False
True - Aggregate formulas are copied in the new views also. False - Aggregate formulas are not handled in new views.
This parameter specifies the action to be performed by the API request.
ZOHO_OUTPUT_FORMAT
XML/JSON
This parameter specifies the output format for the response.
ZOHO_ERROR_FORMAT
XML/JSON
Specifies the output format for the response in case an error occurs when trying to process the request.
ZOHO_API_VERSION
1.0
The API version of Zoho Analytics based on which the application(/service) has been written. This parameter allows the Zoho Analytics to handle applications based on the older versions.The current API version is 1.0.
Authorization
To make authenticated API request, append the access token in Authorization request header.
Header Name
Value
Description
Authorization
Zoho-oauthtoken<space><access_token>
The Access token provides a secure and temporary access to Zoho Analytics API's. Each access token will be valid only for an hour, and can be used only for the set of operations that is described in the scope.
ACTION SPECIFIC PARAMETERS
Parameter Name
Possible Values
Description
ZOHO_VIEW (optional)
ViewName
Name of the view to be deleted.
ZOHO_DELETE_DEPEND_VIEWS (optional)
true/false
(In case of deleting a table which has dependent views, this parameter is mandatory and set to be 'true')
true - The views(except dashboards) which created based on the particular view as parent will also get deleted.
This parameter specifies the action to be performed by the API request.
ZOHO_OUTPUT_FORMAT
XML/JSON
This parameter specifies the output format for the response.
ZOHO_ERROR_FORMAT
XML/JSON
Specifies the output format for the response in case an error occurs when trying to process the request.
ZOHO_API_VERSION
1.0
The API version of Zoho Analytics based on which the application(/service) has been written. This parameter allows the Zoho Analytics to handle applications based on the older versions.The current API version is 1.0.
Authorization
To make authenticated API request, append the access token in Authorization request header.
Header Name
Value
Description
Authorization
Zoho-oauthtoken<space><access_token>
The Access token provides a secure and temporary access to Zoho Analytics API's. Each access token will be valid only for an hour, and can be used only for the set of operations that is described in the scope.
The source workspace administrator should generate and provide the Copy Workspace Key, the secret key used to authorize the destination workspace administrator. Copying the reports using this API will copy the report along with the relationships involved and the formula columns associated with the source report. It is necessary that the parent tables of the view in the source workspace should exists with the same name in the destination workspace.
This parameter specifies the action to be performed by the API request.
ZOHO_OUTPUT_FORMAT
XML/JSON
This parameter specifies the output format for the response.
ZOHO_ERROR_FORMAT
XML/JSON
Specifies the output format for the response in case an error occurs when trying to process the request.
ZOHO_API_VERSION
1.0
The API version of Zoho Analytics based on which the application(/service) has been written. This parameter allows the Zoho Analytics to handle applications based on the older versions.The current API version is 1.0.
Authorization
To make authenticated API request, append the access token in Authorization request header.
The Access token provides a secure and temporary access to Zoho Analytics API's. Each access token will be valid only for an hour, and can be used only for the set of operations that is described in the scope.
ACTION SPECIFIC PARAMETERS
Parameter Name
Possible Values
Description
ZOHO_VIEWTOCOPY (mandatory)
view names
This parameter holds the list of view names. In case of more than one views, the view names should be separated by comma ( , ). Example:ZOHO_VIEWTOCOPY=View1,View2,View3,…
ZOHO_DATABASE_NAME (mandatory)
Workspace name
This parameter holds the name of the workspace (destination workspace) where the reports (specified in ZOHO_VIEWSTOCOPY parameter) has to be copied
ZOHO_COPY_DB_KEY (mandatory)
Workspace key
The secret key used for allowing the user to copy the Workspace / Reports. The source Workspace Admin has to create the Copy Workspace Secret Key.For more about workspace key. Note: You need to provide the appropriate values in the above URL to generate the corresponding Copy Workspace Key for your setup
ZOHO_COPY_WITHDATA (optional)
true/false
Default value is false.
true - The data present in source view will be copied to the created view.
false - The data present in source table will not be copied to the created view.
The Copy Formula API is used to copy one or more formula columns from one table to another within the same Workspace or across Workspaces and even across one user account to another. The source workspace administrator should generate and provide the Copy Workspace Key, the secret key used to authorize the destination workspace administrator. It is necessary that the table and column name in the destination Workspace should be the same as that of the table and column names in the source Workspace on which the formula is dependent. Both Custom Formula and Aggregate Formula can be copied using this API.
This parameter specifies the action to be performed by the API request.
ZOHO_OUTPUT_FORMAT
XML/JSON
This parameter specifies the output format for the response.
ZOHO_ERROR_FORMAT
XML/JSON
Specifies the output format for the response in case an error occurs when trying to process the request.
ZOHO_API_VERSION
1.0
The API version of Zoho Analytics based on which the application(/service) has been written. This parameter allows the Zoho Analytics to handle applications based on the older versions.The current API version is 1.0.
Authorization
To make authenticated API request, append the access token in Authorization request header.
Header Name
Value
Description
Authorization
Zoho-oauthtoken<space><access_token>
The Access token provides a secure and temporary access to Zoho Analytics API's. Each access token will be valid only for an hour, and can be used only for the set of operations that is described in the scope.
ACTION SPECIFIC PARAMETERS
Parameter Name
Possible Values
Description
ZOHO_FORMULATOCOPY
Formula name
This parameter holds the FORMULA NAME to be copied from the source Workspace into another table in the destination Workspace. In case more than one formulas are to be copied, the formula names should be separated by comma ( , ). Example: ZOHO_FORMULATOCOPY=MyFormula1,MyFormula2,MyFormulaN
ZOHO_DATABASE_NAME
Workspace name
This parameter holds the name of the Workspace (destination Workspace) where the destination table is present. The specified formula are copied to the table which has same name (SourceEmployeeDetails) as specified in the API URL
ZOHO_COPY_DB_KEY
Workspace key
The secret key used for allowing the user to copy the Workspace / Reports. The source Workspace admin has to create the Copy Workspace Secret Key. For more about Workspace key. Note: You need to provide the appropriate values in the above URL to generate the corresponding Copy Workspace Key for your setup
<responseuri="/api/EmailAddress/WorkspaceName"action="COPYDATABASE">
<error>
<code>7103</code>
<message>
Workspace not found! Please check whether the Workspace exists
</message>
</error>
</response>
Sample error JSON format:
{"response":
{"uri": "\/api\/email\/WorkspaceName",
"action": "COPYDATABASE",
"error":
{"code":7103,
"message": "Workspace not found! Please check whether
the Workspace exists"}}}
This section lists all possible error response codes that could be sent from the Zoho Analytics server on failure of Modeling APIs. You can use this for appropriate error handling.
Error Codes
Error-Code
Reason
Solution
7101
Workspace with the same name exists already.
Provide an alternate name.
7103
The Workspace Name mentioned in the API URL does not exist.
Check the Workspace name in the request URL and provide a valid Workspace name.
7105
View name specified in the Workspace does not exist.
Provide a valid view name.
7107
The column is not present in the specified Zoho Analytics Table.
Provide the correct name of the column to be deleted in the ZOHO_COLUMNNAME parameter.
7111
A Table with the name already exists in this Workspace.
Provide an alternate name.
7128
The column with the same name is already exists in the Zoho Analytics Table.
Provide the different name for the ZOHO_COLUMNNAME parameter.
7138
The view name specified in the API request URL does not exist.
Check the view name in the request URL and provide a valid view name.
7144
Mentioned Folder is not present in this Workspace.
Check if the mentioned folder is available.
7159
The column to be deleted is used in Reports, Formula Columns, Query Tables, etc.
The column with dependent views cannot be deleted. Please delete the dependent views and formula columns associated with this column before calling this delete column API.
7161
The Zoho Analytics Table specified in this API is a system table (created for Service Integration).
Adding columns into System Table is not allowed. You could only add columns in a non-system table using this API.
7165
The Workspace specified is a system Workspace (dedicated Workspace created for other Zoho Service integrations) which cannot be deleted.
The system Workspace cannot be deleted.
7277
The specified view holds dependent views.
Set ZOHO_DELETE_DEPEND_VIEWS as true.
8023
You do not have required permission to perform this operation.
Kindly contact our support team.
8024
Copy Workspace operation not allowed.
Check the Workspace key provided in the url.
8025
Invalid Custom Domain.
Provide a valid domain name.
8504
The required parameter is not proper or has not been sent.
Send the parameter with valid data.
8506
The mentioned parameter has been sent more than the required count.
Check and remove that extra parameter mentioned in the response.
8516
Invalid value passed in the mentioned parameter.
Provide the valid data to the mentioned parameter.
8533
The user email address provided in the URL is an improper format.
Provide a valid email address.
8534
Invalid JSON Format.
Provide a valid JSON data.
15000
A table which is needed to copy the specified report is missing in the destination Workspace.
Check the destination Workspace and create the missing tables.
15001
A column which is needed to copy the specified report is missing in the destination Workspace.
Check the destination Workspace and create the column before copying the report.
15002
A formula column which is needed to copy the specified report is missing in the destination Workspace.
Check the destination Workspace and create the formula column before copying the report.
15005
The report name specified already exists in the destination Workspace.
Check whether the report with the same name exists in the destination Workspace. Try renaming the source report or the report in destination Workspace and invoke the API again.
15007
Insufficient privileges to copy the report.
Check whether the Copy Workspace Key is valid.
15009
The formula column name specified already exists in the destination Workspace.
Check whether the formula column is already copied, otherwise, try renaming the formula column in the source table or in the destination Workspace and invoke the API again.
15010
The Formula Column name specified in the API request is not present in the Source Table.
Check the formula column name(s) specified in the ZOHO_FORMULATOCOPY parameter is correct.
15012
The reports specified in the API request is not present in the Source Workspace.
Check the reports specified in the ZOHO_VIEWTOCOPY parameter are correct and are available.
15018
The table to be copied have more than two hundred thousand rows.
Set ZOHO_HUGEDATACOPY as true.
In case of any error other than the above said, mail the API request URL parameters and error response details to support@zohoanalytics.com. Zoho Analytics Team will get back to you with the best possible solution.
Metadata API
This section lists all the metadata APIs. Metadata API’s can be used to fetch information about the reporting Workspaces,tables, reports and dashboards created in Zoho Analytics.