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

Request-Format :: Version8.6

$
0
0

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

Response-Format :: Version5.9

$
0
0

Response Format

The response format of the API request is controlled by the ZOHO_OUTPUT_FORMAT query parameter passed in the request. Currently Zoho Reports supports XML and JSON respone 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.

Format

<?xml version="1.0" encoding="UTF-8" ?>
<response uri="/api/<zohologinemailaddress>/<databasename>/<tablename>" action="<specifiedaction>">
<result>
[specific XML response based on action]
</result>
</response>


Sample

XML response to a request adding a row to the EmployeeDetails table in the EmployeeDB database.


<?xml version="1.0" encoding="UTF-8" ?>

<response uri="/api/abc@zoho.com/EmployeeDB/EmployeeDetails" action="ADDROW">

<result>

<!-- All the columns in the row , including formula columns -->

<row>

<column name="Name">Gary</column>

<column name="Date Of Birth">12-Jun-1980</column>

<column name="Basic">10000</column>

<column name="Country">USA</column>

</row>

</result>

<response>


JSON Format

JSON format follows the same pattern as that of XML format

Format

{
"response":
{
"uri": "/api/<zohologinemailaddress>/<databasename>/<tablename>",
"action": "<specified action>",
"result": {[action specific properties]}
}
}

Sample

JSON response to a request adding a row to the EmployeeDetails table in the EmployeeDB database.

{

"response":

{

"uri": "/api/abc@zoho.com/EmployeeDB/EmployeeDetails",

"action": "ADDROW",

"result":

{

"column_order":["Name","Date Of Birth","Salary","Country"],

"rows":[

//All the columns in the row , including formula columns

["Gary","12-Jun-1980",10000,"USA"]

}

}


}

Other Formats

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.

Common-Parameters :: Version7.9

$
0
0

Common Parameters in Query String of the API URL


In this section we will discuss about the mandatory and optional parameters that could be passed in the query string of every API call.

Mandatory Parameters:

Auth Token

Auth Token is an unique token that authenticates the user to access the Zoho Account. It is equivalent to logging into Zoho service(s) from browser. Click here to know how to generate an Auth Token. 

ZOHO_ACTION

This parameter specifies the action to be performed by the API request. The allowed values are:

  • ADDROW - To add a row of data into a table.
  • IMPORT - To import data in bulk into a table in CSV/TSV/Tabular Text formats
  • UPDATE - To update existing rows in a table.
  • DELETE - To delete rows in a table.
  • EXPORT - To export table or report in different formats.
  • DATABASEMETADATA - To fetch information about the databases and the reports created within it, in your Zoho Reports 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

Incase 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 Reports based on which the application(/service) has been written. This parameter allows the Zoho Reports 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 Reports.

Example:
ZOHO_DATE_FORMAT=dd-MMM-yyyy

View this link for more details about how to construct a custom date format.

Java-Client-Library :: Version6

$
0
0

Java Library

The Java client libraries wraps the raw HTTP based API of Zoho Reports with easy to use methods for Java language. This enables Java developers to easily use Zoho Reports API.

Javadocs

Click here for javadocs.

Download Java Client Library

Download the Java client library rom the link below.

http://css.zohostatic.com/db/api/v6_m3/ZohoReportAPIClient.zip

Samples

Samples are bundled along with the client jars in the above ZIP download. You can find them under the samples folder

For using the samples
  • Take a copy of the Store Sales database.
  • Change the configurations in Config.java
  • Compile the files using CompileSamples.bat (/CompileSamples.sh)
  • Test the samples using TestSamples.bat (/TestSamples.sh).

Available samples

API-Usage-Limits-and-Pricing :: Version1.5

$
0
0


API Usage Limits and Pricing


In order to ensure effective resource utilization and service quality, Zoho Reports controls API Usage based on units of usage and frequency of invocation of API calls. The details of these are described in the document. 


API Units



Each Zoho Repots API method has been associated with a defined quantum of units. The units consumed by your application will be calculated based on how often the different API methods are invoked in your application on a per day basis. 


Each Zoho Reports pricing plan will be capped with an allowed units per day. The limits will be applied based on your Zoho Reports plan. You can also purchase add-on units on need. 


Pricing Plans and API Units allowed per Day: 

 

Plan

API Units per Day

Free

1,000 units

Standard

10,000 units

Professional

25,000 units

Professional Plus

50,000 units

Enterprise

100,000 units

 

 

For example, a user account in Zoho Reports Standard plan, can only consume a maximum of 10,000 API units per day.

 

Units Calculation for each API Method/Action


The table below provides how many units will be consumed invoking each of the different types of API methods

 

 

API Description

API Action Name

UNITS

API Type - BULK

Import using APPEND option

IMPORT

10 units per 1000 Rows

Import using TRUCATEADD option

IMPORT

10 units per 1000 Rows

Import using UPDATEADD option

IMPORT

15 units per 1000 Rows

Export Chart View in Image or PDF format

EXPORT

10 units per request

Export any view as PDF

EXPORT

5 units per 1000 Rows

Export Dashboard in any format

EXPORT

Sum of Units of all the inner views

Export any view as HTML

EXPORT

15 units per request

All the other Export operations (not comes under the above EXPORT classifications)

Examples:

1. Exporting a Table in CSV format

2. Exporting a Pivot View in JSON format

etc.,

EXPORT

3 units per 1000 Rows

Copying a Database without Data

COPYDATABASE

25 units per request

Copying a Database with Data

COPYDATABASE

25 units per request + 1 unit per 1000 Rows

API Type - DML

Adding a Single Row

ADDROW

0.1 unit per request

Updating Rows

UPDATE

0.3 unit per request

Deleting Rows

DELETE

0.1 unit per request

API Type - METADATA

Fetching Database Metadata

DATABASEMETADATA

1 unit per request

Getting View Name

GETVIEWNAME

0.1 unit per request

Getting Database Name

GETDATABASENAME

0.1 unit per request

Getting the information of a View

GETINFO

0.1 unit per request

Deleting a Database

DELETEDATABASE

1 unit per request

Getting View URL

GETVIEWURL

1 unit per request

Getting Copy Database Key for using it in the other APIs like Copy Database, Copy Report, etc.

GETCOPYDBKEY

1 unit per request

Copying a Report

COPYREPORT

5 units per request

Copying a Formula

COPYFORMULA

2 units per request

Getting all the Sharing Informations

GETSHAREINFO

1 unit per request

Adding Users to the Zoho Reports Account

ADDUSER

0.1 unit per request

Removing Users from the Zoho Reports Account

REMOVEUSER

0.1 unit per request

Activating Users in a Zoho Reports Account

ACTIVATEUSER

0.1 unit per request

Deactivating Users in a Zoho Reports Account

DEACTIVATEUSER

0.1 unit per request

Sharing Views to Users

SHARE

5 units per request

Removing View Permissions for the Users

REMOVESHARE

5 units per request

Adding Database Owners for a Database

ADDDBOWNER

5 units per request

Removing Database Owners in the Database

REMOVEDBOWNER

5 units per request

Getting the Embed URL

GETEMBEDURL

1 unit per request

Adding a Column in the Zoho Reports Table

ADDCOLUMN

15 units per request

Deleting a Column in the Zoho Reports Table

DELETECOLUMN

10 units per request

Renaming a Column in the Zoho Reports Table

RENAMECOLUMN

1 unit per request



For example, making a “IMPORT” API (Import APPEND Type)  call to import 10,000 rows the units consumed will be:  (10,000/1,000) * 10 units = 100 units consumed.


 


When the total API Units consumed per day exceeds the allowed units for the purchased plan, Zoho Reports will send the error response with code 6043 (or) 6044.


 

API Frequency



API frequency refers to the number of API requests made per minute. Different API types have different frequency limits. Find below, the frequency limit thresholds for each API type. For example, in a minute, a maximum of 100 requests can only be sent for the DML type API.

 

API Frequency per minute

 

API TYPE

Frequency Limit (per minute)

DML

100

BULK

40

METADATA

60

OVERALL *

100

 

* - Irrespective of the API TYPE (DML / BULK / METADATA), a maximum of 100 requests can only be allowed per minute. Further requests within the minute will not be processed.

 

 Note


When the number of API requests triggered per minute exceeds the above mentioned allowed frequency limits, Zoho Reports will send the error response with code 6045.



API Units Add-on Pricing



In case, the API usage goes beyond the allowed limit of the purchased Zoho Reports plan, the Administrator of the account can either upgrade to any of the higher plans or purchase the API Units as add-on.


API Units/Day

Amount (Monthly)

10,000 units/day

$15

25,000 units/day

$25

50,000 units/day

$40

100,000 units/day

$60

200,000 units/day$80






CSharp-Client-Library :: Version2.4

$
0
0

C# Library

The C# client libraries wraps the raw HTTP based API of Zoho Reports with easy to use methods for the C# .Net platform. This enables C# .Net developers to easily use Zoho Reports API.


Prerequisites:

It is recommend to go through the Zoho Reports API Documentation and the Prerequisites before using  the C# client library code in your application.

Download C# Client Library:

Download the C# client library (dll) from the following links.

Add reference to your C# Projects using these .dll files. With this you will be able to perform Zoho Reports API operations using the available functions.

API Reference Documentation:

All the available APIs in the C# Client Library can be referred in the C# API Reference Documentation.

Methods Summary:

C# .Net developers need to create a ReportClient  object to access the below functions. The sample code snippet is below.

IReportClient RepClient = new ReportClient("-----your authtoken-----");

The ReportClient constructor has a single argument called AuthToken. You can find more information on how to get a AuthToken here. Once the ReportClient object is created, you can invoke the below methods from your C# .Net programming language.

GetURI

public string GetURI(string userEmailId)

This function returns the URI for performing User Management API requests/operations

Parameters:

  • string userEmailId - The Primary Email Address of your Zoho Reports Account 

Returns:

The URI for performing user specific API operations.


GetURI

public string GetURI(string AdminEmailId, string DatabaseName)

This function returns the URI for performing Zoho Reports Database specific API operations.

Parameters:

  • string AdminEmailId - The Primary Email Address of your Zoho Reports Account.
  • string DatabaseName - The Zoho Reports Database Name

Returns:

The URI for performing Zoho Reports Database specific API operations.


GetURI

public string GetURI(string AdminEmailId, string DatabaseName, string ViewName)

This function returns the URI for performing Zoho Reports View specific API operations.

Parameters:

  • string AdminEmailId - The Primary Email Address of your Zoho Reports Account.
  • string DatabaseName - The Zoho Reports Database Name
  • string ViewName - The Zoho Reports View Name. This could be a chart, pivot table, summary view, table, query table or dashboard created in Zoho Reports.

Returns:

The URI for performing Zoho Reports View specific API operations


Import Data

public Dictionary<string,string> ImportData(string TableURI, string ImportType, string CSVFilePath, Dictionary<string, string> ImportConfig)

This function is used to Import data from a local CSV/TSV/Txt file into Zoho Reports Online Reporting Database Table. This function is referring to Zoho Reports Import API.

Parameters:

  • string TableURI  -  The URI of the Table, into which the data has to be imported, got from the GetURI function
  • string ImportType  -  The Import Type for the import process. This can be taken from ZohoReportsConstants file (which has all the constant variables used in this Library).
  • string CSVFilePath  -  The file path of your data file.
  • Dictionary ImportConfig  -  This parameter holds the import parameters such as ZOHO_ON_IMPORT_ERROR, ZOHO_DATE_FORMAT, etc. You can check out the list of import parameters here.

Returns:

The import summary with summary name as Key and summary value as Value


Add Row

public Dictionary <string,string> AddRow (string TableURI, Dictionary<string,string> ColumnValues, Dictionary<string,string> Config)

This function is used to Add a row to a Zoho Reports Table. The row data present in the ColumnValues Dictionary will be added as a row in the specified Zoho Reports Table. This function uses the HTTP Zoho Reports Add Row API.

Parameters:

  • string TableURI  -  The URI of the table, into which the data is to be added, got from the GetURI function.
  • Dictionary ColumnValues  -  The Dictionary of Column Names and Values. The Values are added to the respective columns specified in the columnValues Dictionary.
  • Dictionary Config  -  The Dictionary for sending extra parameters, if any.

Returns:

Added values with column name as Key and row value as Value


Update Data

public void UpdateData (string TableURI, Dictionary<string, string> ColumnValues, string Criteria, Dictionary<string, string> Config)

This function is used to Update Rows in a Zoho Reports Table which matches the specified criteria. If the criteria provided is null, then all the rows will be updated with the new values provided in ColumnValues Dictionary. This function uses the HTTP Zoho Reports Update Data API.

Parameters:

  • string TableURI  -  The URI of the table, in which the data is to be updated, got from the GetURI function
  • Dictionary ColumnValues  -  The Dictionary of Column Names and Values. The Values are updated to the respective columns specified in the columnValues Dictionary.
  • string Criteria  -  Criteria for updating rows. The rows matching the specified criteria alone will get updated. The criteria follows the SQL SELECT WHERE condition like format. More details on specifying Zoho Criteria is available in Applying Filters section.
  • Dictionary Config - The Dictionary for sending extra parameters, if any.

Delete Data

public void DeleteData (string TableURI, string Criteria, Dictionary<string, string> Config)

This function is used to Delete the Rows in a Zoho Reports Table which matches the specified criteria. If the criteria provided isnull, then all the rows will be deleted. This function uses the HTTP Zoho Reports Delete Data API.

Parameters:

  • string TableURI  -  The URI of the table, in which the data is to be deleted, got from the GetURI function
  • string Criteria  -  Criteria for deleting rows. The rows matching the specified criteria alone will get deleted. The criteria follows the SQL SELECT WHERE condition like format. More details on specifying Zoho Criteria is available in Applying Filters section.
  • Dictionary Config  -  The Dictionary for sending extra parameters, if any.

Export Data As JSON

public string ExportDataAsJSON (string ViewURI, string Criteria, Dictionary<string, string> Config)

This function is used to Export the data from a Zoho Reports Table / Report in a JSON format. This function uses the HTTP Zoho Reports Export API.

Parameters:

  • string ViewURI  -  The URI of the view, from which the data is to be exported, got from the GetURI function
  • string Criteria  -  Criteria for exporting data. The rows matching the specified criteria alone will get exported. The criteria follows the SQL SELECT WHERE condition like format. More details on specifying Zoho Criteria is available in Applying Filters section.
  • Dictionary Config  -  The Dictionary for sending extra parameters, if any.

Returns:

The JSON string which contains the exported data.

Export Data As CSV

public string ExportDataAsCSV (string ViewURI, string Criteria, Dictionary<string, string> Config)

This function is used to Export the data from a Zoho Reports Table / Report in a CSV format. This function uses the HTTP  Zoho Reports Export API.

Parameters:

  • string ViewURI  -  The URI of the view, from which the data is to be exported, got from the GetURI function
  • string Criteria  -  Criteria for exporting data. The rows matching the specified criteria alone will get exported. The criteria follows the SQL SELECT WHERE condition like format. More details on specifying Zoho Criteria is available in Applying Filters section.
  • Dictionary Config  -  The Dictionary for sending extra parameters, if any.

Returns:

The CSV string which contains the exported data.

Export Data As File

public void ExportData (string ViewURI, string Format, String OutputFileName, string Criteria, Dictionary<string, string> Config)

This function is used to export the Zoho Reports Table / Report / Dashboard data in the name of the specified file. This function uses the HTTP Zoho Reports Export API.

Parameters:

  • string ViewURI  -  The URI of the view, from which the data is to be exported, got from the GetURI function
  • string Format   -   The output format for exporting the data. The supported formats are CSV, XML, JSON, HTML, PDF, IMAGE.
  • string OutputFileName  -  The data will be exported to the specified  output file in the local machine.
  • string Criteria  -  Criteria for exporting data. The rows matching the specified criteria alone will get exported. The criteria follows the SQL SELECT WHERE condition like format. More details on specifying Zoho Criteria is available in Applying Filters section.
  • Dictionary Config - The Dictionary for sending extra parameters, if any.
  • Export Data As Stream

    public void ExportData (string ViewURI, string Format,  Stream outputStream, string Criteria, Dictionary<string, string> Config)

    This function is used to export the Zoho Reports Table / Report / Dashboard data in the specified Output Stream. This function uses the HTTP Zoho Reports Export API.

    Parameters:

    • string ViewURI  - The URI of the view, from which the data is to be exported, got from the GetURI function
    • string Format   -   The output format for exporting the data. The supported formats are CSV, XML, JSON, HTML, PDF, IMAGE.
    • Stream OutputStream  -  The output stream to which the data has to be exported.
    • string Criteria  -  Criteria for exporting data. The rows matching the specified criteria alone will get exported. The criteria follows the SQL SELECT WHERE condition like format. More details on specifying Zoho Criteria is available in Applying Filterssection.
    • Dictionary Config - The Dictionary for sending extra parameters, if any.

    Export Data As Dictionary

    public Dictionary<string,object> ExportDataAsDictionary (string ViewURI, string Criteria, Dictionary<string, string> Config).

    This function is used to export the Zoho Reports Table / Report data as C# Dictionary object. You can then parse this object to retrieve the resultant data. This function uses the HTTP Zoho Reports Export API.

    Parameters:

    • string ViewURI  -  The URI of the view, from which the data is to be exported, got from the GetURI function
    • string Criteria  -  Criteria for exporting data. The rows matching the specified criteria alone will get exported. The criteria follows the SQL SELECT WHERE condition like format. More details on specifying Zoho Criteria is available in Applying Filters section.
    • Dictionary Config - The Dictionary for sending extra parameters, if any.

    Returns:

    It returns Dictionary<string,object> containing the data. You can iterate this object to get the result. The sample resultant Dictionary will be as below.

    Key<string>: column_order
    Value<Object[]>: ["column1","column2",..,"columnN"]

    Key<string>: rows
    Value<Object[]>: [ [value11,value12,..,value1N],[value21,valuu22,..,value2N] ]


    Export Data Using SQL As File

    public void ExportDataUsingSQL (string ViewURI, string Format, String OutputFileName, string SQLQuery, Dictionary<string, string> Config)

    This function is used to export the Table data got by executing the given SQL SELECT Query in your Zoho Reports database. This function uses the HTTP Zoho Reports Cloud SQL API Specification.

    Parameters:

    • string ViewURI  -  The URI of the view, from which the data is to be exported, got from the GetURI function
    • string Format   -   The output format for exporting the data. The supported formats are CSV, XML, JSON, HTML, PDF, IMAGE.
    • string OutputFileName  -  The data will be exported to the specified  output file in the local machine
    • string SQLQuery - The SQL SELECT Query which has to be executed to fetch the result set that is to be executed
    • Dictionary Config - The Dictionary for sending extra parameters, if any.

    Export Data Using SQL As Stream

    public void ExportDataUsingSQL (string ViewURI, string Format, Stream outputStream, string SQLQuery, Dictionary<string, string> Config)

    This function is used to export the Table data got by executing the given SQL SELECT Query in your Zoho Reports database. The data will exported into the specified output stream. This function uses the Zoho Reports Cloud SQL API Specification.

    Parameters:

    • string ViewURI  -  The URI of the view, from which the data is to be exported, got from the GetURI function
    • string Format   -   The output format for exporting the data. The supported formats are CSV, XML, JSON, HTML, PDF, IMAGE.
    • Stream OutputStream  -  The output stream to which the data has to be exported.
    • string SQLQuery  -  The SQL SELECT Query which has to be executed to fetch the result set that is to be executed
    • Dictionary Config - The Dictionary for sending extra parameters, if any.

    Meta Data

    public string GetDatabaseMetaData (string DatabaseURI, string MetaData, string format, Dictionary<string, string> Config)

    This function is used to get the Zoho Reports Database Metadata in the specified format (XML / JSON). You can then parse this XML / JSON to retrieve the resultant data.

    Parameters:

    • string DatabaseURI - The corresponding Zoho Reports Database URI got from the GetURI function
    • string MetaData  -  The metadata type which can be got from ZohoReportsConstants file.
    • string format - The response format for the metadata. The supported formats are XML and JSON.
    • Dictionary Config  -  The Dictionary for sending extra parameters, if any.

    Returns:

    The meta data  will be returned as an XML / JSON (based on the specified format) which you can parse to get the meta data.


    Get Copy DB Key

    public string GetCopyDBKey (string DatabaseURI, Dictionary<string, string> Config)

    This function is used to get the Copy Database Key. This key will be required in CopyDatabase function for copying the database.

    Parameters:

    • string DatabaseURI - The corresponding Zoho Reports Database URI got from the GetURI function
    • Dictionary Config - The Dictionary for sending extra parameters, if any.

    Returns:

    The Copy Database Key for the specified database in the DatabaseURI


    Copy Database

    public long CopyDatabase (string DatabaseURI, string NewDBName, string NewDBDescription, bool WithData, string CopyDBKey, Dictionary<string,string> Config)

    This function is used to copy the database in your Zoho Reports Account. The database will be copied, if the CopyDBKey is valid.

    Parameters:

    • string DatabaseURI - The URI of the Zoho Reports Database to be copied, got from the GetURI function.
    • string NewDBName - The Database Name for the newly copied database
    • string NewDBDescription  -  The Description for the newly copied database
    • bool WithData - If true, the database will be copied along with data, else the database will be copied without data
    • Dictionary Config  -  The Dictionary for sending extra parameters, if any.

    Returns:

    The Database ID for the newly copied database.


    Delete Database

    public void DeleteDatabase(string AccountURI, string DatabaseName, Dictionary<string, string> Config)

    This function is used to delete a database from your Zoho Reports Account.

    Parameters:

    • string AccountURI - Your Zoho Reports Account URI got from the GetURI function
    • string DatabaseName  -  The name of the database to be deleted

    Add User

    public void AddUser(string AccountURI, string EmailIds, Dictionary<string, string> Config)

    This function is used to Add one or more users to your Zoho Reports Account. The added users will be associated to the Administrator's Zoho Reports Account. This function does not Sign Up the user in Zoho, if the added user does not exists in Zoho. By default all the new users added will be set to Active state, and will be counted into Zoho Reports account user limit.

    Parameters:

    • string AccountURI  -  Your Zoho Reports AccountURI got from GetURI function.
    • string EmailIds  -  The Zoho primary email addresses of the users to be added, separated by comma (,).
    • Dictionary Config  -  The Dictionary for sending extra parameters, if any.

    Remove User

    public void Remove User(string AccountURI, string EmailIds, Dictionary<string, string> Config)

    This function is used to Remove one or more users from your Zoho Reports Account. This action does not remove the user from Zoho, just removes the association of that user in your Zoho Reports account.

    Parameters:

    • string AccountURI  -  Your Zoho Reports AccountURI got from GetURI function.
    • string EmailIds  -  The Zoho primary email addresses of the users to be removed, separated by comma (,).
    • Dictionary Config  -  The Dictionary for sending extra parameters, if any.

    Activate User

    public void Activate User(string AccountURI, string EmailIds, Dictionary<string, string> Config)

    This function is used to Activate one or  more users in your Zoho Reports Account.

    Parameters:

    • string AccountURI  -  Your Zoho Reports AccountURI got from GetURI function
    • string EmailIds  -  The Zoho primary email addresses of the users to be activated, separated by comma (,)
    • Dictionary Config  -  The Dictionary for sending extra parameters, if any.

    De-Activate User

    public void DeActivate User(string AccountURI, string EmailIds, Dictionary<string, string> Config)

    This function is used to Deactivate one or more users in your Zoho Reports Account.

    Parameters:

    • string AccountURI  - Your Zoho Reports AccountURI got from GetURI function.
    • string EmailIds  -  The Zoho primary email addresses of the users to be de-activated, separated by comma (,)
    • Dictionary Config  -  The Dictionary for sending extra parameters, if any.

    Set Web Proxy

    public void SetWebProxy(string host, int port, string user, string password).

    This function is used to set the proxy details if your network uses proxy.

    Parameters:

    • string host  -  The host name or IP Address of your proxy host
    • int port  -  The port number for connecting your proxy
    • string user  -  The username for authenticating to your proxy
    • string password  -  The password for authenticating to your proxy

    ZohoReportsConstants:

    This C# client library has a sealed class called ZohoReportsConstants. This class has the list of constants used in this library. The available constants are below.

    Constants used in GetDatabaseMetaData function:

    • ZOHO_CATALOG_LIST - To list the Zoho Reports databases for the specified user
    • ZOHO_CATALAOG_INFO - To fetch information about the tables & reports (view) present in the given reporting database in Zoho Reports. 
    • ZOHO_DATATYPES - To get the list of datatypes supported by Zoho Reports
    • ZOHO_TABLETYPES - Various view types available in Zoho Reports

    Constants used in ImportData function:

    • APPEND - Appends the data into the table.
    • TRUNCATEADD - Deletes all existing rows in the table and adds the imported data as a new entry.
    • UPDATEADD - Updates the row if the mentioned column values (in ZOHO_MATCHING_COLUMNS parameter) are matched, else a new entry will be added.

    Sample Program:

    The below sample program illustrates how to invoke Zoho Reports API using Zoho Reports C# client library.

    The program steps are classified as follow.

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using ZReports;  // Namespace which contains classes for invoking Zoho Reports APIs
    
    namespace MyZohoReportsClient
    {
        class MyJob
        {
    
            /*
              Creating ReportClient object for invoking Zoho Reports APIs
            */
            public IReportClient getClient()
            {
                // Creating ReportClient Object using Auth Token
                // ReportClient class contains all the supported API operations as functions
                IReportClient RepClient = new ReportClient("---your_authtoken_here---");
                return RepClient;
            }
    
            /*
     
              The following method uses Zoho Reports IMPORT API to import the data from a local file into Zoho Reports Table. 
              This method illustrates importing data from the location "C:\workspace\mydata.csv" into the table named "MyTable1" in "MyDB" reporting database. 
              The usage of Import API is described below.
     
    
              IMPORT API:
              The IMPORT API allows you to import the data from your local file into Zoho Reports Table.
    
              Zoho Reports C# Library Function:
              ImportData(string tableURI, string ImportType, string FilePath, Dictionary<string,string> ImportConfig)
    
              Parameters:
                 string tableURI
                 This is the URI for the Zoho Reports Table into which the data has to be imported.
                 Get the tableURI from GetURI(emailId,databaseName,tableName) function.
                 The GetURI function will get your email address, the Zoho Reports Database Name and Zoho Reports Table Name as parameters.
    
                 string ImportType
                 This specifies how to import data. The Import type parameter can be set to APPEND, TRUNCATEADD or UPDATEADD. These constants can be set from ZohoReportsConstants class
                 To know more about the Import Types, refer the Zoho Reports Import API Parameters section.
    
                 string FilePath
                 The location of the file which needs to be imported into Zoho Reports. The Import API will read the data from the file specified in this parameter and uploads the same
                 into Zoho Reports Table.
    
                 Dictionary<string,string> ImportConfig
                 Dictionary to specify the additional Import Parameters. This Dictionary has the Parameter Name as Key and Parameter Value as Value.
     
              This ImportData function returns the Import Summary as a Dictionary
    
            */
    
            public void importData(IReportClient RepClient)
            {
                string tableURI = RepClient.GetURI("testuser@zoho.com", "MyDB", "MyTable1");
                Dictionary<string, string> ImportConfig = new Dictionary<string, string>();
                ImportConfig.Add("ZOHO_ON_IMPORT_ERROR", "ABORT");
                Dictionary<string, string> ImportRes = RepClient.ImportData(tableURI, ZohoReportsConstants.APPEND, "C:\\workspace\\mydata.csv",ImportConfig);
            }
    
            /*
     
              The following method uses Zoho Reports ADDROW API to add a single row into the Zoho Reports Table. 
              This method illustrates adding a single row to the table "MyTable1" in "MyDB" database. This table consists of a single column named "Region" 
              The usage of AddRow API is described below.
     
    
              ADDROW API:
              The ADDROW API allows you to add a single row into the specified Zoho Reports table.
    
              Zoho Reports C# Library Function:
              AddRow(string tableURI,Dictionary<string,string> ColumnValues,Dictionary<string,string> Config)
    
              Parameters:
                 string tableURI
                 This is the URI for the Zoho Reports Table into which the data has to be imported.
                 Get the tableURI from GetURI(emailId,databaseName,tableName) function.
                 The GetURI function will get your email address, the Zoho Reports Database Name and Zoho Reports Table Name as parameters.
    
                 Dictionary<string,string> ColumnValues
                 The Dictionary which has Zoho Reports Table Column Name as Key and Column Value as Value. 
                 All the entries in the ColumnValues Dictionary will be added as a Row in the specified table in the tableURI
    
                 Dictionary<string,string> Config
                 Useful for sending additional parameters, if any. This Dictionary has the Parameter Name as Key and Parameter Value as Value.
     
              This AddRow function returns the added values as a Column Name vs. Column Value Dictionary
    
            */
    
            public void addRow(IReportClient RepClient)
            {
                string tableURI = RepClient.GetURI("testuser@zoho.com", "MyDB", "MyTable1");
                Dictionary<string, string> ColumnValues = new Dictionary<string, string>();
                ColumnValues.Add("Region", "South");
                Dictionary<string, string> addRowRes = RepClient.AddRow(tableURI, ColumnValues, config);
            }
    
    
    
            /*
     
              The following method uses Zoho Reports UPDATE API to update rows in Zoho Reports Table. 
              This method illustrates updating the value 'South' with 'North' for the column "Region" in the Zoho Reports table "MyTable1" in "MyDB" database.
              The usage of UpdateData API is described below.
     
    
              UPDATE API:
              The data present in a Zoho Reports Table can be updated using Zoho Reports UPDATE API.
    
              Zoho Reports C# Library Function:
              UpdateData(string tableURI, Dictionary<string,string> ColumnValues, string criteria, Dictionary<string,string> Config)
    
              Parameters:
                 string tableURI
                 This is the URI for the Zoho Reports Table into which the data has to be updated.
                 Get the tableURI from GetURI(emailId,databaseName,tableName) function.
                 The GetURI function will get your email address, the Zoho Reports Database Name and Zoho Reports Table Name as parameters.
    
                 Dictionary<string,string> ColumnValues
                 The Dictionary which has Zoho Reports Table Column Name as Key and Column Value as Value. 
                 All the entries in the ColumnValues Dictionary will be updated in the specified table in the tableURI
    
                 string criteria
                 Criteria for updating data. The rows matching this criteria alone will get updated. 
                 The criteria should follow the same format as that of the SQL WHERE clause.
                 To know more about specifying criteria, refer the Applying Filters section in Zoho Reports API Documentation.
    
                 Dictionary<string,string> Config
                 Useful for sending additional parameters, if any. This Dictionary has the Parameter Name as Key and Parameter Value as Value.
     
              This UpdateData function will not return any object.
             */
            public void updateRow(IReportClient RepClient)
            {
                string tableURI = RepClient.GetURI("testuser@zoho.com", "MyDB", "MyTable1");
                Dictionary<string, string> ColumnValues = new Dictionary<string, string>();
                ColumnValues.Add("Region", "North");
                string criteria = "\"Region\"='South'";
                RepClient.UpdateData(tableURI, ColumnValues, criteria, null);
            }
    
    
    
            /*
     
              The below method uses Zoho Reports DELETE API to delete rows in Zoho Reports Table. 
              In this method, the rows matching value 'South' in column Region is deleted from the table MyTable1 in MyDB database.
              The usage of DeleteData API is described below.
     
    
              DELETE API:
              The data present in a Zoho Reports Table can be deleted using Zoho Reports DELETE API.
    
              Zoho Reports C# Library Function:
              DeleteData(string tableURI, string criteria, Dictionary<string,string> Config)
    
              Parameters:
                 string tableURI
                 This is the URI for the Zoho Reports Table into which the data has to be deleted.
                 Get the tableURI from GetURI(emailId,databaseName,tableName) function.
                 The GetURI function will get your email address, the Zoho Reports Database Name and Zoho Reports Table Name as parameters.
                 string criteria
                 Criteria for deleting data. The rows matching this criteria alone will get deleted. 
                 The criteria should follow the same format as that of the SQL WHERE clause.
                 To know more about specifying criteria, refer to the Applying Filters section in Zoho Reports API Documentation.
    
                 Dictionary<string,string> Config
                 Useful for sending additional parameters, if any. This Dictionary has the Parameter Name as Key and Parameter Value as Value.
     
              This DeleteData function will not return any object.
    
            */
            public void deleteRow(IReportClient RepClient)
            {
                string tableURI = RepClient.GetURI("testuser@zoho.com", "MyDB", "MyTable1");
                string criteria = "\"Region\"='South'";
                RepClient.DeleteData(tableURI, criteria, null);
            }
    
    
    
            /*
     
              The following method uses Zoho Reports EXPORT API to Export data from a Zoho Reports Table or Report. 
              This method illustrates exporting the data matching value 'West' in column "Region" from the Zoho Reports Table "MyTable1" in "MyDB" database.
              The usage of Export API is described below.
     
    
              EXPORT API:
              The data present in a Zoho Reports Table or Report can be exported using Zoho Reports EXPORT API.
    
              Zoho Reports C# Library Function:
              ExportDataAsObject(string tableOrReportURI, string criteria, Dictionary<string,string> Config)
    
              Parameters:
                 string tableOrReportURI
                 This is the URI for the Zoho Reports Table or Report from which the data has to be exported.
                 Get the tableOrReportURI from GetURI(emailId,databaseName,tableNameOrReportName) function.
                 The GetURI function will get your email address, the Zoho Reports Database Name and Zoho Reports Table Name as parameters.
                 string criteria
                 Criteria for exporting data. The rows matching this criteria alone will get exported. 
                 The criteria should follow the same format as that of the SQL WHERE clause.
                 To know more about specifying criteria, refer to the Applying Filters section in Zoho Reports API Documentation.
    
                 Dictionary<string,string> Config
                 Useful for sending additional parameters, if any. This Dictionary has the Parameter Name as Key and Parameter Value as Value.
     
              This ExportDataAsObject function will return an object which can be iterated to get the result.
             */
            public object export(IReportClient RepClient)
            {
                string tableURI = RepClient.GetURI("testuser@zoho.com", "MyDB", "MyTable1");
                Dictionary<string, object> resObj = RepClient.ExportDataAsDictionary(tableURI, "\"Region\"='West'", null);
    Object[] columns = (Object[])resObj["column_order"];
    Object[] rows = (Object[])resObj["rows"];
     } public static void Main(string[] s) { MyJob myJob = new MyJob(); IReportClient rc = myJob.getClient(); myJob.importData(rc); myJob.addRow(rc); myJob.updateRow(rc); myJob.deleteRow(rc); myJob.export(rc); Console.Read(); } } }

Go-Client-Library :: Version1.1

$
0
0

Go Library

The Go client libraries wraps the raw HTTP based API of Zoho Reports with easy to use methods for the Go platform. This enables Go Language developers to easily use Zoho Reports API.


Prerequisites:

It is recommend to go through the Zoho Reports API Documentation and the Prerequisites before using  the Go client library code in your application.

Download Go Client Library:

Download the Go client library from the following link.



API Reference Documentation:

All the available APIs in the Go Client Library can be referred in the Go API Reference Documentation.


How to use:

The below instructions helps to use Zoho Reports Go Client Library in your Go application.


  • Download the Go Client Library from the above download link
  • Extract the ZIP file
  • Copy zoho/pkg/reportclient/reportclient.go to <GO_PATH>/src/ folder
  • Go to zoho/pkg/reportclient folder
  • Execute the below command:
    go install
  • You can use Zoho Reports Client Library as below.




package main

import  
   "fmt" "zoho/pkg/reportclient" 
)

func addrow()  
 url := reportclient.GetUri(email, dbname, tbname)
 columnvalues := map[string]string{} 
    columnvalues["Id"] = "idv" 
    columnvalues["Name"] = "zzz" 
    columnvalues["Salary"] = "999" 
    columnvalues["Experience"] = "999"
    resultmap , err := reportclient.AddRow(url, columnvalues) 
    if(err != nil) {  
      fmt.Println(err.ErrorMessage)
      fmt.Println(err.ErrorCode)
      fmt.Println(err.Action)
      fmt.Println(err.HttpStatusCode) 
  } else {
      fmt.Println(resultmap) 
  }
}
 
func main() { 
reportclient.SetAuthToken(authtoken) 
addrow()
}






Python-Client-Library :: Version3.7

$
0
0

Python Library

The Python client libraries wraps the raw HTTP based API of Zoho Reports with easy to use methods for Python language. This enables Python developers to easily use Zoho Reports API.

Pythondocs

Click here for pythondocs. (Note: The main class is ReportClient).

Download Python Client Library

Download the Python client library from the link below.

https://css.zohostatic.com/db/api/v6_m4/ZohoReportPythonLib.zip

Samples

A sample, named Sample.py, is bundled along with python client library in the above ZIP download.

For using the sample
  • Take a copy of the Store Sales database.
  • Change the configurations in Config class in the Sample.py


PHP-Client-Library :: Version1.3

$
0
0


PHP Library

The PHP client libraries wraps the raw HTTP based API of Zoho Reports with easy to use methods for the PHP platform. This enables PHP developers to easily use Zoho Reports API.


Prerequisites:

It is recommend to go through the Zoho Reports API Documentation and the Prerequisites before using  the PHP client library code in your application.

Download PHP Client Library:

Download the PHP client library from the following link.



API Reference Documentation:

All the available APIs in the PHP Client Library can be referred in the PHP API Reference Documentation.


How to use:

The below instructions helps to use Zoho Reports PHP Client Library in your PHP application.


  • Download the PHP Client Library from the above download link
  • Extract the ZIP file
  • Copy the ReportClient.php file present in Zoho/ZohoReportPHPClient/ directory into a folder
  • Point this file in your PHP code as require "ReportClient.php"
  • Use the Zoho Reports APIs from your PHP code as below.


require 'ReportClient.php';

$EMAIL_ID = "yourloginemailid";

$AUTHTOKEN = "yourauthtoken";

$DB_NAME = "yourdbname";

$TABLE_NAME = "yourtablename";


$report_client_request = new ReportClient($AUTHTOKEN);

try

{

$uri = $report_client_request->getURI($EMAIL_ID, $DB_NAME, $TABLE_NAME);

// Key name should be same as table column name.

$column_values = array("Employee Name" => "Shankar", "Employee ID" => "2015", "Experience" => "5");

$response_array = $report_client_request->addRow($uri, $column_values);

}

catch (ServerException $se)

{

$error_code        = $se->getErrorCode()."<br>";

$error_message     = $se->getErrorMessage()."<br>";

$action         = $se->getAction()."<br>";

$HTTP_statuscode   = $se->getHTTPStatusCode()."<br>";

$exception_message = $se->toString();

}

catch (ParseException $pe)

{

$exception_message = $pe->getResponseContent()."<br>";

}

catch (IOException $ie)

{

$exception_message = $ie->getResponseContent()."<br>";

} 



 





Zoho---Reports---API---Home :: Version10.1

$
0
0

Zoho Reports API

Zoho Reports offers a powerful REST style API (Application Programming Interface) that can be used by Independent Software Vendors, Developers and System Integrators to build powerful reporting and analytical capabilities into their applications. Its a HTTP based Web API, that responds to requests in XML or JSON format making it programming-language-neutral, thus enabling application development/integration in any programming language (Java, C#, Python, PHP, C, C++ etc) you know.

Zoho Reports 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 Adwords, Google Analytics, CRM systems etc., ) that you use and do much more. Infact Zoho Reports API is used by many Zoho Applications (Zoho CRMZoho Creator, Zoho Projects...) for seamlessly providing Reporting and Analytical features based on Zoho Reports to their users.

Easy to use programming language wrappers called "Client Libraries" are provided to conveniently use the Zoho Reports API from within your familiar programming language like Java, C#, Python and  Google Apps 

This API documentation is organized with the following sections:

Prerequisites

The section explains the prerequisites for using the API. Kindly go through all the links before proceeding to next sections.

API Specification

Covers detailed API specification and common terminologies used. It is important to understand the API specification clearly before referring to the actual API methods. 



Data API

This section lists the APIs which can be used to perform data addition, bulk import, deletion and updates into your Zoho Reports data tables. This also provides APIs to Export your tables, reports & dashboards in PDF, Excel, JSON, HTML, Image and CSV formats.

Modeling & Metadata API

This section lists all the modeling and metadata APIs. Modeling APIs can be used to add, delete & rename columns in a Zoho Reports table. It also offers APIs to copy objects (databases, reports and formulas) from one database to another present in the same account or across different accounts.

Metadata APis can be used to fetch information about the reporting databases,tables, reports and dashboards created in Zoho Reports. 





Sharing & Collaboration API

This section provides APIs for sharing & collaboration. You can share views (reports & dashboards) created in Zoho Reports with fine grained permission control to users through APIs. You can also manage sharing as well as remove sharing through APIs.


Embed API

With this API you can embed reports & dashboards created in Zoho Reports into your Web pages/applications programmatically. This offers great possibilities to developers for creating dynamic reporting content embedded within their websites & applications seamlessly. 




User Management API

This section lists the User Management APIs for managing users in the Zoho Reports Administrator account.

Single Sign-On API (for White Label customers)

This section lists the APIs which can be used only by White Label customers (full rebranding) to easily implement single sign-on in their application for seamless user management . 



Client Libraries

This section discusses about the Built-In Client Libraries, which are "easy to use" wrappers around the raw HTTP based Zoho Reports API, that could be used in your programming language of choice & convenience

Zoho CloudSQL

Zoho CloudSQL is a middleware technology that allows customers to interact with their business data stored in Zoho Reports through familiar SQL language.  Users can access the data in Zoho Reports using SQL SELECT queries.




API Usage Limits & Pricing

Zoho Reports API usage will be measured based on units consumed & frequency of API calls.
The API Units and frequency calculations are described in this section. API units allowed are scoped by each of the pricing plans. 


     
Contact Us

For any technical assistance in using Zoho Reports API, feel free to get in touch with our 24X7 Customer Support.

Email Address: support@zohoreports.com
Toll-free Number: 1-(888)-900-9646

     


     


     

Client-Libraries :: Version2.5

Viewing all 71 articles
Browse latest View live