Zoho Reports
API Documentation
Pricing Contact Us
NAV
CURL C# GO JAVA PHP PYTHON

Zoho Reports API

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. In-fact Zoho Reports 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 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, PHP, GO and Google Apps.

Prerequisites

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

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

The following are the prerequisites to use Zoho Reports API.


Zoho Reports User Account

Users should have a valid Zoho login email address to use the API. If you do not have one, please Sign up into Zoho Reports and create a login.


Auth Token

Browser Mode : URL


https://accounts.zoho.com/apiauthtoken/create?SCOPE=ZohoReports/reportsapi

API Mode : URL


https://accounts.zoho.com/apiauthtoken/nb/create?SCOPE=ZohoReports/reportsapi?EMAIL_ID=emailId&PASSWORD=password

Sample Response:


The following is a sample response for a Auth Token request.

#

#Wed Jun 29 03:07:33 PST 2013

AUTHTOKEN=bad18eba1ff45jk7858b8ae88a77fa30

RESULT=TRUE

Response Details:

* #-COMMENT  Auth Token generated date.
* AUTHTOKEN  The permanent Auth Token (Alpha numeric value) generated for 
             Zoho Reports API access.
* RESULT     Value is TRUE if the Auth Token is generated successfully.

Authentication Token, also referred as Auth Token, is a unique token that authenticates the user to access his/her Zoho Account. This is a permanent user specific token, that needs to be passed along with every Zoho Reports API request.

Generating Auth Token

Users can generate a Auth Token using one of the following modes. You can generate it just once and use it for all your API calls.

Browser Mode

To generate Auth Token from your browser, follow the steps given below.

API Mode

To generate Auth Token using API mode, send an HTTPS POST request to Zoho Accounts using the URL format given in the sample.

Mandatory “POST” Parameters to be passed along with this URL are:

Parameter Description
EMAIL_ID Specify your Zoho Login Email Address
PASSWORD Specify your Zoho Reports Password
(Note: You have to provide Application Specific Password if you are using Two Factor Authentication. Read the Note below to know how to generate this)

Note (for users using Two Factor Authentication):

If you have enabled Two Factor Authentication(TFA) for your Zoho Account, then you need to specify the Application Specific Password, instead of your Zoho Reports account password, to generate the Auth Token.

The following are the steps to generate an Application Specific Password for your Zoho Account.

  1. Login into Zoho Account.
  2. Click Two Factor Authentication. The Two Factor Authentication section in the Settings page will open.
  3. Click Manage Application Specific Passwords button.
  4. Specify a descriptive name in Device (or) App Name field. For example Zoho Reports API. The Device (or) App Name is only for your reference.
  5. Specify your Zoho Reports Account Password.
  6. Click Generate. The Application Specific Password will be generated.

Use this Application Specific Password to generate the Auth Token for your account. Click here to learn more about Application Specific Passwords.

Managing Auth Tokens

You can access and manage all the active secret Auth Tokens of your Zoho account from the Zoho Account page.

To access the active Auth Tokens:

Important Note


Reporting Database

To use the Zoho Reports API, users should have already created a reporting database with required tables and reports in Zoho Reports service using the browser based Web interface provided. You cannot use the API, if you do not have any reporting databases in your Zoho Reports account. To know how to create a database, click here.

API Specification

Zoho Reports 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:

It is important to understand the API specification clearly before referring to the actual API methods


Request Format

Sample Request:


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

Sample POST parameter

Parameters for EmployeeDetails table in EmployeeDB database. 

&Name=Gary&Date Of Birth=12-Jun-1980&Country=USA&Salary=10000

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

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

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)


Response Format

Sample Response : For ADDROW


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

XML Format:

<?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:

{
    "response":
    {
        "uri": "/api/abc@zoho.com/EmployeeDB/EmployeeDetails",
        "action": "ADDROW",
        "result":
        {
            "column_order":["Name","Date Of Birth","Salary","Country"],
            "rows":
            ["Gary","12-Jun-1980",10000,"USA"]
        }
    }
} 

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>

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]}

}

}

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.


Error handling

Sample error response : IMPORT DATA


Sample error response for import data in Table EmployeeDetails in the 
database EmployeeDB

XML Format:

<?xml version="1.0" encoding="UTF-8"?>
<response url="/api/demouser/EmployeeDB/EmployeeDetails" action="IMPORT">
    <error>
        <code>7138</code>
        <message>
        Table EmployeeDetails is not present in the database EmployeeDB
        </message>
    </error>
</response>

JSON Format:

{
    "response":
    {
        "url": "/api/demouser/EmployeeDB/EmployeeDetails",
        "action": "IMPORT",
        "error":
        {
            "code":7138,
            "message": "Table EmployeeDetails is not present in the 
                              database EmployeeDB"
        }
    }
}

API execution could result in Error conditions. In such cases, you may follow the below steps to identify an error condition and to handle the same:

XML Format

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

<response uri="/api/<zohologinemailaddress>/<databasename>/<tablename>" action="<specifiedaction>">

<error>

[error details]

</error>

</response>

JSON Format

{

"response":

{

"uri": "/api/<zohologinemailaddress>/<databasename>/<tablename>",

"action": "<specified action>",

"error": {[error details]}

}

}


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 sample values are:

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:

Incase ZOHO_ACTION is EXPORT then following additional formats are supported.

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:

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.

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.


Add Row

Download client libraries : C# | GO | JAVA | PHP | PYTHON



Sample Request:

using ZReports;

namespace Test
{
    AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
    EMAIL = "user@zoho.com";
    DBNAME = "EmployeeDB";
    TBNAME = "EmployeeTB";

    class Program
    {
        public IReportClient getClient()
        {
            IReportClient RepClient = new ReportClient(AUTHTOKEN);
            return RepClient;
        }

        public void addRow(IReportClient RepClient)
        {
            string tableURI = RepClient.GetURI(EMAIL, DBNAME, TBNAME);
            Dictionary<string, string> ColumnValues = new Dictionary
                                                 <string, string>();
            ColumnValues.Add("Region", "South");
            Dictionary<string, string> addRowRes = RepClient.AddRow(tableURI, 
                                    ColumnValues, config);
        }

        static void Main(string[] args)
        {
            Program obj = new Program();
            IReportClient rc = obj.getClient();
            obj.addRow(rc);
        }
    }
}
package main

import (
        "fmt"
        "zoho/pkg/reportclient"

)

var(
        email = "user@zoho.com"
        dbname = "Employee"
        tbname = "sample"
        authtoken = "f7d016b46be276cas21asd2a592f40101"
)

func addrow() {
        url := reportclient.GetUri(email, dbname, tbname)
        columnvalues := map[string]string{}
        columnvalues["Id"] = "999"
        columnvalues["Name"] = "zzz"
        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()
}
import com.adventnet.zoho.client.report.*;

public class Sample 
{
    String email = "user@zoho.com";
    String dbname = "EmployeeDB";
    String tbname = "EmployeeTB";
    String authtoken = "f7d016b46be276c22eea32a592f40101";
    Map config = new HashMap();
    Map colval = new HashMap();

    private ReportClient rc = new ReportClient(authtoken);

    public void addrow() throws Exception
    {
        String uri = rc.getURI(email,dbname,tbname);
        colval.put("Id", 101);
        colval.put("Name", "sam");
        Map result = rc.addRow(uri,colval,config);
        System.out.println(result);
    }

    public static void main(String[] args) throws Exception 
    {
        Sample obj = new Sample();
        obj.addrow();
    }
}
<?php
    require 'ReportClient.php';

    $EMAIL_ID = "abc@zoho.com";
    $DB_NAME = "EmployeeDB";
    $TABLE_NAME = "EmployeeTB";
    $AUTHTOKEN = "f7d016b46be2763wasda32a592f40101";

    $report_client_request = new ReportClient($AUTHTOKEN); 

    $uri = $report_client_request->getURI($EMAIL_ID, $DB_NAME, $TABLE_NAME);
    $column_values = array("Employee Name" => "Shankar", "Employee ID" => 
                                   "2015", "Experience" => "5");
    $response_array = $report_client_request->addRow($uri, $column_values);
?>
from __future__ import with_statement
from ReportClient import ReportClient
import sys

class Sample:

    LOGINEMAILID="abc@zoho.com"
    AUTHTOKEN="f7d016b46be276cd4a1232a592f40101"
    DATABASENAME="Employee"
    TABLENAME="Employee"
    rc = None
    rc = ReportClient(self.AUTHTOKEN)

    def AddRow(self,rc):
        uri = rc.getURI(self.LOGINEMAILID,self.DATABASENAME,self.TABLENAME)
        rowData = {"Date":"01 Jan, 2009 00:00:00","Region":"East","Product 
                Category": "Samples","Product":"SampleProduct","Customer Name":
                "Sample", "Sales":2000,"Cost":2000}
        result = rc.addRow(uri,rowData,None)
        print result

obj = Sample()
obj.AddRow(obj.rc)
curl -d "ZOHO_ACTION=ADDROW&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML
        &ZOHO_API_VERSION=1.0&authtoken=f7d016b46be276cdasda32a592f40101&Id=999
        &Name=Gary&Date Of Birth=12-Jun-1980&Salary=10000&Country=USA" 
        https://reportsapi.zoho.com/api/abc@zoho.com/EmployeeDB/EmployeeDetails



Sample Response JSON Format:

{
    "response":
    {
        "url": "/api/abc@zoho.com/EmployeeDB/EmployeeDetails",
        "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/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>

This API allows you to add a single row into a specified table.

URL

https://reportsapi.zoho.com/api/<Email>/<Databasename>/<Tablename>

URL PARAMETERS

Parameter Possible Values Description
ZOHO_ACTION ADDROW 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.
authtoken user authtoken Auth Token is an unique token that authenticates the user to access the Zoho Account.
ZOHO_API_VERSION 1.0 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

URL PARAMETERS (Data for the Row)

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.

Possible Error Codes In ADDROW

7103 , 7138 , 7507 , 7511 , 8016 , 8504 , 8506 , 8516 , 8533


Delete Data

Download client libraries : C# | GO | JAVA | PHP | PYTHON



Sample Request:

using ZReports;

namespace Test
{
    AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
    EMAIL = "user@zoho.com";
    DBNAME = "EmployeeDB";
    TBNAME = "EmployeeTB";

    class Program
    {
        public IReportClient getClient()
        {
            IReportClient RepClient = new ReportClient(AUTHTOKEN);
            return RepClient;
        }

        public void deleteRow(IReportClient RepClient)
        {
            string tableURI = RepClient.GetURI(EMAIL, DBNAME, TBNAME);
            string criteria = "\"Region\"='South'";
            RepClient.DeleteData(tableURI, criteria, null);
        }

        static void Main(string[] args)
        {
            Program obj = new Program();
            IReportClient rc = obj.getClient();
            obj.deleteRow(rc);
        }
    }
}
package main

import (
        "fmt"
        "zoho/pkg/reportclient"

)

var(
        email = "user@zoho.com"
        dbname = "Employee"
        tbname = "sample"
        authtoken = "f7d016b46be276cas21asd2a592f40101"
)

func deletedata() {
        url := reportclient.GetUri(email, dbname, tbname)
        params := map[string]string{}
        params["ZOHO_CRITERIA"] = "Id=2"
        err := reportclient.DeleteData(url, params)
        if(err != nil){
                fmt.Println(err.ErrorMessage)
                fmt.Println(err.ErrorCode)
                fmt.Println(err.Action)
                fmt.Println(err.HttpStatusCode)
        }else{
                fmt.Println("Success")
        }
}

func main() {
        reportclient.SetAuthToken(authtoken)
        deletedata()
}
import com.adventnet.zoho.client.report.*;

public class Sample 
{
    String email = "user@zoho.com";
    String dbname = "EmployeeDB";
    String tbname = "EmployeeTB";
    String authtoken = "f7d016b46be276c22eea32a592f40101";
    Map config = new HashMap();

    private ReportClient rc = new ReportClient(authtoken);

    public void deletedata() throws Exception
    {
        String uri = rc.getURI(email,dbname,tbname);
        rc.deleteData(uri,"id=100",config);
    }

    public static void main(String[] args) throws Exception 
    {
        Sample obj = new Sample();
        obj.deletedata();
    }
}
<?php
    require 'ReportClient.php';

    $EMAIL_ID = "abc@zoho.com";
    $DB_NAME = "EmployeeDB";
    $TABLE_NAME = "EmployeeTB";
    $AUTHTOKEN = "f7d016b46be2763wasda32a592f40101";

    $report_client_request = new ReportClient($AUTHTOKEN); 

    $uri = $report_client_request->getURI($EMAIL_ID, $DB_NAME, $TABLE_NAME);
    $criteria = "Experience = 3";
    $report_client_request->deleteData($uri ,$criteria);
?>
from __future__ import with_statement
from ReportClient import ReportClient
import sys

class Sample:

    LOGINEMAILID="abc@zoho.com"
    AUTHTOKEN="f7d016b46be276ca12fa32a592f40101"
    DATABASENAME="Employee"
    TABLENAME="Employee"
    rc = None
    rc = ReportClient(self.AUTHTOKEN)

    def DeleteData(self,rc):
        uri = rc.getURI(self.LOGINEMAILID,self.DATABASENAME,self.TABLENAME)
        rc.deleteData(uri,"\"Employee Name\"='Sample'",None);

obj = Sample()
obj.DeleteData(obj.rc)
curl -d "ZOHO_ACTION=DELETE&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML
         &ZOHO_API_VERSION=1.0&authtoken=f7d016b46be2acsd4cfa32a592f40101
         &ZOHO_CRITERIA=("Department" = 'Finance')" 
         https://reportsapi.zoho.com/api/abc@zoho.com/EmployeeDB/EmployeeDetails



Sample Response JSON Format:

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

Sample Response XML Format:

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

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

URL

https://reportsapi.zoho.com/api/<Email>/<Databasename>/<Tablename>

URL PARAMETERS

Parameter Possible Values Description
ZOHO_ACTION DELETE 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.
authtoken user authtoken Auth Token is an unique token that authenticates the user to access the Zoho Account.
ZOHO_API_VERSION 1.0 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.

URL PARAMETERS

Parameter Possible Values Description
ZOHO_CRITERIA
(optional)
Criteria 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.

Possible Error Codes In DELETE DATA

7103 , 7138 , 8002 , 8004 , 8504 , 8506 , 8516 , 8533


Update Data

Download client libraries : C# | GO | JAVA | PHP | PYTHON



Sample Request:

using ZReports;

namespace Test
{
    AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
    EMAIL = "user@zoho.com";
    DBNAME = "EmployeeDB";
    TBNAME = "EmployeeTB";

    class Program
    {
        public IReportClient getClient()
        {
            IReportClient RepClient = new ReportClient(AUTHTOKEN);
            return RepClient;
        }

        public void updateRow(IReportClient RepClient)
        {
            string tableURI = RepClient.GetURI(EMAIL, DBNAME, TBNAME);
            Dictionary<string, string> ColumnValues = new Dictionary
                                                <string, string>();
            ColumnValues.Add("Region", "North");
            string criteria = "\"Region\"='South'";
            RepClient.UpdateData(tableURI, ColumnValues, criteria, null);
        }

        static void Main(string[] args)
        {
            Program obj = new Program();
            IReportClient rc = obj.getClient();
            obj.updateRow(rc);
        }
    }
}
package main

import (
        "fmt"
        "zoho/pkg/reportclient"

)

var(
        email = "user@zoho.com"
        dbname = "Employee"
        tbname = "sample"
        authtoken = "f7d016b46be276cas21asd2a592f40101"
)

func updatedata() {
        url := reportclient.GetUri(email, dbname, tbname)
        params := map[string]string{}
        params["Salary"] = "100"
        params["ZOHO_CRITERIA"] = "id=1"
        resultmap , err := reportclient.UpdateData(url, params)
        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)
        updatedata()
}
import com.adventnet.zoho.client.report.*;

public class Sample 
{
    String email = "user@zoho.com";
    String dbname = "EmployeeDB";
    String tbname = "EmployeeTB";
    String authtoken = "f7d016b46be276c22eea32a592f40101";
    Map config = new HashMap();
    Map colval = new HashMap();

    private ReportClient rc = new ReportClient(authtoken);

    public void updatedata() throws Exception
    {
        String uri = rc.getURI(email,dbname,tbname);
        colval.put("Salary", 1000);
        rc.updateData(uri,colval,"Id=101",config);
    }

    public static void main(String[] args) throws Exception 
    {
        Sample obj = new Sample();
        obj.updatedata();
    }
}
<?php
    require 'ReportClient.php';

    $EMAIL_ID = "abc@zoho.com";
    $DB_NAME = "EmployeeDB";
    $TABLE_NAME = "EmployeeTB";
    $AUTHTOKEN = "f7d016b46be2763wasda32a592f40101";

    $report_client_request = new ReportClient($AUTHTOKEN); 

    $uri = $report_client_request->getURI($EMAIL_ID, $DB_NAME, $TABLE_NAME);
    $column_values = array("Salary" => "10000");
    $criteria = "Experience = 2";
    $report_client_request->updateData($uri ,$columnvalues, $criteria);
?>
from __future__ import with_statement
from ReportClient import ReportClient
import sys

class Sample:

    LOGINEMAILID="abc@zoho.com"
    AUTHTOKEN="f7d016b46be276ca12fa32a592f40101"
    DATABASENAME="Employee"
    TABLENAME="Employee"
    rc = None
    rc = ReportClient(self.AUTHTOKEN)

    def updateData(self,rc):
        uri = rc.getURI(self.LOGINEMAILID,self.DATABASENAME,self.TABLENAME)
        updateInfo = {"Region":"West","Product":"SampleProduct_2"}
        rc.updateData(uri,updateInfo,"\"Customer Name\"='Sample'",None);

obj = Sample()
obj.updateData(obj.rc)
curl -d "ZOHO_ACTION=UPDATE&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML
         &ZOHO_API_VERSION=1.0&authtoken=f7d016b46bedswcd4cfa32a592f40101&Name=as
         &ZOHO_CRITERIA=("Department" = 'Finance')" 
         https://reportsapi.zoho.com/api/abc@zoho.com/EmployeeDB/EmployeeDetails



Sample Response JSON Format:

{
    "response":
    {
        "uri": "/api/abc@zoho.com/EmployeeDB/EmployeeDetails",
        "action": "UPDATE",
        "criteria": "\"Department\" = 'Finance'",
        "result":
        {
            "updatedColumns":["Salary","Deduction","Perks"],
            "updatedRows":"4"
        }
    }
}

Sample Response XML Format:

<?xml version="1.0" encoding="UTF-8" ?>
<response uri="/api/abc@zoho.com/EmployeeDB/EmployeeDetails" action="UPDATE">
    <criteria>&quot;Department&quot; = &apos;Finance&apos;</criteria>
    <result>
        <updatedColumns>
            <column>Salary</column>
            <column>Deduction</column>
            <column>Perks</column>
        </updatedColumns>
        <updatedRows>4</updatedRows>
    </result>
</response>

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

URL

https://reportsapi.zoho.com/api/<Email>/<Databasename>/<Tablename>

URL PARAMETERS

Parameter Possible Values Description
ZOHO_ACTION UPDATE 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.
authtoken user authtoken Auth Token is an unique token that authenticates the user to access the Zoho Account.
ZOHO_API_VERSION 1.0 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.

URL PARAMETERS

Parameter Possible Values Description
ZOHO_CRITERIA
(optional)
Criteria 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.

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.

Possible Error Codes In UPDATE DATA

7103 , 7138 , 7507 , 8002 , 8004 , 8016 , 8504 , 8506 , 8516 , 8533


Import Data

Download client libraries : C# | GO | JAVA | PHP | PYTHON



Sample Request:

using ZReports;

namespace Test
{
    AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
    EMAIL = "user@zoho.com";
    DBNAME = "EmployeeDB";
    TBNAME = "EmployeeTB";

    class Program
    {
        public IReportClient getClient()
        {
            IReportClient RepClient = new ReportClient(AUTHTOKEN);
            return RepClient;
        }

        public void importData(IReportClient RepClient)
        {
            string tableURI = RepClient.GetURI(EMAIL, DBNAME, TBNAME);
            Dictionary<string, string> ImportConfig = new Dictionary
                                                 <string, string>();
            ImportConfig.Add("ZOHO_ON_IMPORT_ERROR", "ABORT");
            ImportConfig.Add("ZOHO_CREATE_TABLE", "TRUE");
            ImportConfig.Add("ZOHO_AUTO_IDENTIFY", "TRUE");
            Dictionary<string, string> ImportRes = RepClient.ImportData(
                 tableURI, ZohoReportsConstants.APPEND, "C:\\workspace\\mydata.csv", ImportConfig);
        }

        static void Main(string[] args)
        {
            Program obj = new Program();
            IReportClient rc = obj.getClient();
            obj.importData(rc);
        }
    }
}
package main

import (
        "fmt"
        "zoho/pkg/reportclient"

)

var(
        email = "user@zoho.com"
        dbname = "Employee"
        tbname = "sample"
        authtoken = "f7d016b46be276cas21asd2a592f40101"
)

func importdata() {
        url := reportclient.GetUri(email, dbname, tbname)
        params := map[string]string{}
        file := "/home/sample.csv"
        importtype := "APPEND"
        autoidentity := "true"
        onerror := "ABORT"
        resp , err := reportclient.ImportData(url, file, importtype, 
                              autoidentity, onerror, params)
        if(err != nil){
                fmt.Println(err.ErrorMessage)
                fmt.Println(err.ErrorCode)
                fmt.Println(err.Action)
                fmt.Println(err.HttpStatusCode)
        }else{
                fmt.Println(resp.ImportErrors)
                fmt.Println(resp.ColumnDetails)
                fmt.Println(resp.ImportType)
                fmt.Println(resp.Warnings)
                fmt.Println(resp.SelectedColumnCount)
                fmt.Println(resp.SuccessRowCount)
                fmt.Println(resp.ImportOperation)
                fmt.Println(resp.TotalColumnCount)
                fmt.Println(resp.TotalRowCount)
        }
}

func main() {
        reportclient.SetAuthToken(authtoken)
        importdata()
}
import com.adventnet.zoho.client.report.*;

public class Sample 
{
    String email = "user@zoho.com";
    String dbname = "EmployeeDB";
    String tbname = "EmployeeTB";
    String authtoken = "f7d016b46be276c22eea32a592f40101";
    Map config = new HashMap();
    File csvFile = new File("samples/StoreSales.csv");

    private ReportClient rc = new ReportClient(authtoken);

    public void importdata() throws Exception
    {
        String uri = rc.getURI(email,dbname,tbname);
        config.put("ZOHO_AUTO_IDENTIFY","true");
        config.put("ZOHO_ON_IMPORT_ERROR","ABORT");
        config.put("ZOHO_CREATE_TABLE","false");
        Object result = rc.importData(uri,"APPEND",csvFile,config,false);
    }

    public static void main(String[] args) throws Exception 
    {
        Sample obj = new Sample();
        obj.importdata();
    }
}
<?php
    require 'ReportClient.php';

    $EMAIL_ID = "abc@zoho.com";
    $DB_NAME = "EmployeeDB";
    $TABLE_NAME = "EmployeeTB";
    $AUTHTOKEN = "f7d016b46be2763wasda32a592f40101";

    $report_client_request = new ReportClient($AUTHTOKEN); 

    $uri = $report_client_request->getURI($EMAIL_ID, $DB_NAME, $TABLE_NAME);
    $import_type = "APPEND";
    $file = $_FILES['file'];
    $auto_identify = "TRUE";
    $on_error = "ABORT";
    $response_obj = $report_client->importData($table_uri, $import_type, $file, 
                        $auto_identify, $on_error);
?>
from __future__ import with_statement
from ReportClient import ReportClient
import sys

class Sample:

    LOGINEMAILID="abc@zoho.com"
    AUTHTOKEN="f7d016b46be276ca12fa32a592f40101"
    DATABASENAME="Employee"
    TABLENAME="Employee"
    rc = None
    rc = ReportClient(self.AUTHTOKEN)

    def importData(self,rc):
        uri = rc.getURI(self.LOGINEMAILID,self.DATABASENAME,self.TABLENAME)
        try:
            with open('StoreSales.csv', 'r') as f:
            importContent = f.read()
        except Exception,e:
            print "Error Check if file StoreSales.csv exists in 
                                        the current directory"
            print "(" + str(e) + ")"
            return
        impResult = rc.importData(uri,"APPEND",importContent,None)
        print "Added Rows :" +str(impResult.successRowCount) + " and Columns :" 
                    + str(impResult.selectedColCount)

obj = Sample()
obj.importData(obj.rc)
curl -XPOST -H "Content-type: multipart/form-data" 
     -d 'ZOHO_ACTION=IMPORT&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML
     &ZOHO_API_VERSION=1.0&authtoken=f7d016b46be276c3w24a32a592f40101
     &ZOHO_IMPORT_TYPE=APPEND&ZOHO_AUTO_IDENTIFY=TRUE&ZOHO_ON_IMPORT_ERROR=ABORT
     &ZOHO_FILE=sample.csv' 
     https://reportsapi.zoho.com/api/abc@zoho.com/sample/Employee


Sample Response JSON Format:

{
    " response":
    {
        "uri": "/api/abc@zoho.com/EmployeeDB/EmployeeDetails",
        "action": "IMPORT",
        "result":
        {
            "importSummary":
            {
                "totalColumnCount":3,
                "selectedColumnCount":3,
                "totalRowCount":50,
                "successRowCount":48,
                "warnings":0,
                "importOperation": "created",
                "importType": "APPEND"
            },
            "columnDetails":
            {
                "Name": "Plain Text",
                "Date Of Birth": "Date",
                "Salary": "Number"
            },
            "importErrors": "[Line: 5 Field: 3] a1213 -WARNING: Invalid 
             Number value"
        }
    }   
}

Sample Response XML Format:

<?xml version="1.0" encoding="UTF-8" ?>
<response uri="/api/abc@zoho.com/EmployeeDB/EmployeeDetails" action="IMPORT">
    <result>
        <importSummary>
            <totalColumnCount>3 </totalColumnCount>
            <selectedColumnCount>3</selectedColumnCount>
            <totalRowCount>50</totalRowCount>
            <successRowCount>48</successRowCount>
            <warnings>0</warnings>
            <importOperation>created</importOperation>
            <importType>APPEND</importType>
        </importSummary>    
        <columnDetails>
            <column datatype="Plain Text">Name </column>
            <column datatype="Date">Date Of Birth</column>
            <column datatype="Number">Salary</column>
        </columnDetails>
        <!-- The first 100 errors are alone sent -->
        <importErrors>
            [Line: 5 Field: 3] a1213 -WARNING: Invalid Number value
        </importErrors>
    </result>
</response>

With the Zoho Reports API, you can add/update data in bulk. The data to be added/updated should be in CSV or JSON file formats.

URL

https://reportsapi.zoho.com/api/<Email>/<Databasename>/<Tablename>

URL PARAMETERS

Parameter Possible Values Description
ZOHO_ACTION IMPORT 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.
authtoken user authtoken Auth Token is an unique token that authenticates the user to access the Zoho Account.
ZOHO_API_VERSION 1.0 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.

URL PARAMETERS

Parameter Possible Values Description
ZOHO_CRITERIA
(optional)
Criteria 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.
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 errored column for the row to empty and continue importing.
  • ZOHO_CREATE_TABLE
    (optional)
    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 database.
  • In case its false, no table is created even if the table refered in the URL does not exists in the database.
  • ZOHO_SELECTED_COLUMNS
    (optional)
    List of comma separated column names.
    E.g.,: Name, Department
    Specify the columns to be imported into the Zoho Reports table from the data being uploaded.
    Note: Incase of JSON files you need to specify the column names capturing the full JSON tree heirrachy 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 comparision 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 incase any date field is being imported and its format cannot be auto recognized by Zoho Reports.
    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
  • 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

    Possible Error Codes In IMPORT DATA

    7103 , 7138 , 8002 , 8004 , 8504 , 8506 , 8516 , 8533


    Export Data

    Download client libraries : C# | GO | JAVA | PHP | PYTHON



    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zoho.com";
        DBNAME = "EmployeeDB";
        TBNAME = "EmployeeTB";
    
        class Program
        {
            public IReportClient getClient()
            {
                IReportClient RepClient = new ReportClient(AUTHTOKEN);
                return RepClient;
            }
    
            public object export(IReportClient RepClient)
            {
                string tableURI = RepClient.GetURI(EMAIL, DBNAME, TBNAME);
                Dictionary<string, object> resObj = RepClient.
                                ExportDataAsDictionary(tableURI, "\"Region\"
                                ='West'", null);
                Object[] columns = (Object[])resObj["column_order"];
                Object[] rows = (Object[])resObj["rows"];
            }
    
            static void Main(string[] args)
            {
                Program obj = new Program();
                IReportClient rc = obj.getClient();
                obj.export(rc);
            }
        }
    }
    
    package main
    
    import (
            "fmt"
            "zoho/pkg/reportclient"
    
    )
    
    var(
            email = "user@zoho.com"
            dbname = "Employee"
            tbname = "sample"
            authtoken = "f7d016b46be276cas21asd2a592f40101"
    )
    
    func exportdata() {
            url := reportclient.GetUri(email, dbname, tbname)
            outputformat := "pdf"
            filename := "sample"
            params := map[string]string{}
            err := reportclient.ExportData(url, filename, outputformat, params)
            if(err != nil){
                    fmt.Println(err.ErrorMessage)
                    fmt.Println(err.ErrorCode)
                    fmt.Println(err.Action)
                    fmt.Println(err.HttpStatusCode)
            }else{
                    fmt.Println("Success")
            }
    }
    
    func main() {
            reportclient.SetAuthToken(authtoken)
            exportdata()
    }
    
    import com.adventnet.zoho.client.report.*;
    
    public class Sample 
    {
        String email = "user@zoho.com";
        String dbname = "EmployeeDB";
        String tbname = "EmployeeTB";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        File csvFile = new File("samples/StoreSales.csv");
    
        private ReportClient rc = new ReportClient(authtoken);
    
        public void exportdata() throws Exception
        {
            String uri = rc.getURI(email,dbname,tbname);
            rc.exportData(uri,"CSV",csvFile,null,null);
        }
    
        public static void main(String[] args) throws Exception 
        {
            Sample obj = new Sample();
            obj.exportdata();
        }
    }
    
    <?php
        require 'ReportClient.php';
    
        $EMAIL_ID = "abc@zoho.com";
        $DB_NAME = "EmployeeDB";
        $TABLE_NAME = "EmployeeTB";
        $AUTHTOKEN = "f7d016b46be2763wasda32a592f40101";
    
        $report_client_request = new ReportClient($AUTHTOKEN); 
    
        $uri = $report_client_request->getURI($EMAIL_ID, $DB_NAME, $TABLE_NAME);
        $output_format = "CSV";
        $criteria = "Salary = 5000";
        $report_client_response = $report_client_request->exportData($uri, 
                                        $output_format);
        $file = "dummy/".$TABLE_NAME.".".$output_format;
        file_put_contents($file, $report_client_response, FILE_APPEND);
    ?>
    
    from __future__ import with_statement
    from ReportClient import ReportClient
    import sys
    
    class Sample:
    
        LOGINEMAILID="abc@zoho.com"
        AUTHTOKEN="f7d016b46be276ca12fa32a592f40101"
        DATABASENAME="Employee"
        TABLENAME="Employee"
        rc = None
        rc = ReportClient(self.AUTHTOKEN)
    
        def exportdata(self,rc):
            uri = rc.getURI(self.LOGINEMAILID,self.DATABASENAME,self.TABLENAME)
            fileobj = open("/home/sample.csv","rw+")
            rc.exportData(uri,"CSV",fileobj)
            fileobj.close()
    
    obj = Sample()
    obj.exportdata(obj.rc)
    
    curl -d "ZOHO_ACTION=EXPORT&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML
             &ZOHO_API_VERSION=1.0&authtoken=f7d016b46be276cd4cfaq2a592f40101" 
             https://reportsapi.zoho.com/api/abc@zoho.com/EmployeeDB/EmployeeDetails
    
    
    

    Sample Response JSON Format:

    { 
        "response":
        {
            "uri": "/api/abc@zoho.com/EmployeeDB/EmployeeDetails",
            "action": "EXPORT",
            "result":
            {
                "column_order":["Name","Department","Date Of Birth"],
                "rows":
                [
                    ["John","Finance","12 May 1972"],
                    ["Joan","Admin","15 June 1975"]
                ]
            }
        }
    }
    
    

    Sample Response XML Format:

    <?xml version="1.0" encoding="UTF-8" ?>
    <response uri="/api/abc@zoho.com/EmployeeDB/EmployeeDetails" action="EXPORT">
        <result>
            <rows>
                <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>
                <row>
                    <column name="Name">John</column>
                    <column name="Date Of Birth">12-Jun-1981</column>
                    <column name="Basic">10000</column>
                    <column name="Country">Canada</column>
                </row>
                <row>
                    <column name="Name">Joan</column>
                    <column name="Date Of Birth">12-Jun-1982</column>
                    <column name="Basic">10000</column>
                    <column name="Country">Mexico</column>
                </row>
            </rows>
        </result>
    </response>
    

    Using this API users can export/pull data from tables or reports (pivots, charts etc.,) in different formats.

    URL

    https://reportsapi.zoho.com/api/<Email>/<Databasename>/<Tablename>

    URL PARAMETERS

    Parameter Possible Values Description
    ZOHO_ACTION EXPORT 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.
    authtoken user authtoken Auth Token is an unique token that authenticates the user to access the Zoho Account.
    ZOHO_API_VERSION 1.0 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.

    URL PARAMETERS

    Parameter Possible Values Description
    ZOHO_CRITERIA
    (optional)
    Criteria 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.

    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 - EUROPEAN
    2 - CHINESE
    3 - JAPANESE
    4 - KOREAN
    Default - ENGLISH
    PDF will be rendered using the specified language
    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.
    Margin Settings:
    ZOHO_TOPMARGIN
    ZOHO_BOTTOMMARGIN
    ZOHO_LEFTMARGIN
    ZOHO_RIGHTMARGIN
    Decimal values between 0 to 1 The margin in inches for that edge. Can be decimal between 0 to 1 (like 0.5).
    Header/Footer Settings:
    ZOHO_HEAD_LEFT
    ZOHO_HEAD_RIGHT
    ZOHO_HEAD_CENTER
    ZOHO_FOOT_LEFT
    ZOHO_FOOT_RIGHT
    ZOHO_FOOT_CENTER
    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.
    Custom Header/Footer value
    ZOHO_HEAD_LEFT
    ZOHO_HEAD_RIGHT
    ZOHO_HEAD_CENTER
    ZOHO_FOOT_LEFT
    ZOHO_FOOT_RIGHT
    ZOHO_FOOT_CENTER
    Custom text. 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_SHOWLEGEND 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_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

    Example: JSON callback.

    1.Define the callback function.

    <script>
    function sampleFunction(resp)
    {
        var response = resp.response;
        var result = response.result;
        var rows = result.rows;
        for(i=0;i<rows.length;i++)
        {
            var row = rows[i];
            console.log(row);
            // your application code
        }
        // your application code
    }
    </script>
    
    

    2.Invoke the api request with output format as JSON and ZOHO_CALLBACK_FUNCTION=sampleFunction.

    <script src="
    https://reportsapi.zoho.com/api/<loginemailaddress>/<DB>/<Table>
    ?ZOHO_ACTION=EXPORT&ZOHO_OUTPUT_FORMAT=JSON&ZOHO_ERROR_FORMAT=XML&authtoken=
    <your auth token>&ZOHO_API_VERSION=1.0&ZOHO_CALLBACK_FUNCTION=sampleFunction">
    </script>
    

    When the page is loaded, the response will be returned as,

    { 
        "response":
        {
            "uri": "/api/abc@zoho.com/EmployeeDB/EmployeeDetails",
            "action": "EXPORT",
            "result":
            {
                "column_order":["Name","Department","Date Of Birth"],
                "rows":
                [
                    ["John","Finance","12 May 1972"],
                    ["Joan","Admin","15 June 1975"]
                ]
            }
        }
    }
    
    

    JSON Callbacks - JSONP:

    Zoho Reports API supports Callback function for handling API responses asynchronously. This is supported in Export API calls, when the output format is chosen as JSON.

    The Export API method call, with JSON output format, supports an additional parameter called ZOHO_CALLBACK_FUNCTION to enable callback. Using the Callback function, developers can invoke the Export API request inside the <script> tag and process the JSON response using the CALLBACK function elsewhere in the JavaScript code on the page.

    Export Using SQL:

    Zoho Reports has implemented the Zoho CloudSQL technology as an extension to its HTTP Web API. Using the Zoho Reports HTTP API, users can query the database by providing SQL queries.

    Refer to the documentation on Zoho Reports CloudSQL for more details on how to use SQL SELECT query to fetch data from Zoho Reports.

    Possible Error Codes In EXPORT DATA

    7103 , 7138 , 8002 , 8004 , 8504 , 8506 , 8516 , 8533


    Applying Filter Criteria

    Example

    
    (( "Department"='Finance' and "Salary" < 9000) or ("Department"='Admin'
    and "Salary" < 8000))

    Sample

    
    A sample delete request that deletes all the rows that match 
    the criteria "s2">"Department"='Finance'
    is given below.
    
    

    URL:

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

    Data Sent as POST parameters.

    
    ZOHO_CRITERIA=("Department"='Finance')
    
    ZOHO_CRITERIA is encoded for the url format. Unencoded value is provided below.
    ZOHO_CRITERIA=("Department"='Finance') 
    

    Zoho Reports 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:

    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>)

    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 subracts 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:

    Refer to the SQL SELECT WHERE clause documentation of any database that we support, to know more on how to construct the filter criteria.


    Error codes in Data API

    Sample error XML format:

    
    <response uri="/api/abc@zoho.com/Employee" action="ADDROW">
        <error> 
            <code>7103</code>
            <message>
            Database not found! Please check whether the database exists
            </message>
        </error>
    </response>
    
    

    Sample error JSON format:

    {
        "response": 
        {
            "uri": "\/api\/abc@zoho.com\/Employee",
            "action": "ADDROW",
            "error": 
            {
            "code":7103,
            "message": "Database not found! Please check whether 
                                   the database exists"
            } 
        }
    }
    

    This section lists all possible error response codes that could be sent from the Zoho Reports server on failure of Data APIs. You can use this for appropriate error handling.

    Error Codes

    Error-Code Reason Solution
    7103 The Database Name mentioned in the API URL does not exist. Check the database name in the request URL and provide a valid database 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.
    7507 Value entered in the mentioned column does not follow the specified datatype. Check the value of that column and provide value in the specified datatype.
    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 atleast one column for INSERT or UPDATE action. You should provide atleast 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@zohoreports.com. Zoho Reports 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 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.


    Copy Database

    Download client libraries : C# | GO | JAVA | PHP | PYTHON



    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zoho.com";
        DBNAME = "EmployeeDB";
    
        class Program
        {
            public IReportClient getClient()
            {
                IReportClient RepClient = new ReportClient(AUTHTOKEN);
                return RepClient;
            }
    
            public void copyDatabase(IReportClient RepClient)
            {
                string dbURI = RepClient.GetURI(EMAIL, DBNAME);
                string newDBName = "newdbname"; 
                string newDBDesc = "dbdesc";
                bool withData = true;
                string copyDBKey = "asd8272e9sadaczx0cqqd321as"
                long dbid = RepClient.CopyDatabase(dbURI, newDBName, newDBDesc, 
                            withData, copyDBKey, null);
            }
    
            static void Main(string[] args)
            {
                Program obj = new Program();
                IReportClient rc = obj.getClient();
                obj.copyDatabase(rc);
            }
        }
    }
    
    package main
    
    import (
            "fmt"
            "zoho/pkg/reportclient"
    
    )
    
    var(
            email = "user@zoho.com"
            dbname = "Employee"
            authtoken = "f7d016b46be276cas21asd2a592f40101"
            dbkey = "d6e443b4dc3cas421fcc54ff81cd3ad3"
    )
    
    func copydatabase() {
            url := reportclient.GetDbUri(email, dbname)
            newdbname := "Sample"
            params := map[string]string{}
            newid , err := reportclient.CopyDatabase(url, newdbname, dbkey, params)
            if(err != nil){
                    fmt.Println(err.ErrorMessage)
                    fmt.Println(err.ErrorCode)
                    fmt.Println(err.Action)
                    fmt.Println(err.HttpStatusCode)
            }else{
                    fmt.Println(newid)
            }
    }
    
    func main() {
            reportclient.SetAuthToken(authtoken)
            copydatabase()
    }
    
    import com.adventnet.zoho.client.report.*;
    
    public class Sample 
    {
        String email = "user@zoho.com";
        String dbname = "EmployeeDB";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
    
        public void copydatabase() throws Exception
        {
            String uri = rc.getURI(email,dbname);
            config.put("ZOHO_DATABASE_NAME", "database");
            config.put("ZOHO_COPY_DB_KEY", "d6e443b4dc3c85d51fcc54ff81cd3ad3");
            long result = rc.copyDatabase(uri,config);
            System.out.println(result);
        }
    
        public static void main(String[] args) throws Exception 
        {
            Sample obj = new Sample();
            obj.copydatabase();
        }
    }
    
    <?php
        require 'ReportClient.php';
    
        $EMAIL_ID = "abc@zoho.com";
        $DB_NAME = "EmployeeDB";
        $AUTHTOKEN = "f7d016b46be2763wasda32a592f40101";
    
        $report_client_request = new ReportClient($AUTHTOKEN); 
    
        $uri = $report_client_request->getDbURI($EMAIL_ID, $DB_NAME);
        $db_key = "d6e443b4dc3c85d5q34casdff81cd3ad3 ";
        $db_name = "EmployeeDB";
        $new_database_id = $report_client_request->copyDatabase($uri, $db_key, 
                                                   $db_name);
    ?>
    
    from __future__ import with_statement
    from ReportClient import ReportClient
    import sys
    
    class Sample:
    
        LOGINEMAILID="abc@zoho.com"
        AUTHTOKEN="f7d016b46be276ca12fa32a592f40101"
        DATABASENAME="Employee"
        rc = None
        rc = ReportClient(self.AUTHTOKEN)
    
        def CopyDatabase(self,rc):
            uri = rc.getDBURI(self.LOGINEMAILID,self.DATABASENAME)
            config = {"ZOHO_DATABASE_NAME":"new sales",
                          "ZOHO_COPY_DB_KEY":"d6e443b4dc3c85d51f5d3d3f81cd3ad3"}
            result = rc.copyDatabase(uri,config)
    
    obj = Sample()
    obj.CopyDatabase(obj.rc)
    
    curl -d "ZOHO_ACTION=COPYDATABASE&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML
             &ZOHO_API_VERSION=1.0&authtoken=f7d016b46be2ewcd4cfa32a592f40101
             &ZOHO_DATABASE_NAME=New database&ZOHO_COPY_DB_KEY=
             d6e443b4dc3c85d51fefrd3f81cd3ad3" 
             https://reportsapi.zoho.com/api/abc@zoho.com/Employee
    
    
    

    Sample Response XML Format:

    <response uri="/api/abc@zoho.com/Employee" action="COPYDATABASE">
        <result>
            <message>
            Successfully Database Copied
            </message>
            <dbid>
            100000000000889
            </dbid>
        </result>
    </response>
    
    

    Sample Response JSON Format:

    {
        "response": 
        {
            "uri": "\/api\/abc@zoho.com/Employee",
            "action": "COPYDATABASE",
            "result": 
            {
                "message": "Successfully Database Copied",
                "dbid": "10000000000889"
            } 
        }
    }
    
    

    The Copy Database API is used to copy the database from one Zoho Reports Account to another Zoho Reports Account.

    URL

    https://reportsapi.zoho.com/api/<Email>/<Databasename>

    URL PARAMETERS

    Parameter Name Possible Values Description
    ZOHO_ACTION COPYDATABASE 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.
    authtoken user authtoken Auth Token is an unique token that authenticates the user to access the Zoho Account.
    ZOHO_API_VERSION 1.0 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.

    URL PARAMETERS

    Parameter Name Possible Values Description
    ZOHO_DATABASE_NAME
    (mandatory)
    <databasename> This parameter holds the name of the destination database
    ZOHO_DATABASE_DESC
    (optional)
    <database description> This parameter holds the description of the destination database
    ZOHO_COPY_WITHDATA
    (optional)
    true/false
  • true - The data present in all tables of source database will be copied into destination database.
  • false - The data present in all tables of source database will not be copied into destination database
  • ZOHO_COPY_DB_KEY
    (mandatory)
    <databasekey> The secret key used for allowing the user to copy the database / reports.
    The source database owner has to invoke the below URL to get the Copy Database Secret Key.
    https://reportsapi.zoho.com/api/abcd@zoho.com/SourceEmployeeDB?ZOHO_ACTION=GETCOPYDBKEY&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML&authtoken=<source_db_owner_authtoken>&ZOHO_API_VERSION=1.0 .
    For more about database key.
    Note: You need to provide the appropriate values in the above URL to generate the corresponding Copy Database Key for your setup.

    Possible Error Codes In COPY DATABASE

    7101 , 7103 , 7138 , 8024 , 8504 , 8506 , 8516 , 8533 , 15007


    Delete Database

    Download client libraries : C# | GO | JAVA | PHP | PYTHON



    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zoho.com";
    
        class Program
        {
            public IReportClient getClient()
            {
                IReportClient RepClient = new ReportClient(AUTHTOKEN);
                return RepClient;
            }
    
            public void deleteDatabase(IReportClient RepClient)
            {
                string userURI = RepClient.GetURI(EMAIL);
                string databaseName = "databaseName";
                RepClient.DeleteDatabase(userURI, databaseName, null);
            }
    
            static void Main(string[] args)
            {
                Program obj = new Program();
                IReportClient rc = obj.getClient();
                obj.deleteDatabase(rc);
            }
        }
    }
    
    package main
    
    import (
            "fmt"
            "zoho/pkg/reportclient"
    
    )
    
    var(
            email = "user@zoho.com"
            authtoken = "f7d016b46be276cas21asd2a592f40101"
    )
    
    func deletedatabase() {
            url := reportclient.GetUserUri(email)
            dbname := "sample"
            err := reportclient.DeleteDatabase(url, dbname)
            if(err != nil){
                    fmt.Println(err.ErrorMessage)
                    fmt.Println(err.ErrorCode)
                    fmt.Println(err.Action)
                    fmt.Println(err.HttpStatusCode)
            }else{
                    fmt.Println("Success")
            }
    }
    
    func main() {
            reportclient.SetAuthToken(authtoken)
            deletedatabase()
    }
    
    import com.adventnet.zoho.client.report.*;
    
    public class Sample 
    {
        String email = "user@zoho.com";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
    
        public void deletedatabase() throws Exception
        {
            String uri = rc.getURI(email);
            rc.deleteDatabase(uri,"database",config);
        }
    
        public static void main(String[] args) throws Exception 
        {
            Sample obj = new Sample();
            obj.deletedatabase();
        }
    }
    
    <?php
        require 'ReportClient.php';
    
        $EMAIL_ID = "abc@zoho.com";
        $AUTHTOKEN = "f7d016b46be2763wasda32a592f40101";
    
        $report_client_request = new ReportClient($AUTHTOKEN); 
    
        $uri = $report_client_request->getUserURI($EMAIL_ID);
        $db_name = "EmployeeDB";
        $report_client_request->deleteDatabase($uri, $db_name);
    ?>
    
    from __future__ import with_statement
    from ReportClient import ReportClient
    import sys
    
    class Sample:
    
        LOGINEMAILID="abc@zoho.com"
        AUTHTOKEN="f7d016b46be276ca12fa32a592f40101"
        rc = None
        rc = ReportClient(self.AUTHTOKEN)
    
        def DeleteDatabase(self,rc):
            uri = rc.getUserURI(self.LOGINEMAILID)
            databaseName = "databaseName"
            rc.deleteDatabase(uri,databaseName)
    
    obj = Sample()
    obj.DeleteDatabase(obj.rc)
    
    curl -d "ZOHO_ACTION=DELETEDATABASE&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML
             &ZOHO_API_VERSION=1.0&authtoken=f7d016b46be276cd4cfaswa592f40101
             &ZOHO_DATABASE_NAME=NEW" 
             https://reportsapi.zoho.com/api/abc@zoho.com
    
    

    Sample Response XML Format:

    <response uri="/api/abc@zoho.com" action="DELETEDATABASE">
        <result>
            <message>
            Database deleted successfully
            </message>
        </result>
    </response>
    
    
    

    Sample Response JSON Format:

    {
        "response": 
        {
            "uri": "\/api\/abc@zoho.com",
            "action": "DELETEDATABASE",
            "result": 
            {
                "message": "Database deleted successfully"
            } 
        }
    }
    
    

    The Delete Database API is used to delete the database from your Zoho Reports Account. This API will delete the database present in the user account who is invoking this API, and not the database from other accounts. Please note that if a database is deleted using this API, the same database cannot be restored back.

    URL

    https://reportsapi.zoho.com/api/<Email>

    URL PARAMETERS

    Parameter Name Possible Values Description
    ZOHO_ACTION DELETEDATABASE 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.
    authtoken user authtoken Auth Token is an unique token that authenticates the user to access the Zoho Account.
    ZOHO_API_VERSION 1.0 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.

    URL PARAMETERS

    Parameter Name Possible Values Description
    ZOHO_DATABASE_NAME
    (mandatory)
    Database name This parameter holds the name of the database to be deleted

    Possible Error Codes In DELETE DATABASE

    7103 , 7138 , 7165 , 8504 , 8506 , 8516 , 8533


    Enable Doamin Database (Only for White Label customers)

    Download client libraries : C# | GO | JAVA | PHP | PYTHON



    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zoho.com";
    
        class Program
        {
            public IReportClient getClient()
            {
                IReportClient RepClient = new ReportClient(AUTHTOKEN);
                return RepClient;
            }
    
            public void enabledomaindb(IReportClient rc)
            {
                try
                {
                    string uri = rc.GetURI(EMAIL);
                    string dbname = "Dataabse";
                    string domainname = "reports.customdomain.com";
                    var result = rc.EnableDomainDB(uri, dbname, domainname, null);
                    foreach (KeyValuePair<string, string> kvp in result)
                    {
                        Console.WriteLine(kvp.Key + " = " + kvp.Value);
                    }
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                }
            }
    
            static void Main(string[] args)
            {
                Program obj = new Program();
                IReportClient rc = obj.getClient();
                obj.enabledomaindb(rc);
            }
        }
    }
    
    package main
    
    import (
            "fmt"
            "zoho/pkg/reportclient"
    
    )
    
    var(
            email = "user@zohocorp.com"
            authtoken = "f7d016b46be276cas21asd2a592f40101"
    )
    
    func EnableDomainDB(){
            url := reportclient.GetUserUri(email)
            dbname := "Base dataabse"
            domainname := "reports.customdomain.com"
            params := map[string]string{}
            result , err := reportclient.EnableDomainDB(url, dbname, domainname, params)
            if(err != nil){
            fmt.Println(err.ErrorMessage)
            fmt.Println(err.ErrorCode)
            fmt.Println(err.Action)
            fmt.Println(err.HttpStatusCode)
            }else{
            fmt.Println(result)
            }
    }
    
    func main() {
            reportclient.SetAuthToken(authtoken)
            EnableDomainDB()
    }
    
    import com.adventnet.zoho.client.report.*;
    
    public class Sample 
    {
        String email = "user@zoho.com";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
    
        public void enableDomainDB() throws Exception
        {
            String uri = rc.getURI(email);
            String dbName = "database";
            String domainName = "reports.customdomain.com";
            Map result = rc.enableDomainDB(uri, dbName, domainName, null);
        }
    
        public static void main(String[] args) throws Exception 
        {
            Sample obj = new Sample();
            obj.enableDomainDB();
        }
    }
    
    <?php
    
        require 'ReportClient.php';
    
        $EMAIL_ID = "abc@zoho.com";
        $AUTHTOKEN = "05740fccskfi453285db0e8b2a09f6f8";    
        $request = new ReportClient($AUTHTOKEN);
        $uri = $request->getUserURI($EMAIL_ID);
        $dbname = "Database";
        $domain_name = "reports.customdomain.com";
        $response = $request->enableDomainDB($uri, $dbname, $domain_name);
    ?>
    
    from __future__ import with_statement
    from ReportClient import ReportClient
    import sys
    
    class Sample:
    
        LOGINEMAILID="abc@zohocorp.com"
        AUTHTOKEN="f7d016b46be276ca12fa32a592f40101"
        rc = None
        rc = ReportClient(self.AUTHTOKEN)
    
        def enableDomainDB(self,rc):
        uri = rc.getURI(self.LOGINEMAILID)
        dbName = "Database"
        domainName = "reports.customdomain.com"
        result = rc.enableDomainDB(uri,dbName,domainName)
    
    obj = Sample()
    obj.enableDomainDB(obj.rc)
    
    curl -d "ZOHO_ACTION=ENABLEDOMAINDB&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML
             &ZOHO_API_VERSION=1.0&authtoken=f7d016b46be276cd4cfaswa592f40101
             &DBNAME=NEW&DOMAINNAME=reports.customdomain.com" 
             https://reportsapi.zoho.com/api/abc@zoho.com
    
    

    Sample Response XML Format:

    <response uri="/api/abc@zoho.com" action="ENABLEDOMAINDB">
        <result>
            <status>Success</status>
            <message>Domain Feature has been enabled</message>
        </result>
    </response>
    
    

    Sample Response JSON Format:

    {
        "response": 
        {
            "uri": "\/api\/abc@zoho.com",
            "action": "ENABLEDOMAINDB",
            "result":
            {
                "status":"Success",
                "message":"Domain Feature has been enabled"
            } 
        }
    }
    
    

    The Enable Database API is used to enable the database from your Zoho Reports Account to White label account (custom domain).

    URL

    https://reportsapi.zoho.com/api/<Email>

    URL GET parameters

    Parameter Name Possible Values Description
    ZOHO_ACTION ENABLEDOMAINDB 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.
    authtoken user authtoken Auth Token is an unique token that authenticates the user to access the Zoho Account.
    ZOHO_API_VERSION 1.0 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.

    URL POST parameters

    Parameter Name Possible Values Description
    DBNAME
    (mandatory)
    Database name This parameter holds the name of the database to be enabled.
    DOMAINNAME
    (mandatory)
    Domain name This parameter holds the domain address.

    Possible Error Codes In ENABLE DOMAIN DATABASE

    7103 , 7138 , 8023 , 8025 , 8504 , 8506 , 8516 , 8533


    Disable Domain Database (Only for White Label customers)

    Download client libraries : C# | GO | JAVA | PHP | PYTHON



    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zoho.com";
    
        class Program
        {
            public IReportClient getClient()
            {
                IReportClient RepClient = new ReportClient(AUTHTOKEN);
                return RepClient;
            }
    
            public void disabledomaindb(IReportClient rc)
            {
                try
                {
                    string uri = rc.GetURI(EMAIL);
                    string dbname = "Dataabse";
                    string domainname = "reports.customdomain.com";
                    var result = rc.DisableDomainDB(uri, dbname, domainname, null);
                    foreach (KeyValuePair<string, string> kvp in result)
                    {
                        Console.WriteLine(kvp.Key + " = " + kvp.Value);
                    }
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                }
            }
    
            static void Main(string[] args)
            {
                Program obj = new Program();
                IReportClient rc = obj.getClient();
                obj.disabledomaindb(rc);
            }
        }
    }
    
    package main
    
    import (
            "fmt"
            "zoho/pkg/reportclient"
    
    )
    
    var(
            email = "user@zohocorp.com"
            authtoken = "f7d016b46be276cas21asd2a592f40101"
    )
    
    func DisableDomainDB(){
            url := reportclient.GetUserUri(email)
            dbname := "Base dataabse"
            domainname := "reports.customdomain.com"
            params := map[string]string{}
            result , err := reportclient.DisableDomainDB(url, dbname, domainname, params)
            if(err != nil){
            fmt.Println(err.ErrorMessage)
            fmt.Println(err.ErrorCode)
            fmt.Println(err.Action)
            fmt.Println(err.HttpStatusCode)
            }else{
            fmt.Println(result)
            }
    }
    
    func main() {
            reportclient.SetAuthToken(authtoken)
            DisableDomainDB()
    }
    
    import com.adventnet.zoho.client.report.*;
    
    public class Sample 
    {
        String email = "user@zoho.com";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
    
        public void disableDomainDB() throws Exception
        {
            String uri = rc.getURI(email);
            String dbName = "database";
            String domainName = "reports.customdomain.com";
            Map result = rc.disableDomainDB(uri, dbName, domainName, null);
        }
    
        public static void main(String[] args) throws Exception 
        {
            Sample obj = new Sample();
            obj.disableDomainDB();
        }
    }
    
    <?php
    
        require 'ReportClient.php';
    
        $EMAIL_ID = "abc@zoho.com";
        $AUTHTOKEN = "05740fccskfi453285db0e8b2a09f6f8";    
        $request = new ReportClient($AUTHTOKEN);
        $uri = $request->getUserURI($EMAIL_ID);
        $dbname = "Database";
        $domain_name = "reports.customdomain.com";
        $response = $request->disableDomainDB($uri, $dbname, $domain_name);
    ?>
    
    from __future__ import with_statement
    from ReportClient import ReportClient
    import sys
    
    class Sample:
    
        LOGINEMAILID="abc@zohocorp.com"
        AUTHTOKEN="f7d016b46be276ca12fa32a592f40101"
        rc = None
        rc = ReportClient(self.AUTHTOKEN)
    
        def disableDomainDB(self,rc):
        uri = rc.getURI(self.LOGINEMAILID)
        dbName = "Database"
        domainName = "reports.customdomain.com"
        result = rc.disableDomainDB(uri,dbName,domainName)
    
    obj = Sample()
    obj.disableDomainDB(obj.rc)
    
    curl -d "ZOHO_ACTION=DISABLEDOMAINDB&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML
             &ZOHO_API_VERSION=1.0&authtoken=f7d016b46be276cd4cfaswa592f40101
             &DBNAME=NEW&DOMAINNAME=reports.customdomain.com" 
             https://reportsapi.zoho.com/api/abc@zoho.com
    
    

    Sample Response XML Format:

    <response uri="/api/abc@zoho.com" action="DISABLEDOMAINDB">
        <result>
            <status>Success</status>
            <message>Domain Feature has been disabled</message>
        </result>
    </response>
    
    

    Sample Response JSON Format:

    {
        "response": 
        {
            "uri": "\/api\/abc@zoho.com",
            "action": "DISABLEDOMAINDB",
            "result": 
            {
                "status":"Success",
                "message":"Domain Feature has been disabled"
            } 
        }
    }
    
    

    The Disable Database API is used to disable the database from your Zoho Reports Account to White label account (custom domain).

    URL

    https://reportsapi.zoho.com/api/<Email>

    URL GET parameters

    Parameter Name Possible Values Description
    ZOHO_ACTION DISABLEDOMAINDB 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.
    authtoken user authtoken Auth Token is an unique token that authenticates the user to access the Zoho Account.
    ZOHO_API_VERSION 1.0 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.

    URL POST parameters

    Parameter Name Possible Values Description
    DBNAME
    (mandatory)
    Database name This parameter holds the name of the database to be disabled.
    DOMAINNAME
    (mandatory)
    Domain name This parameter holds the domain address.

    Possible Error Codes In DISABLE DOMAIN DATABASE

    7103 , 7138 , 8023 , 8025 , 8504 , 8506 , 8516 , 8533


    Create Table

    Download client libraries : C# | GO | JAVA | PHP | PYTHON



    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zoho.com";
        DBNAME = "EmployeeDB";
    
        class Program
        {
            public IReportClient getClient()
            {
                IReportClient RepClient = new ReportClient(AUTHTOKEN);
                return RepClient;
            }
    
            public void createtable(IReportClient rc)
            {
                string uri = rc.GetURI(EMAIL, DBNAME);
                string tabledesign = "{\"TABLENAME\":\"SysteTable\",\"TABLEDESCRIPTION\":\
                    "Testing Purpose\",\"FOLDERNAME\": \"NewFolder\",\
                    "COLUMNS\":[{\"COLUMNNAME\":\"SrNo\",\"DATATYPE\": \"NUMBER\",\"DEFAULT\":\
                    "null\",\"MANDATORY\" :  \"Yes\",\"DESCRIPTION\" : \"Testing\"}]}";
                rc.CreateTable(uri, tabledesign, null);
            }
    
            static void Main(string[] args)
            {
                Program obj = new Program();
                IReportClient rc = obj.getClient();
                obj.createtable(rc);
            }
        }
    }
    
    package main
    
    import (
            "fmt"
            "zoho/pkg/reportclient"
    
    )
    
    var(
            email = "user@zoho.com"
            dbname = "Employee"
            authtoken = "f7d016b46be276cas21asd2a592f40101"
    )
    
    func createtable() {
            url := reportclient.GetDbUri(email, dbname)
            tableconfig := "{\"TABLENAME\": \"SystemTable\",\"TABLEDESCRIPTION\": \"
                            Testing Purpose\", \"FOLDERNAME\": \"
                            NewFolder\",\"COLUMNS\":[{\"COLUMNNAME\": \"Product Category
                            \",\"DATATYPE\": \"PLAIN\",\"DEFAULT\": \"Test\",\"MANDATORY\" :  
                            \"Yes\",\"DESCRIPTION\" : 
                             \"Testing2\"}]}"
            err := reportclient.CreateTable(url, tableconfig)
            if(err != nil){
                    fmt.Println(err.ErrorMessage)
                    fmt.Println(err.ErrorCode)
                    fmt.Println(err.Action)
                    fmt.Println(err.HttpStatusCode)
            }else{
                    fmt.Println("Success")
            }
    }
    
    func main() {
            reportclient.SetAuthToken(authtoken)
            createtable()
    }
    
    import com.adventnet.zoho.client.report.*;
    
    public class Sample 
    {
        String email = "user@zoho.com";
        String dbname = "EmployeeDB";
        String tbname = "EmployeeTB";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
    
        public void createtable() throws Exception
        {
            String uri = rc.getURI(email,dbname,tbname);
            String tableDesign = "{\"TABLENAME\":\"SysteTable\",\"TABLEDESCRIPTION\"
                    :\"Testing Purpose\",\"FOLDERNAME\": \"NewFolder\",
                    \"COLUMNS\":[{\"COLUMNNAME\":\"SrNo\",\"DATATYPE\": \"NUMBER\",\"DEFAULT\":
                    \"null\",\"MANDATORY\" :  \"Yes\",\"DESCRIPTION\" : \"Testing\"}]}"
            rc.createTable(uri,tableDesign,config);
        }
    
        public static void main(String[] args) throws Exception 
        {
            Sample obj = new Sample();
            obj.createtable();
        }
    }
    
    <?php
        require 'ReportClient.php';
    
        $EMAIL_ID = "abc@zoho.com";
        $DB_NAME = "EmployeeDB";
        $AUTHTOKEN = "f7d016b46be2763wasda32a592f40101";
    
        $report_client_request = new ReportClient($AUTHTOKEN); 
    
        $uri = $report_client_request->getDbURI($EMAIL_ID, $DB_NAME);
        $table_design = '{
                "TABLENAME": "SystemTable",
                "TABLEDESCRIPTION": "Testing Purpose",
                "FOLDERNAME": "NewFolder",
                "COLUMNS": 
                [
                    {
                    "COLUMNNAME": "SrNo",
                    "DATATYPE": "NUMBER", 
                    "DEFAULT": "null",
                    "MANDATORY" :  "Yes",
                    "DESCRIPTION" : "Testing"
                    },
                    {
                    "COLUMNNAME": "Product",
                    "DATATYPE": "null",
                    "DEFAULT": "null",
                        "MANDATORY" :  "Yes",
                    "DESCRIPTION" : "Testing2"
                    },
                    {
                    "COLUMNNAME": "Product Category",
                    "DATATYPE": "PLAIN",
                    "DEFAULT": "Test",
                    "MANDATORY" :  "Yes",
                    "DESCRIPTION" : "Testing2"
                    } 
                ]
                 }';
        $report_client_request->createTable($uri, $table_design);
    ?>
    
    from __future__ import with_statement
    from ReportClient import ReportClient
    import sys
    
    class Sample:
    
        LOGINEMAILID="abc@zoho.com"
        AUTHTOKEN="f7d016b46be276ca12fa32a592f40101"
        DATABASENAME="Employee"
        rc = None
        rc = ReportClient(self.AUTHTOKEN)
    
        def createtable(self,rc):
            uri = rc.getDBURI(Config.LOGINEMAILID,Config.DATABASENAME)
            tableDesign ='{\"TABLENAME\":\"SysteTable\",\"TABLEDESCRIPTION\"
                    :\"Testing Purpose\",FOLDERNAME\": \"NewFolder\",
                    \"COLUMNS\":[{\"COLUMNNAME\":\"SrNo\",\"DATATYPE\": \"NUMBER\",\"DEFAULT\":
                    \"null\",\"MANDATORY\" :  \"Yes\",\"DESCRIPTION\" : \"Testing\"}]}'
            rc.createTable(uri,tableDesign)
    
    obj = Sample()
    obj.createtable(obj.rc)
    
    curl -d "ZOHO_ACTION=CREATETABLE&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML&
             ZOHO_API_VERSION=1.0&authtoken=f7d016b46be276cd4cfa32a592f40101&
             ZOHO_TABLE_DESIGN="table design in JSON"" 
             https://reportsapi.zoho.com/api/abc@zoho.com/Employee
    
    
    

    Sample Response XML Format:

    <?xml version="1.0" encoding="UTF-8" ?>
    <response uri="/api/abc@zoho.com/Employee" action="CREATETABLE">
        <result>
            <message>Table created successfully!</message>
        </result>
    </response>
    
    
    

    Sample Response JSON Format:

    { 
        "response": 
        { 
            "uri":"\/api\/abc@zoho.com\/Employee", 
            "action":"CREATETABLE", 
            "result":
            {
                "message":"Table created successfully!"
            } 
        } 
    }
    
    

    The Create table API is used to Create a table in the specified database.

    URL

    https://reportsapi.zoho.com/api/<Email>/<Databasename>

    URL PARAMETERS

    Parameter Name Possible Values Description
    ZOHO_ACTION CREATETABLE 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.
    authtoken user authtoken Auth Token is an unique token that authenticates the user to access the Zoho Account.
    ZOHO_API_VERSION 1.0 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.

    URL 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).

    Possible Error Codes In CREATE TABLE

    7103 , 7111 , 7138 , 8504 , 8506 , 8516 , 8533 , 8534


    Autogenerate Reports

    Download client libraries : C# | GO | JAVA | PHP | PYTHON



    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zoho.com";
        DBNAME = "EmployeeDB";
        TBNAME = "EmployeeTB";
    
        class Program
        {
            public IReportClient getClient()
            {
                IReportClient RepClient = new ReportClient(AUTHTOKEN);
                return RepClient;
            }
    
            public void autogenreports(IReportClient rc)
            {
                try
                {
                    string uri = rc.GetURI(EMAIL,DBNAME,TBNAME);
                    Dictionary<string,string> param = new Dictionary<string,string>();
                    param.Add("ZOHO_CREATEAGAIN", "true");
            string source = "TABLE";
                    var result = rc.AutoGenReports(uri, source, param);
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                }
            }
    
            static void Main(string[] args)
            {
                Program obj = new Program();
                IReportClient rc = obj.getClient();
                obj.autogenreports(rc);
            }
        }
    }
    
    package main
    
    import (
            "fmt"
            "zoho/pkg/reportclient"
    
    )
    
    var(
            email = "user@zoho.com"
            dbname = "Employee"
            tbname = "sample"
            authtoken = "f7d016b46be276cas21asd2a592f40101"
    )
    
    func autogenreports(){
            url := reportclient.GetUri(email, dbname, tbname)
            source := "TABLE"
            params := map[string]string{}
            params["ZOHO_COLUMN_NAME"] = "Region"
            result , err := reportclient.AutoGenReports(url, source, params)
            if(err != nil){
            fmt.Println(err.ErrorMessage)
            fmt.Println(err.ErrorCode)
            fmt.Println(err.Action)
            fmt.Println(err.HttpStatusCode)
            }else{
            fmt.Println(result)
            }
    }
    
    func main() {
            reportclient.SetAuthToken(authtoken)
            autogenreports()
    }
    
    import com.adventnet.zoho.client.report.*;
    
    public class Sample 
    {
        String email = "user@zoho.com";
        String dbname = "EmployeeDB";
        String tbname = "EmployeeTB";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
    
        private ReportClient rc = new ReportClient(authtoken);
    
        public void autoGenReports() throws Exception
        {
            String uri = rc.getURI(email,dbname,tbname);
            String source = "TABLE";
            Map result = rc.autoGenReports(uri, source, null);
        }
    
        public static void main(String[] args) throws Exception 
        {
            Sample obj = new Sample();
            obj.autoGenReports();
        }
    }
    
    <?php
        require 'ReportClient.php';
    
        $EMAIL_ID = "abc@zoho.com";
        $DB_NAME = "EmployeeDB";
        $TABLE_NAME = "EmployeeTB";
        $AUTHTOKEN = "f7d016b46be2763wasda32a592f40101";
    
        $report_client_request = new ReportClient($AUTHTOKEN); 
    
        $uri = $request->getURI($EMAIL_ID, $DB_NAME, $TABLE_NAME);
        $source = "TABLE";
        $response = $request->autoGenReports($uri, $source);
    ?>
    
    from __future__ import with_statement
    from ReportClient import ReportClient
    import sys
    
    class Sample:
    
        LOGINEMAILID="abc@zoho.com"
        AUTHTOKEN="f7d016b46be276ca12fa32a592f40101"
        DATABASENAME="Employee"
        TABLENAME="Employee"
        rc = None
        rc = ReportClient(self.AUTHTOKEN)
    
        def autogenreport(self,rc):
        uri = rc.getURI(self.LOGINEMAILID,self.DATABASENAME,self.TABLENAME)
        source = "TABLE"
        result = rc.autoGenReports(uri,source)
        print result
    
    obj = Sample()
    obj.autogenreport(obj.rc)
    
    curl -d "ZOHO_ACTION=AUTOGENREPORTS&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML
             &ZOHO_API_VERSION=1.0&authtoken=f7d016b46be276cd4cfa32a592f40101
             &ZOHO_SOURCE=TABLE"
             https://reportsapi.zoho.com/api/abc@zoho.com/SalesDB/Sales
    
    

    Sample Response XML Format:

    <?xml version="1.0" encoding="UTF-8" ?>
    <response uri="/api/user@zoho.com/Auto-Copy/Auto" action="AUTOGENREPORTS">
        <result>
            <status>success</status>
            <message>Reports generated successfully</message>
        </result>
    </response>
    
    

    Sample Response JSON Format:

    {
      "response": {
        "uri": "/api/user@zoho.com/Auto-Copy/Auto",
        "action": "AUTOGENREPORTS",
        "result": {
          "status": "success",
          "message": "Reports generated successfully"
        }
      }
    }
    
    

    The Autogenerate reports API is used to generate reports in Zoho Reports Table. The account Administrator and the Database Owner alone can use this API to generate the reports.

    URL

    https://reportsapi.zoho.com/api/<Email>/<Databasename>/<Tablename>

    URL PARAMETERS

    Parameter Name Possible Values Description
    ZOHO_ACTION AUTOGENREPORTS 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.
    authtoken user authtoken Auth Token is an unique token that authenticates the user to access the Zoho Account.
    ZOHO_API_VERSION 1.0 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.

    URL 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)
    columnname Column name which one wants to generate reports.

    Possible Error Codes In AUTOGENERATE REPORTS

    7103 , 7107 , 7138 , 8504 , 8506 , 8516 , 8533


    Create Similar Views

    Download client libraries : C# | GO | JAVA | PHP | PYTHON



    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zoho.com";
    
        class Program
        {
            public IReportClient getClient()
            {
                IReportClient RepClient = new ReportClient(AUTHTOKEN);
                return RepClient;
            }
    
            public void createsimilarviews(IReportClient rc)
            {
                try
                {
                    string uri = rc.GetURI(EMAIL, "Auto-Copy", "Auto");
                    string refview = "Base view";
                    string foldername = "New folder";
                    string copycusformula = false;
                    string copyaggformula = false;
                    var result = rc.CreateSimilarViews(uri, refview, foldername, copycusformula, copyaggformula, null);
                    foreach (KeyValuePair<string, string> kvp in result)
                    {
                        Console.WriteLine(kvp.Key + " = " + kvp.Value);
                    }
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                }
            }
    
            static void Main(string[] args)
            {
                Program obj = new Program();
                IReportClient rc = obj.getClient();
                obj.createsimilarviews(rc);
            }
        }
    }
    
    package main
    
    import (
            "fmt"
            "zoho/pkg/reportclient"
    
    )
    
    var(
            email = "user@zohocorp.com"
            authtoken = "f7d016b46be276cas21asd2a592f40101"
    )
    
    func CreateSimilarViews(){
            url := reportclient.GetUri(email, "Database", "Auto")
            refview := "Base table"
            foldername := "New folder"
            customformula := false
            aggformula := false
            params := map[string]string{}
            result , err := reportclient.CreateSimilarViews(url, refview, foldername, customformula, aggformula, params)
            if(err != nil){
            fmt.Println(err.ErrorMessage)
            fmt.Println(err.ErrorCode)
            fmt.Println(err.Action)
            fmt.Println(err.HttpStatusCode)
            }else{
            fmt.Println(result)
            }
    }
    
    func main() {
            reportclient.SetAuthToken(authtoken)
            CreateSimilarViews()
    }
    
    import com.adventnet.zoho.client.report.*;
    
    public class Sample 
    {
        String email = "user@zoho.com";
        String databaseName = "DB1";
        String tableName = "New table";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
    
        public void createSimilarViews() throws Exception
        {
            String uri = rc.getURI(email,databaseName,tableName);
            String refView = "base view";
            String folderName = "Folder 2";
            boolean customFormula = false;
            boolean aggFormula = false;
            Map result = rc.createSimilarViews(uri, refView, folderName, customFormula, aggFormula, null);
        }
    
        public static void main(String[] args) throws Exception 
        {
            Sample obj = new Sample();
            obj.createSimilarViews();
        }
    }
    
    <?php
    
        require 'ReportClient.php';
    
        $EMAIL_ID = "abc@zoho.com";
        $AUTHTOKEN = "05740fccfasdwe3425db0e8b2a09f6f8";
        $DB_NAME = "Database";
        $TABLE_NAME = "Tablename";
    
        $request = new ReportClient($AUTHTOKEN);
        $uri = $request->getURI($EMAIL_ID, $DB_NAME, $TABLE_NAME);
        $ref_view = "Table1";
        $folder_name = "Dummy";
        $copy_customformula = false;
        $copy_aggformula = false;
        $response = $request->createSimilarViews($uri, $ref_view, $folder_name, $copy_customformula, $copy_aggformula);
    ?>
    
    from __future__ import with_statement
    from ReportClient import ReportClient
    import sys
    
    class Sample:
    
        LOGINEMAILID="abc@zohocorp.com"
        DATABASENAME="Dbname"
        TABLENAME="table name"
        AUTHTOKEN="f7d016b46be276ca12fa32a592f40101"
        rc = None
        rc = ReportClient(self.AUTHTOKEN)
    
        def createSimilarViews(self,rc):
        uri = rc.getURI(self.LOGINEMAILID,self.DATABASENAME,self.TABLENAME)
        refView = "Base table"
        folderName = "New folder"
        customFormula = False
        aggFormula = False
        result = rc.createSimilarViews(uri,refView,folderName,customFormula,aggFormula)
    
    obj = Sample()
    obj.createSimilarViews(obj.rc)
    
    curl -d "ZOHO_ACTION=CREATESIMILARVIEWS&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML
             &ZOHO_API_VERSION=1.0&authtoken=f7d016b46be276cd4cfaswa592f40101
             &ZOHO_REFVIEW=old_table&ZOHO_FOLDERNAME=old_report&&ISCOPYCUSTOMFORMULA=false
             &ISCOPYAGGFORMULA=false" 
             https://reportsapi.zoho.com/api/abc@zoho.com/Database/Table
    
    

    Sample Response XML Format:

    <response uri="/api/abc@zoho.com/Database/Table" action="CREATESIMILARVIEWS">
        <result>
            <status>success</status>
            <message>Reports created successfully</message>
        </result>
    </response>
    
    
    

    Sample Response JSON Format:

    {
        "response": 
        {
            "uri": "\/api\/abc@zoho.com\/Database\/Table",
            "action": "CREATESIMILARVIEWS",
            "result": 
            {
                "status":"Success",
                "message":"Reports created successfully"
            } 
        }
    }
    
    

    The create similar views API is used to generate the reports from your Zoho Reports table.The views are created based on the reference table views.

    URL

    https://reportsapi.zoho.com/api/<Email>/<DatabaseName>/<TableName>

    URL parameters

    Parameter Name Possible Values Description
    ZOHO_ACTION CREATESIMILARVIEWS 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.
    authtoken user authtoken Auth Token is an unique token that authenticates the user to access the Zoho Account.
    ZOHO_API_VERSION 1.0 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.

    URL 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.

    Possible Error Codes In CREATE SIMILAR VIEWS

    7103 , 7138 , 7144 , 8504 , 8506 , 8516 , 8533


    Rename View

    Download client libraries : C# | GO | JAVA | PHP | PYTHON



    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zoho.com";
        DBNAME = "EmployeeDB";
    
        class Program
        {
            public IReportClient getClient()
            {
                IReportClient RepClient = new ReportClient(AUTHTOKEN);
                return RepClient;
            }
    
            public void renameview(IReportClient rc)
            {
                string uri = rc.GetURI(EMAIL, DBNAME);
                string viewname = "oldname";
                string newviewname = "Newname";
                string viewdesc = "Description";
                rc.RenameView(uri, viewname, newviewname, viewdesc, null);
            }
    
            static void Main(string[] args)
            {
                Program obj = new Program();
                IReportClient rc = obj.getClient();
                obj.renameview(rc);
            }
        }
    }
    
    package main
    
    import (
            "fmt"
            "zoho/pkg/reportclient"
    
    )
    
    var(
            email = "user@zoho.com"
            dbname = "Employee"
            authtoken = "f7d016b46be276cas21asd2a592f40101"
    )
    
    func renameview() {
            url := reportclient.GetDbUri(email, dbname)
            viewname := "Datalist"
            newname := "Newlist"
            newdesc := "description"
            err := reportclient.RenameView(url, viewname, newname, newdesc)
            if(err != nil){
                    fmt.Println(err.ErrorMessage)
                    fmt.Println(err.ErrorCode)
                    fmt.Println(err.Action)
                    fmt.Println(err.HttpStatusCode)
            }else{
                    fmt.Println("Success")
            }
    }
    
    func main() {
            reportclient.SetAuthToken(authtoken)
            renameview()
    }
    
    import com.adventnet.zoho.client.report.*;
    
    public class Sample 
    {
        String email = "user@zoho.com";
        String dbname = "EmployeeDB";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
    
        public void renameview() throws Exception
        {
            String uri = rc.getURI(email,dbname);
            rc.renameView(uri,"Salary","Newsalary","Description",config);
        }
    
        public static void main(String[] args) throws Exception 
        {
            Sample obj = new Sample();
            obj.renameview();
        }
    }
    
    <?php
        require 'ReportClient.php';
    
        $EMAIL_ID = "abc@zoho.com";
        $DB_NAME = "EmployeeDB";
        $AUTHTOKEN = "f7d016b46be2763wasda32a592f40101";
    
        $report_client_request = new ReportClient($AUTHTOKEN); 
    
        $uri = $report_client_request->getDbURI($EMAIL_ID, $DB_NAME);
        $view_name = "oldname";
        $new_view_name = "new name";
        $new_view_desc = "description";
        $$report_client_request->renameView($uri, $view_name, 
                                    $new_view_name, $new_view_desc);
    ?>
    
    from __future__ import with_statement
    from ReportClient import ReportClient
    import sys
    
    class Sample:
    
        LOGINEMAILID="abc@zoho.com"
        AUTHTOKEN="f7d016b46be276ca12fa32a592f40101"
        DATABASENAME="Employee"
        TABLENAME="Employee"
        rc = None
        rc = ReportClient(self.AUTHTOKEN)
    
        def renameview(self,rc):
            uri = rc.getDBURI(Config.LOGINEMAILID,Config.DATABASENAME)
            rc.renameView(uri,"Old","New","description")
    
    obj = Sample()
    obj.renameview(obj.rc)
    
    curl -d "ZOHO_ACTION=RENAMEVIEW&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML&
             ZOHO_API_VERSION=1.0&authtoken=f7d016b46be276cd4cfa32a592f40101&
             ZOHO_VIEWNAME="New"&ZOHO_NEW_VIEWNAME="new"&ZOHO_NEW_VIEWDESC="desc"" 
              https://reportsapi.zoho.com/api/abc@zoho.com/Employee
    
    
    

    Sample Response XML Format:

    <?xml version="1.0" encoding="UTF-8" ?>
    <response uri="/api/abc@zoho.com/Employee" action="RENAMEVIEW">
        <result>
            <message>View renamed successfully!</message>
        </result>
    </response>
    
    
    

    Sample Response JSON Format:

    {
        "response":
        {
            "uri":"\/api\/abc@zoho.com\/Employee",
            "action":"RENAMEVIEW",
            "result":
            {
                "message":"View renamed successfully!"
            }
        }
    }
    
    

    The Rename view API is used to Rename the specified view with the new name and description.

    URL

    https://reportsapi.zoho.com/api/<Email>/<Databasename>

    URL PARAMETERS

    Parameter Name Possible Values Description
    ZOHO_ACTION RENAMEVIEW 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.
    authtoken user authtoken Auth Token is an unique token that authenticates the user to access the Zoho Account.
    ZOHO_API_VERSION 1.0 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.

    URL PARAMETERS

    Parameter Name Possible Values Description
    ZOHO_VIEWNAME
    (mandatory)
    View name Current name of the view
    ZOHO_NEW_VIEWNAME
    (mandatory)
    New view name New name for the view
    ZOHO_NEW_VIEWDESC
    (optional)
    View description New description for the view

    Possible Error Codes In RENAME VIEW

    7103 , 7105 , 7111 , 7138 , 8504 , 8506 , 8516 , 8533


    Copy Reports

    Download client libraries : C# | GO | JAVA | PHP | PYTHON



    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zoho.com";
        DBNAME = "EmployeeDB";
        TBNAME = "EmployeeTB";
    
        class Program
        {
            public IReportClient getClient()
            {
                IReportClient RepClient = new ReportClient(AUTHTOKEN);
                return RepClient;
            }
    
            public void copyreports(IReportClient rc)
            {
                string uri = rc.GetURI(EMAIL, DBNAME);
                string views = "Employee";
                string dbname = "sample";
                string dbkey = "d6e443b4dc3cad251fcc54ff81cd3ad3";
                rc.CopyReports(uri, views, dbname, dbkey, null);
            }
    
            static void Main(string[] args)
            {
                Program obj = new Program();
                IReportClient rc = obj.getClient();
                obj.copyreports(rc);
            }
        }
    }
    
    package main
    
    import (
            "fmt"
            "zoho/pkg/reportclient"
    
    )
    
    var(
            email = "user@zoho.com"
            dbname = "Employee"
            tbname = "sample"
            authtoken = "f7d016b46be276cas21asd2a592f40101"
            dbkey = "d6e443b4dc3cas421fcc54ff81cd3ad3"
    )
    
    func copyreports() {
            url := reportclient.GetDbUri(email, dbname)
            viewnames := "List"
            destdbname := "sample"
            err := reportclient.CopyReports(url, viewnames, destdbname, dbkey)
            if(err != nil){
                    fmt.Println(err.ErrorMessage)
                    fmt.Println(err.ErrorCode)
                    fmt.Println(err.Action)
                    fmt.Println(err.HttpStatusCode)
            }else{
                    fmt.Println("Success")
            }
    }
    
    func main() {
            reportclient.SetAuthToken(authtoken)
            copyreports()
    }
    
    import com.adventnet.zoho.client.report.*;
    
    public class Sample 
    {
        String email = "user@zoho.com";
        String dbname = "EmployeeDB";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        String dbkey = "d6e443b4dc3c85d51fcc54ff81cd3ad3";
        String destdb = "sample";
        String views = "new";
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
    
        public void copyreports() throws Exception
        {
            String uri = rc.getURI(email,dbname);
            rc.copyReport(uri,views,destdb,dbkey,config);
        }
    
        public static void main(String[] args) throws Exception 
        {
            Sample obj = new Sample();
            obj.copyreports();
        }
    }
    
    <?php
        require 'ReportClient.php';
    
        $EMAIL_ID = "abc@zoho.com";
        $DB_NAME = "EmployeeDB";
        $AUTHTOKEN = "f7d016b46be2763wasda32a592f40101";
    
        $report_client_request = new ReportClient($AUTHTOKEN); 
    
        $uri = $report_client_request->getDbURI($EMAIL_ID, $DB_NAME);
        $views = "Employee";
        $dbname = "New db";
        $dbkey = "d6e443b4dc3c85d5q34casdff81cd3ad3";
        $report_client_request->copyReports($uri, $views, $dbname, $dbkey);
    ?>
    
    from __future__ import with_statement
    from ReportClient import ReportClient
    import sys
    
    class Sample:
    
        LOGINEMAILID="abc@zoho.com"
        AUTHTOKEN="f7d016b46be276ca12fa32a592f40101"
        DATABASENAME="Employee"
        rc = None
        rc = ReportClient(self.AUTHTOKEN)
    
        def copyreports(self,rc):
            uri = rc.getDBURI(self.LOGINEMAILID,self.DATABASENAME)
            rc.copyReports(uri,"Employee","sample","d6e443b4dc3c85d51fcc54ff81cd3ad3")
    
    obj = Sample()
    obj.copyreports(obj.rc)
    
    curl -d "ZOHO_ACTION=COPYREPORTS&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML&
             ZOHO_API_VERSION=1.0&authtoken=f7d016qw2be276cd4cfa32a592f40101&
             ZOHO_VIEWTOCOPY=EmployeeDetails&ZOHO_DATABASE_NAME=sample&
             ZOHO_COPY_DB_KEY=d6e443b4e34c85d51fcc54ff81cd3ad3" 
             https://reportsapi.zoho.com/api/abc@zoho.com/Employee
    
    

    Sample Response XML Format:

    <response uri="/api/source_account@zoho.com/SourceEmployeeDB" 
    action="COPYREPORTS"> <result> <message> Successfully View(s) Copied </message> </result> </response>

    Sample Response JSON Format:

    {
        "response":
        {
            "uri":"\/api\/source_account@zoho.com\/SourceEmployeeDB",
            "action":"COPYREPORTS",
            "result":
            {
                "message": "Successfully View(s) Copied"
            }
        }
    }
    
    

    The source database administrator should generate and provide the Copy Database Key, the secret key used to authorize the destination database 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 database should exists with the same name in the destination database.

    URL

    https://reportsapi.zoho.com/api/<Email>/<Databasename>

    URL PARAMETERS

    Parameter Name Possible Values Description
    ZOHO_ACTION COPYREPORTS 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.
    authtoken user authtoken Auth Token is an unique token that authenticates the user to access the Zoho Account.
    ZOHO_API_VERSION 1.0 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.

    URL 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)
    database name This parameter holds the name of the database (destination database) where the reports (specified in ZOHO_VIEWSTOCOPY parameter) has to be copied
    ZOHO_COPY_DB_KEY
    (mandatory)
    Database key The secret key used for allowing the user to copy the database / reports.
    The source database owner has to invoke the below URL to get the Copy Database Secret Key.
    https://reportsapi.zoho.com/api/abcd@zoho.com/SourceEmployeeDB?ZOHO_ACTION=GETCOPYDBKEY&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML&authtoken=<source_db_owner_authtoken>&ZOHO_API_VERSION=1.0.
    For more about database key.
    Note:
    You need to provide the appropriate values in the above URL to generate the corresponding Copy Database Key for your setup

    Possible Error Codes In COPY REPORTS

    7103 , 7138 , 8504 , 8506 , 8516 , 8533 , 15000 , 15001 , 15002 , 15005 , 15007 , 15012


    Copy Formula

    Download client libraries : C# | GO | JAVA | PHP | PYTHON



    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zoho.com";
        DBNAME = "EmployeeDB";
        TBNAME = "EmployeeTB";
    
        class Program
        {
            public IReportClient getClient()
            {
                IReportClient RepClient = new ReportClient(AUTHTOKEN);
                return RepClient;
            }
    
            public void copyformula(IReportClient rc)
            {
                string uri = rc.GetURI(EMAIL, DBNAME, TBNAME);
                string formula = "total";
                string dbname = "sample";
                string dbkey = "d6e443b4dc3c85dsswcc54ff81cd3ad3";
                rc.CopyFormula(uri, formula, dbname, dbkey, null);
            }
    
            static void Main(string[] args)
            {
                Program obj = new Program();
                IReportClient rc = obj.getClient();
                obj.copyformula(rc);
            }
        }
    }
    
    package main
    
    import (
            "fmt"
            "zoho/pkg/reportclient"
    
    )
    
    var(
            email = "user@zoho.com"
            dbname = "Employee"
            tbname = "sample"
            authtoken = "f7d016b46be276cas21asd2a592f40101"
            dbkey = "d6e443b4dc3cas421fcc54ff81cd3ad3"
    )
    
    func copyformula() {
            url := reportclient.GetUri(email, dbname, tbname)
            formulaname := "total"
            destdbname := "sample"
            err := reportclient.CopyFormula(url, formulaname, destdbname, dbkey)
            if(err != nil){
                    fmt.Println(err.ErrorMessage)
                    fmt.Println(err.ErrorCode)
                    fmt.Println(err.Action)
                    fmt.Println(err.HttpStatusCode)
            }else{
                    fmt.Println("Success")
            }
    }
    
    func main() {
            reportclient.SetAuthToken(authtoken)
            copyformula()
    }
    
    import com.adventnet.zoho.client.report.*;
    
    public class Sample 
    {
        String email = "user@zoho.com";
        String dbname = "EmployeeDB";
        String tbname = "EmployeeTB";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        String dbkey = "d6e443b4dc3c85d51fcc54ff81cd3ad3";
        String destdb = "sample";
        String formula = "total";
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
    
        public void copyformula() throws Exception
        {
            String uri = rc.getURI(email,dbname,tbname);
            rc.copyFormula(uri,formula,destdb,dbkey,config);
        }
    
        public static void main(String[] args) throws Exception 
        {
            Sample obj = new Sample();
            obj.copyformula();
        }
    }
    
    <?php
        require 'ReportClient.php';
    
        $EMAIL_ID = "abc@zoho.com";
        $DB_NAME = "EmployeeDB";
        $TABLE_NAME = "EmployeeTB";
        $AUTHTOKEN = "f7d016b46be2763wasda32a592f40101";
    
        $report_client_request = new ReportClient($AUTHTOKEN); 
    
        $uri = $report_client_request->getURI($EMAIL_ID, $DB_NAME, $TABLE_NAME);
        $formula = "Total";
        $dbname = "New db";
        $dbkey = "d6e443b4dc3c85d5q34casdff81cd3ad3";
        $report_client_request->copyFormula($uri, $formula, $dbname, $dbkey);
    ?>
    
    from __future__ import with_statement
    from ReportClient import ReportClient
    import sys
    
    class Sample:
    
        LOGINEMAILID="abc@zoho.com"
        AUTHTOKEN="f7d016b46be276ca12fa32a592f40101"
        DATABASENAME="Employee"
        TABLENAME="Employee"
        rc = None
        rc = ReportClient(self.AUTHTOKEN)
    
        def copyformula(self,rc):
            uri = rc.getURI(self.LOGINEMAILID,self.DATABASENAME,self.TABLENAME)
            rc.copyFormula(uri,"total","sample","d6e443b4dc3c85d51fcc54ff81cd3ad3")
    
    obj = Sample()
    obj.copyformula(obj.rc)
    
    curl -d "ZOHO_ACTION=COPYFORMULA&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML&
             ZOHO_API_VERSION=1.0&authtoken=f7d0162wqbe276cd4cfa32a592f40101&
             ZOHO_FORMULATOCOPY=MyFormula1&ZOHO_DATABASE_NAME=SourceEmployeeDetails&
             ZOHO_COPY_DB_KEY=d6e443b4dc3ceew51fcc54ff81cd3ad3" 
             https://reportsapi.zoho.com/api/abc@zoho.com/Employee/Employee
    
    

    Sample Response XML Format:

    <response uri="/api/source_account@zoho.com/SourceEmployeeDB/EmployeeDetails" 
                     action="COPYFORMULA">
        <result>
            <message>
            Successfully formula(s) Copied
            </message>
        </result>
    </response>
    
    

    Sample Response JSON Format:

    {
        "response":
             {
                "uri":"\/api\/source_account@zoho.com\/EmployeeDB\/EmployeeDetails",
                "action":"COPYFORMULA",
                "result":
            {
                             "message": "Successfully Formula(s) Copied"
            }
        }
    }
    
    

    The Copy Formula API is used to copy one or more formula columns from one table to another within the same database or across databases and even across one user account to another. The source database administrator should generate and provide the Copy Database Key, the secret key used to authorize the destination database administrator. It is necessary that the table and column name in the destination database should be the same as that of the table and column names in the source database on which the formula is dependent. Both Custom Formula and Aggregate Formula can be copied using this API.

    URL

    https://reportsapi.zoho.com/api/<Email>/<Databasename>/<Tablename>

    URL PARAMETERS

    Parameter Name Possible Values Description
    ZOHO_ACTION COPYFORMULA 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.
    authtoken user authtoken Auth Token is an unique token that authenticates the user to access the Zoho Account.
    ZOHO_API_VERSION 1.0 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.

    URL PARAMETERS

    Parameter Name Possible Values Description
    ZOHO_FORMULATOCOPY Formula name This parameter holds the FORMULA NAME to be copied from the source database into another table in the destination database.
    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 Database name This parameter holds the name of the database (destination database) 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 Database key The secret key used for allowing the user to copy the database / reports.
    The source database owner has to invoke the below URL to get the Copy Database Secret Key.
    https://reportsapi.zoho.com/api/abcd@zoho.com/SourceEmployeeDB?ZOHO_ACTION=GETCOPYDBKEY&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML&authtoken=<source_db_owner_authtoken>&ZOHO_API_VERSION=1.0 .
    For more about database key.
    Note: You need to provide the appropriate values in the above URL to generate the corresponding Copy Database Key for your setup

    Possible Error Codes In COPY FORMULA

    7103 , 7138 , 8504 , 8506 , 8516 , 8533 , 15002 , 15007 , 15009 , 15010


    Add Column

    Download client libraries : C# | GO | JAVA | PHP | PYTHON



    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zoho.com";
        DBNAME = "EmployeeDB";
        TBNAME = "EmployeeTB";
    
        class Program
        {
            public IReportClient getClient()
            {
                IReportClient RepClient = new ReportClient(AUTHTOKEN);
                return RepClient;
            }
    
            public void addColumn(IReportClient RepClient)
            {
                string tableURI = RepClient.GetURI(EMAIL, DBNAME, TBNAME);
                string ColumnName = "columnname";
                string DataType = "PLAIN";
                bool HideColumn = false;
                bool SkipSystemTableCheck = true;
                RepClient.AddColumn(tableURI, ColumnName, DataType, HideColumn, 
                                           SkipSystemTableCheck, null);
            }
    
            static void Main(string[] args)
            {
                Program obj = new Program();
                IReportClient rc = obj.getClient();
                obj.addColumn(rc);
            }
        }
    }
    
    package main
    
    import (
            "fmt"
            "zoho/pkg/reportclient"
    
    )
    
    var(
            email = "user@zoho.com"
            dbname = "Employee"
            tbname = "sample"
            authtoken = "f7d016b46be276cas21asd2a592f40101"
    )
    
    func addcolumn() {
            url := reportclient.GetUri(email, dbname, tbname)
            columnname := "Address"
            datatype := "PLAIN"
            err := reportclient.AddColumn(url, columnname, datatype)
            if(err != nil){
                    fmt.Println(err.ErrorMessage)
                    fmt.Println(err.ErrorCode)
                    fmt.Println(err.Action)
                    fmt.Println(err.HttpStatusCode)
            }else{
                    fmt.Println("Success")
            }
    }
    
    func main() {
            reportclient.SetAuthToken(authtoken)
            addcolumn()
    }
    
    import com.adventnet.zoho.client.report.*;
    
    public class Sample 
    {
        String email = "user@zoho.com";
        String dbname = "EmployeeDB";
        String tbname = "EmployeeTB";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
    
        public void addcolumn() throws Exception
        {
            String uri = rc.getURI(email,dbname,tbname);
            rc.addColumn(uri,"DOB","PLAIN",config);
        }
    
        public static void main(String[] args) throws Exception 
        {
            Sample obj = new Sample();
            obj.addcolumn();
        }
    }
    
    <?php
        require 'ReportClient.php';
    
        $EMAIL_ID = "abc@zoho.com";
        $DB_NAME = "EmployeeDB";
        $TABLE_NAME = "EmployeeTB";
        $AUTHTOKEN = "f7d016b46be2763wasda32a592f40101";
    
        $report_client_request = new ReportClient($AUTHTOKEN); 
    
        $uri = $report_client_request->getURI($EMAIL_ID, $DB_NAME, $TABLE_NAME);
        $column_name = "Employee Name";
        $data_type = "PLAIN";
        $report_client_request->addColumn($uri, $column_name, $data_type);
    ?>
    
    from __future__ import with_statement
    from ReportClient import ReportClient
    import sys
    
    class Sample:
    
        LOGINEMAILID="abc@zoho.com"
        AUTHTOKEN="f7d016b46be276ca12fa32a592f40101"
        DATABASENAME="Employee"
        TABLENAME="Employee"
        rc = None
        rc = ReportClient(self.AUTHTOKEN)
    
        def AddColumn(self,rc):
            uri = rc.getURI(self.LOGINEMAILID,self.DATABASENAME,self.TABLENAME)
            columnName = "columnName"
            dataType = "PLAIN"
            rc.addColumn(uri,columnName,dataType)
    
    obj = Sample()
    obj.AddColumn(obj.rc)
    
    curl -d "ZOHO_ACTION=ADDCOLUMN&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML
             &ZOHO_API_VERSION=1.0&authtoken=f7d016b46be276cd4cfa32a5dws40101
             &ZOHO_COLUMNNAME=Region&ZOHO_DATATYPE=PLAIN" 
             https://reportsapi.zoho.com/api/abc@zoho.com/SalesDB/Sales
    
    
    

    Sample Response XML Format:

    <response uri="/api/abc@zoho.com/SalesDB/Sales" action="ADDCOLUMN">
        <result>
            Column created successfully
        </result>
    </response>
    
    

    Sample Response JSON Format:

    {
        "response":
        {
            "uri":"\/api\/abc@zoho.com\/SalesDB\/Sales",
            "action":"ADDCOLUMN",
            "result": {"message":"Column created successfully"}
            }
    }
    
    

    The Add Column API is used to add a column into Zoho Reports Table. The account Administrator and the Database Owner alone can use this API to add a column in the Zoho Reports table.

    URL

    https://reportsapi.zoho.com/api/<Email>/<Databasename>/<Tablename>

    Note: In case of database owner adding a column, they need to specify the login E-mail ID of the account Administrator only.

    URL 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.
    authtoken user authtoken Auth Token is an unique token that authenticates the user to access the Zoho Account.
    ZOHO_API_VERSION 1.0 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.

    URL PARAMETERS

    Parameter Name Possible Values Description
    ZOHO_COLUMNNAME
    (mandatory)
    <columnname> The name of the column to be added into Zoho Reports 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 Reports Table.

    Possible Error Codes In ADD COLUMN

    7103 , 7128 , 7138 , 7161 , 8504 , 8506 , 8516 , 8533


    Delete Column

    Download client libraries : C# | GO | JAVA | PHP | PYTHON



    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zoho.com";
        DBNAME = "EmployeeDB";
        TBNAME = "EmployeeTB";
    
        class Program
        {
            public IReportClient getClient()
            {
                IReportClient RepClient = new ReportClient(AUTHTOKEN);
                return RepClient;
            }
    
            public void deleteColumn(IReportClient RepClient)
            {
                string tableURI = RepClient.GetURI(EMAIL, DBNAME, TBNAME);
                string ColumnName = "columnname";
                bool DeleteDependentView = false;
                bool SkipSystemTableCheck = true;
                RepClient.DeleteColumn(tableURI, ColumnName, DeleteDependentView, 
                     SkipSystemTableCheck, null);
            }
    
            static void Main(string[] args)
            {
                Program obj = new Program();
                IReportClient rc = obj.getClient();
                obj.deleteColumn(rc);
            }
        }
    }
    
    package main
    
    import (
            "fmt"
            "zoho/pkg/reportclient"
    
    )
    
    var(
            email = "user@zoho.com"
            dbname = "Employee"
            tbname = "sample"
            authtoken = "f7d016b46be276cas21asd2a592f40101"
    )
    
    func deletecolumn() {
            url := reportclient.GetUri(email, dbname, tbname)
            columnname := "Address"
            err := reportclient.DeleteColumn(url, columnname)
            if(err != nil){
                    fmt.Println(err.ErrorMessage)
                    fmt.Println(err.ErrorCode)
                    fmt.Println(err.Action)
                    fmt.Println(err.HttpStatusCode)
            }else{
                    fmt.Println("Success")
            }
    }
    
    func main() {
            reportclient.SetAuthToken(authtoken)
            deletecolumn()
    }
    
    import com.adventnet.zoho.client.report.*;
    
    public class Sample 
    {
        String email = "user@zoho.com";
        String dbname = "EmployeeDB";
        String tbname = "EmployeeTB";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
    
        public void deletecolumn() throws Exception
        {
            String uri = rc.getURI(email,dbname,tbname);
            rc.deleteColumn(uri,"vin",config);
        }
    
        public static void main(String[] args) throws Exception 
        {
            Sample obj = new Sample();
            obj.deletecolumn();
        }
    }
    
    <?php
        require 'ReportClient.php';
    
        $EMAIL_ID = "abc@zoho.com";
        $DB_NAME = "EmployeeDB";
        $TABLE_NAME = "EmployeeTB";
        $AUTHTOKEN = "f7d016b46be2763wasda32a592f40101";
    
        $report_client_request = new ReportClient($AUTHTOKEN); 
    
        $uri = $report_client_request->getURI($EMAIL_ID, $DB_NAME, $TABLE_NAME);
        $column_name = "Employee Name";
        $report_client_request->deleteColumn($uri, $column_name);
    ?>
    
    from __future__ import with_statement
    from ReportClient import ReportClient
    import sys
    
    class Sample:
    
        LOGINEMAILID="abc@zoho.com"
        AUTHTOKEN="f7d016b46be276ca12fa32a592f40101"
        DATABASENAME="Employee"
        TABLENAME="Employee"
        rc = None
        rc = ReportClient(self.AUTHTOKEN)
    
        def DeleteColumn(self,rc):
            uri = rc.getURI(self.LOGINEMAILID,self.DATABASENAME,self.TABLENAME)
            columnName = "columnName"
            rc.deleteColumn(uri,columnName)
    
    obj = Sample()
    obj.DeleteColumn(obj.rc)
    
    curl -d "ZOHO_ACTION=DELETECOLUMN&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML
             &ZOHO_API_VERSION=1.0&authtoken=f7d016b46be276aswcfa32a592f40101
             &ZOHO_COLUMNNAME=Experiance" 
             https://reportsapi.zoho.com/api/abc@zoho.com/SalesDB/Sales
    
    

    Sample Response XML Format:

    <response uri="/api/abc@zoho.com/SalesDB/Sales" action="DELETECOLUMN">
        <result>
            Column deleted successfully
        </result>
    </response>
    
    

    Sample Response JSON Format:

    {
        "response":
        {
            "uri":"\/api\/abc@zoho.com\/SalesDB\/Sales",
            "action":"DELETECOLUMN",
            "result": {"message":"Column deleted successfully"}
        }
    }
    
    
    

    The Delete Column API is used to delete a column in Zoho Reports Table. The account Administrator and the Database Owner alone can use this API to delete a column in a Zoho Reports table.

    URL

    https://reportsapi.zoho.com/api/<Email>/<Databasename>/<Tablename>

    Note: In case of database owner deleting a column, they need to specify the login E-mail ID of the account Administrator only.

    URL 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.
    authtoken user authtoken Auth Token is an unique token that authenticates the user to access the Zoho Account.
    ZOHO_API_VERSION 1.0 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.

    URL PARAMETERS

    Parameter Name Possible Values Description
    ZOHO_COLUMNNAME
    (mandatory)
    <columnname> The name of the column to be deleted in Zoho Reports Table.
    Example:ZOHO_COLUMNNAME=Region

    Possible Error Codes In DELETE COLUMN

    7103 , 7107 , 7138 , 7159 , 8504 , 8506 , 8516 , 8533


    Rename Column

    Download client libraries : C# | GO | JAVA | PHP | PYTHON



    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zoho.com";
        DBNAME = "EmployeeDB";
        TBNAME = "EmployeeTB";
    
        class Program
        {
            public IReportClient getClient()
            {
                IReportClient RepClient = new ReportClient(AUTHTOKEN);
                return RepClient;
            }
    
            public void renameColumn(IReportClient RepClient)
            {
                string tableURI = RepClient.GetURI(EMAIL, DBNAME, TBNAME);
                string OldColumnName = "oldcolumn"; 
                string NewColumnName = "newcolumn";
                bool SkipSystemTableCheck = true;
                RepClient.RenameColumn(tableURI, OldColumnName, NewColumnName, 
                                     SkipSystemTableCheck, null);
            }
    
            static void Main(string[] args)
            {
                Program obj = new Program();
                IReportClient rc = obj.getClient();
                obj.renameColumn(rc);
            }
        }
    }
    
    package main
    
    import (
            "fmt"
            "zoho/pkg/reportclient"
    
    )
    
    var(
            email = "user@zoho.com"
            dbname = "Employee"
            tbname = "sample"
            authtoken = "f7d016b46be276cas21asd2a592f40101"
    )
    
    func renamecolumn() {
            url := reportclient.GetUri(email, dbname, tbname)
            oldcolumnname := "Id"
            newcolumnname := "EmpId"
            err := reportclient.RenameColumn(url, oldcolumnname, newcolumnname)
            if(err != nil){
                    fmt.Println(err.ErrorMessage)
                    fmt.Println(err.ErrorCode)
                    fmt.Println(err.Action)
                    fmt.Println(err.HttpStatusCode)
            }else{
                    fmt.Println("Success")
            }
    }
    
    func main() {
            reportclient.SetAuthToken(authtoken)
            renamecolumn()
    }
    
    import com.adventnet.zoho.client.report.*;
    
    public class Sample 
    {
        String email = "user@zoho.com";
        String dbname = "EmployeeDB";
        String tbname = "EmployeeTB";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
    
        public void renamecolumn() throws Exception
        {
            String uri = rc.getURI(email,dbname,tbname);
            rc.renameColumn(uri,"old","new",config);
        }
    
        public static void main(String[] args) throws Exception 
        {
            Sample obj = new Sample();
            obj.renamecolumn();
        }
    }
    
    <?php
        require 'ReportClient.php';
    
        $EMAIL_ID = "abc@zoho.com";
        $DB_NAME = "EmployeeDB";
        $TABLE_NAME = "EmployeeTB";
        $AUTHTOKEN = "f7d016b46be2763wasda32a592f40101";
    
        $report_client_request = new ReportClient($AUTHTOKEN); 
    
        $uri = $report_client_request->getURI($EMAIL_ID, $DB_NAME, $TABLE_NAME);
        $old_column_name = "Employee ID";
        $new_column_name = "Emp ID";
        $report_client_request->renameColumn($uri, $old_column_name, 
                                         $new_column_name);
    ?>
    
    from __future__ import with_statement
    from ReportClient import ReportClient
    import sys
    
    class Sample:
    
        LOGINEMAILID="abc@zoho.com"
        AUTHTOKEN="f7d016b46be276ca12fa32a592f40101"
        DATABASENAME="Employee"
        TABLENAME="Employee"
        rc = None
        rc = ReportClient(self.AUTHTOKEN)
    
        def RenameColumn(self,rc):
            uri = rc.getURI(self.LOGINEMAILID,self.DATABASENAME,self.TABLENAME)
            oldColumnName = "oldname"
            newColumnName = "newname"
            rc.renameColumn(uri,oldColumnName,newColumnName)
    
    obj = Sample()
    obj.RenameColumn(obj.rc)
    
    curl -d "ZOHO_ACTION=RENAMECOLUMN&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML
             &ZOHO_API_VERSION=1.0&authtoken=f7d016b46be276cd4cfa32a592f40101
             &OLDCOLUMNNAME=Region&NEWCOLUMNNAME=NewRegion" 
             https://reportsapi.zoho.com/api/abc@zoho.com/SalesDB/Sales
    
    
    

    Sample Response XML Format:

    <response uri="/api/abc@zoho.com/SalesDB/Sales" action="RENAMECOLUMN">
        <result>
            Column renamed successfully
        </result>
    </response>
    
    

    Sample Response JSON Format:

    {
        "response":
        {
            "uri":"\/api\/abc@zoho.com\/SalesDB\/Sales",
            "action":"RENAMECOLUMN",
            "result": 
            {
                "message":"Column renamed successfully"
            }
        }
    }
    
    

    The Rename Column API is used to rename the column in Zoho Reports Table. The account Administrator and the Database Owner alone can use this API to rename a column in the Zoho Reports table.

    URL

    https://reportsapi.zoho.com/api/<Email>/<Databasename>/<Tablename>

    Note: In case of database owner renaming a column, they need to specify the login E-mail ID of the account Administrator only.

    URL 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.
    authtoken user authtoken Auth Token is an unique token that authenticates the user to access the Zoho Account.
    ZOHO_API_VERSION 1.0 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.

    URL PARAMETERS

    Parameter Name Possible Values Description
    OLDCOLUMNNAME
    (mandatory)
    <oldcolumnname> The name of the column to be renamed in Zoho Reports Table. Example: OLDCOLUMNNAME=Region
    NEWCOLUMNNAME
    (mandatory)
    <newcolumnname> The new name you wanted to give for the column.Example: NEWCOLUMNNAME=SalesRegion

    Possible Error Codes In RENAME COLUMN

    7103 , 7107 , 7138 , 7128 , 8504 , 8506 , 8516 , 8533


    Hide Column

    Download client libraries : C# | GO | JAVA | PHP | PYTHON



    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zoho.com";
        DBNAME = "EmployeeDB";
        TBNAME = "EmployeeTB";
    
        class Program
        {
            public IReportClient getClient()
            {
                IReportClient RepClient = new ReportClient(AUTHTOKEN);
                return RepClient;
            }
    
            public void hidecolumn(IReportClient rc)
            {
                try
                {
                    string uri = rc.GetURI(EMAIL, DBNAME, TBNAME);
                    string[] columnNames = new string[3];
                    columnNames[0] = "cost";
                    columnNames[1] = "sales";
                    columnNames[2] = "cost1";
                    var result = rc.HideColumn(uri,columnNames,null);
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                }
            }
    
            static void Main(string[] args)
            {
                Program obj = new Program();
                IReportClient rc = obj.getClient();
                obj.hidecolumn(rc);
            }
        }
    }
    
    package main
    
    import (
            "fmt"
            "zoho/pkg/reportclient"
    
    )
    
    var(
            email = "user@zoho.com"
            dbname = "Employee"
            tbname = "sample"
            authtoken = "f7d016b46be276cas21asd2a592f40101"
    )
    
    func hidecolumn(){
            url := reportclient.GetUri(email, dbname, tbname)
            columnnames := []string{"Cost" , "Cost1" , "Sales"}
            params := map[string]string{}
            result , err := reportclient.HideColumn(url, columnnames, params)
            if(err != nil){
            fmt.Println(err.ErrorMessage)
            fmt.Println(err.ErrorCode)
            fmt.Println(err.Action)
            fmt.Println(err.HttpStatusCode)
            }else{
            fmt.Println(result)
            }
    }
    
    func main() {
            reportclient.SetAuthToken(authtoken)
            hidecolumn()
    }
    
    import com.adventnet.zoho.client.report.*;
    
    public class Sample 
    {
        String email = "user@zoho.com";
        String dbname = "EmployeeDB";
        String tbname = "EmployeeTB";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
    
        private ReportClient rc = new ReportClient(authtoken);
    
        public void hidecolumn() throws Exception
        {
            String uri = rc.getURI(email,dbname,tbname);
            List columnNames = new ArrayList(); 
            columnNames.add("Cost");
            columnNames.add("Cost1");
            Map result = rc.hideColumn(uri, columnNames, null);
        }
    
        public static void main(String[] args) throws Exception 
        {
            Sample obj = new Sample();
            obj.hidecolumn();
        }
    }
    
    <?php
        require 'ReportClient.php';
    
        $EMAIL_ID = "abc@zoho.com";
        $DB_NAME = "EmployeeDB";
        $TABLE_NAME = "EmployeeTB";
        $AUTHTOKEN = "f7d016b46be2763wasda32a592f40101";
    
        $report_client_request = new ReportClient($AUTHTOKEN); 
    
        $uri = $request->getURI($EMAIL_ID, $DB_NAME, $TABLE_NAME);
        $columnNames = array("Cost","Cost1");
        $response = $request->hideColumn($uri ,$columnNames);
    ?>
    
    from __future__ import with_statement
    from ReportClient import ReportClient
    import sys
    
    class Sample:
    
        LOGINEMAILID="abc@zoho.com"
        AUTHTOKEN="f7d016b46be276ca12fa32a592f40101"
        DATABASENAME="Employee"
        TABLENAME="Employee"
        rc = None
        rc = ReportClient(self.AUTHTOKEN)
    
        def hidecolumn(self,rc):
        uri = rc.getURI(self.LOGINEMAILID,self.DATABASENAME,self.TABLENAME)
        params = []
        params.append("Cost")
        params.append("Cost1")
        params.append("Sales")
        result = rc.hideColumn(uri,params)
        print result
    
    obj = Sample()
    obj.hidecolumn(obj.rc)
    
    curl -d "ZOHO_ACTION=HIDECOLUMN&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML
             &ZOHO_API_VERSION=1.0&authtoken=f7d016b46be276cd4cfa32a592f40101
             &ZOHO_COLUMNNAME=Region"
             https://reportsapi.zoho.com/api/abc@zoho.com/SalesDB/Sales
    
    

    Sample Response XML Format:

    <?xml version="1.0" encoding="UTF-8" ?>
    <response uri="/api/user@zoho.com/Auto-Copy/Auto" action="HIDECOLUMN">
        <result>
            <column columnName="cost" status="Success" message="column hidden successfully"> </column>
        </result>
    </response>
    
    

    Sample Response JSON Format:

    {
      "response": {
        "uri": "/api/user@zoho.com/Auto-Copy/Auto",
        "action": "HIDECOLUMN",
        "result": [
          {
            "columnName": "cost",
            "status": "Success",
            "message": "column hidden successfully"
          }
        ]
      }
    }
    
    

    The Hide Column API is used to hide the column in Zoho Reports Table. The account Administrator and the Database Owner alone can use this API to hide a column in the Zoho Reports table.

    URL

    https://reportsapi.zoho.com/api/<Email>/<Databasename>/<Tablename>

    Note: In case of database owner hiding a column, they need to specify the login E-mail ID of the account Administrator only.

    URL 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.
    authtoken user authtoken Auth Token is an unique token that authenticates the user to access the Zoho Account.
    ZOHO_API_VERSION 1.0 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.

    URL PARAMETERS

    Parameter Name Possible Values Description
    ZOHO_COLUMNNAME
    (mandatory)
    <columnname> The name of the column to be hidden in Zoho Reports Table. Example: ZOHO_COLUMNNAME=Region.
    Note:More than one param is allowed.

    Possible Error Codes In HIDE COLUMN

    7103 , 7107 , 7138 , 8504 , 8506 , 8516 , 8533


    Show Column

    Download client libraries : C# | GO | JAVA | PHP | PYTHON



    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zoho.com";
        DBNAME = "EmployeeDB";
        TBNAME = "EmployeeTB";
    
        class Program
        {
            public IReportClient getClient()
            {
                IReportClient RepClient = new ReportClient(AUTHTOKEN);
                return RepClient;
            }
    
            public void showcolumn(IReportClient rc)
            {
                try
                {
                    string uri = rc.GetURI(EMAIL, DBNAME, TBNAME);
                    string[] columnNames = new string[3];
                    columnNames[0] = "cost";
                    columnNames[1] = "sales";
                    columnNames[2] = "cost1";
                    var result = rc.ShowColumn(uri,columnNames,null);
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                }
            }
    
            static void Main(string[] args)
            {
                Program obj = new Program();
                IReportClient rc = obj.getClient();
                obj.showcolumn(rc);
            }
        }
    }
    
    package main
    
    import (
            "fmt"
            "zoho/pkg/reportclient"
    
    )
    
    var(
            email = "user@zoho.com"
            dbname = "Employee"
            tbname = "sample"
            authtoken = "f7d016b46be276cas21asd2a592f40101"
    )
    
    func showcolumn(){
            url := reportclient.GetUri(email, dbname, tbname)
            columnnames := []string{"Cost" , "Cost1" , "Sales"}
            params := map[string]string{}
            result , err := reportclient.ShowColumn(url, columnnames, params)
            if(err != nil){
            fmt.Println(err.ErrorMessage)
            fmt.Println(err.ErrorCode)
            fmt.Println(err.Action)
            fmt.Println(err.HttpStatusCode)
            }else{
            fmt.Println(result)
            }
    }
    
    func main() {
            reportclient.SetAuthToken(authtoken)
            showcolumn()
    }
    
    import com.adventnet.zoho.client.report.*;
    
    public class Sample 
    {
        String email = "user@zoho.com";
        String dbname = "EmployeeDB";
        String tbname = "EmployeeTB";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
    
        private ReportClient rc = new ReportClient(authtoken);
    
        public void showcolumn() throws Exception
        {
            String uri = rc.getURI(email,dbname,tbname);
            List columnNames = new ArrayList(); 
            columnNames.add("Cost");
            columnNames.add("Cost1");
            Map result = rc.showColumn(uri, columnNames, null);
        }
    
        public static void main(String[] args) throws Exception 
        {
            Sample obj = new Sample();
            obj.showcolumn();
        }
    }
    
    <?php
        require 'ReportClient.php';
    
        $EMAIL_ID = "abc@zoho.com";
        $DB_NAME = "EmployeeDB";
        $TABLE_NAME = "EmployeeTB";
        $AUTHTOKEN = "f7d016b46be2763wasda32a592f40101";
    
        $report_client_request = new ReportClient($AUTHTOKEN); 
    
        $uri = $request->getURI($EMAIL_ID, $DB_NAME, $TABLE_NAME);
        $columnNames = array("Cost","Cost1");
        $response = $request->showColumn($uri ,$columnNames);
    ?>
    
    from __future__ import with_statement
    from ReportClient import ReportClient
    import sys
    
    class Sample:
    
        LOGINEMAILID="abc@zoho.com"
        AUTHTOKEN="f7d016b46be276ca12fa32a592f40101"
        DATABASENAME="Employee"
        TABLENAME="Employee"
        rc = None
        rc = ReportClient(self.AUTHTOKEN)
    
        def showcolumn(self,rc):
        uri = rc.getURI(self.LOGINEMAILID,self.DATABASENAME,self.TABLENAME)
        params = []
        params.append("Cost")
        params.append("Cost1")
        params.append("Sales")
        result = rc.showColumn(uri,params)
        print result
    
    obj = Sample()
    obj.showcolumn(obj.rc)
    
    curl -d "ZOHO_ACTION=SHOWCOLUMN&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML
             &ZOHO_API_VERSION=1.0&authtoken=f7d016b46be276cd4cfa32a592f40101
             &ZOHO_COLUMNNAME=Region"
             https://reportsapi.zoho.com/api/abc@zoho.com/SalesDB/Sales
    

    Sample Response XML Format:

    <?xml version="1.0" encoding="UTF-8" ?>
    <response uri="/api/user@zoho.com/Auto-Copy/Auto" action="SHOWCOLUMN">
        <result>
            <column columnName="cost" status="Success" message="column shown successfully"> </column>
        </result>
    </response>
    
    

    Sample Response JSON Format:

    {
      "response": {
        "uri": "/api/user@zoho.com/Auto-Copy/Auto",
        "action": "SHOWCOLUMN",
        "result": [
          {
            "columnName": "cost",
            "status": "Success",
            "message": "column shown successfully"
          }
        ]
      }
    }
    
    

    The Show Column API is used to show the column in Zoho Reports Table. The account Administrator and the Database Owner alone can use this API to show the column in the Zoho Reports table.

    URL

    https://reportsapi.zoho.com/api/<Email>/<Databasename>/<Tablename>

    Note: In case of database owner showing a column, they need to specify the login E-mail ID of the account Administrator only.

    URL 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.
    authtoken user authtoken Auth Token is an unique token that authenticates the user to access the Zoho Account.
    ZOHO_API_VERSION 1.0 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.

    URL PARAMETERS

    Parameter Name Possible Values Description
    ZOHO_COLUMNNAME
    (mandatory)
    <columnname> The name of the column to be shown in Zoho Reports Table. Example: ZOHO_COLUMNNAME=Region.
    Note:More than one param is allowed.

    Possible Error Codes In SHOW COLUMN

    7103 , 7107 , 7138 , 8504 , 8506 , 8516 , 8533


    Add Lookup

    Download client libraries : C# | GO | JAVA | PHP | PYTHON



    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zoho.com";
        DBNAME = "EmployeeDB";
        TBNAME = "EmployeeTB";
    
        class Program
        {
            public IReportClient getClient()
            {
                IReportClient RepClient = new ReportClient(AUTHTOKEN);
                return RepClient;
            }
    
            public void addlookup(IReportClient rc)
            {
                string uri = rc.GetURI(EMAIL, DBNAME, TBNAME);
                string columnname = "Id";
                string reftable = "sales";
                string refcolumn = "Srno";
                string onerror = "ABORT";
                rc.AddLookup(uri, columnname, reftable, refcolumn, onerror, null);
            }
    
            static void Main(string[] args)
            {
                Program obj = new Program();
                IReportClient rc = obj.getClient();
                obj.addlookup(rc);
            }
        }
    }
    
    package main
    
    import (
            "fmt"
            "zoho/pkg/reportclient"
    
    )
    
    var(
            email = "user@zoho.com"
            dbname = "Employee"
            tbname = "sample"
            authtoken = "f7d016b46be276cas21asd2a592f40101"
    )
    
    func addlookup() {
            url := reportclient.GetUri(email, dbname, tbname)
            columnname := "total"
            refertable := "New"
            refercolumn := "Count"
            onerror := "ABORT"
            err := reportclient.AddLookup(url, columnname, refertable, refercolumn
                                            , onerror)
            if(err != nil){
                    fmt.Println(err.ErrorMessage)
                    fmt.Println(err.ErrorCode)
                    fmt.Println(err.Action)
                    fmt.Println(err.HttpStatusCode)
            }else{
                    fmt.Println("Success")
            }
    }
    
    func main() {
            reportclient.SetAuthToken(authtoken)
            addlookup()
    }
    
    import com.adventnet.zoho.client.report.*;
    
    public class Sample 
    {
        String email = "user@zoho.com";
        String dbname = "EmployeeDB";
        String tbname = "EmployeeTB";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
    
        public void addlookup() throws Exception
        {
            String uri = rc.getURI(email,dbname,tbname);
            rc.addLookup(uri,"Id","New Db","Srno","ABORT",config);
        }
    
        public static void main(String[] args) throws Exception 
        {
            Sample obj = new Sample();
            obj.addlookup();
        }
    }
    
    <?php
        require 'ReportClient.php';
    
        $EMAIL_ID = "abc@zoho.com";
        $DB_NAME = "EmployeeDB";
        $TABLE_NAME = "EmployeeTB";
        $AUTHTOKEN = "f7d016b46be2763wasda32a592f40101";
    
        $report_client_request = new ReportClient($AUTHTOKEN); 
    
        $uri = $report_client_request->getURI($EMAIL_ID, $DB_NAME, $TABLE_NAME);
        $column_name = "Id";
        $referred_table = "Sales";
        $referred_column = "Srno";
        $on_error = "ABORT";
        $report_client_request->addLookup($uri, $column_name, $referred_table, 
                       $referred_column, $on_error);
    ?>
    
    from __future__ import with_statement
    from ReportClient import ReportClient
    import sys
    
    class Sample:
    
        LOGINEMAILID="abc@zoho.com"
        AUTHTOKEN="f7d016b46be276ca12fa32a592f40101"
        DATABASENAME="Employee"
        TABLENAME="Employee"
        rc = None
        rc = ReportClient(self.AUTHTOKEN)
    
        def addlookup(self,rc):
            uri = rc.getURI(self.LOGINEMAILID,self.DATABASENAME,self.TABLENAME)
            result = rc.addLookup(uri,"id","NewDb","srno","ABORT")
    
    obj = Sample()
    obj.addlookup(obj.rc)
    
    curl -d "ZOHO_ACTION=ADDLOOKUP&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML&
             ZOHO_API_VERSION=1.0&authtoken=f7d016b46be276cd4cfa32a592f40101&
             ZOHO_COLUMNNAME="old"&ZOHO_REFERREDTABLE="new"&
             ZOHO_REFERREDCOLUMN="old"&ZOHO_IFERRORONCONVERSION="ABORT"" 
             https://reportsapi.zoho.com/api/abc@zoho.com/Employee/Employee
    
    

    Sample Response XML Format:

    <?xml version="1.0" encoding="UTF-8" ?>
    <response uri="/api/abc@zoho.com/Employee/Employee" action="ADDLOOKUP">
        <result>SUCCESS</result>
    </response>
    
    

    Sample Response JSON Format:

    {
        "response":
        {
            "uri":"\/api\/abc@zoho.com\/Employee\/Employee",
            "action":"ADDLOOKUP",
            "result":"SUCCESS"
        }
    }
    
    

    The Add Lookup API is used to Adds the lookup in the specified child table.

    URL

    https://reportsapi.zoho.com/api/<Email>/<Databasename>/<Tablename>

    URL PARAMETERS

    Parameter Name Possible Values Description
    ZOHO_ACTION ADDLOOKUP 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.
    authtoken user authtoken Auth Token is an unique token that authenticates the user to access the Zoho Account.
    ZOHO_API_VERSION 1.0 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.

    URL PARAMETERS

    Parameter Name Possible Values Description
    ZOHO_COLUMNNAME
    (mandatory)
    <columnname> The name of the column to be added into Zoho Reports Table.
    Example:ZOHO_COLUMNNAME=Region .
    Note: The column name should be url encoded if the column name contain space or any special characters.
    ZOHO_REFERREDTABLE
    (mandatory)
    Table name The name of the referred table.
    ZOHO_REFERREDCOLUMN
    (mandatory)
    Column name The name of the column in the referred table.
    ZOHO_IFERRORONCONVERSION
    (mandatory)
    ABORT/EMPTY If error on conversion.

    Possible Error Codes In ADD LOOKUP

    7103 , 7107 , 7138 , 8504 , 8506 , 8516 , 8533


    Remove Lookup

    Download client libraries : C# | GO | JAVA | PHP | PYTHON



    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zoho.com";
        DBNAME = "EmployeeDB";
        TBNAME = "EmployeeTB";
    
        class Program
        {
            public IReportClient getClient()
            {
                IReportClient RepClient = new ReportClient(AUTHTOKEN);
                return RepClient;
            }
    
            public void removelookup(IReportClient rc)
            {
                string uri = rc.GetURI(EMAIL, DBNAME, TBNAME);
                string columnname = "Salary";
                rc.RemoveLookup(uri, columnname, null);
            }
    
            static void Main(string[] args)
            {
                Program obj = new Program();
                IReportClient rc = obj.getClient();
                obj.removelookup(rc);
            }
        }
    }
    
    package main
    
    import (
            "fmt"
            "zoho/pkg/reportclient"
    
    )
    
    var(
            email = "user@zoho.com"
            dbname = "Employee"
            tbname = "sample"
            authtoken = "f7d016b46be276cas21asd2a592f40101"
    )
    
    func removelookup() {
            url := reportclient.GetUri(email, dbname, tbname)
            columnname := "total"
            err := reportclient.RemoveLookup(url, columnname)
            if(err != nil){
                    fmt.Println(err.ErrorMessage)
                    fmt.Println(err.ErrorCode)
                    fmt.Println(err.Action)
                    fmt.Println(err.HttpStatusCode)
            }else{
                    fmt.Println("Success")
            }
    }
    
    func main() {
            reportclient.SetAuthToken(authtoken)
            removelookup()
    }
    
    import com.adventnet.zoho.client.report.*;
    
    public class Sample 
    {
        String email = "user@zoho.com";
        String dbname = "EmployeeDB";
        String tbname = "EmployeeTB";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
    
        public void removelookup() throws Exception
        {
            String uri = rc.getURI(email,dbname,tbname);
            rc.removeLookup(uri,"EmpName",config);
        }
    
        public static void main(String[] args) throws Exception 
        {
            Sample obj = new Sample();
            obj.removelookup();
        }
    }
    
    <?php
        require 'ReportClient.php';
    
        $EMAIL_ID = "abc@zoho.com";
        $DB_NAME = "EmployeeDB";
        $TABLE_NAME = "EmployeeTB";
        $AUTHTOKEN = "f7d016b46be2763wasda32a592f40101";
    
        $report_client_request = new ReportClient($AUTHTOKEN); 
    
        $uri = $report_client_request->getURI($EMAIL_ID, $DB_NAME, $TABLE_NAME);
        $column_name = "Id";
        $report_client_request->removeLookup($uri, $column_name);
    ?>
    
    from __future__ import with_statement
    from ReportClient import ReportClient
    import sys
    
    class Sample:
    
        LOGINEMAILID="abc@zoho.com"
        AUTHTOKEN="f7d016b46be276ca12fa32a592f40101"
        DATABASENAME="Employee"
        TABLENAME="Employee"
        rc = None
        rc = ReportClient(self.AUTHTOKEN)
    
        def removelookup(self,rc):
            uri = rc.getURI(self.LOGINEMAILID,self.DATABASENAME,self.TABLENAME)
            result = rc.removeLookup(uri,"Id")
    
    obj = Sample()
    obj.removelookup(obj.rc)
    
    curl -d "ZOHO_ACTION=REMOVELOOKUP&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=JSON&
             ZOHO_API_VERSION=1.0&authtoken=f7d016b46be276cd4cfa32a592f40101&
             ZOHO_COLUMNNAME="new"" 
             https://reportsapi.zoho.com/api/abc@zoho.com/Employee/Employee
    
    

    Sample Response XML Format:

    <?xml version="1.0" encoding="UTF-8" ?>
    <response uri="/api/abc@zoho.com/Employee/Employee" action="REMOVELOOKUP">
        <result>SUCCESS</result>
    </response>
    
    
    

    Sample Response JSON Format:

    {
        "response":
        {
            "uri":"\/api\/abc@zoho.com\/Employee\/Employee",
            "action":"REMOVELOOKUP",
            "result":"SUCCESS"
        }
    }
    
    

    The Remove Lookup API is used to Removes the lookup for the specified column in the given table.

    URL

    https://reportsapi.zoho.com/api/<Email>/<Databasename>/<Tablename>

    URL PARAMETERS

    Parameter Name Possible Values Description
    ZOHO_ACTION REMOVELOOKUP 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.
    authtoken user authtoken Auth Token is an unique token that authenticates the user to access the Zoho Account.
    ZOHO_API_VERSION 1.0 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.

    URL PARAMETERS

    Parameter Name Possible Values Description
    ZOHO_COLUMNNAME
    (mandatory)
    <columnname> The name of the column to be added into Zoho Reports Table.
    Example:ZOHO_COLUMNNAME=Region .
    Note: The column name should be url encoded if the column name contain space or any special characters.

    Possible Error Codes In REMOVE LOOKUP

    7103 , 7107 , 7138 , 8504 , 8506 , 8516 , 8533


    Error codes in Modeling API

    Sample error XML format:

    
    <response uri="/api/abc@zoho.com/Employee" action="COPYDATABASE">
        <error> 
            <code>7103</code>
            <message>
            Database not found! Please check whether the database exists
            </message>
        </error>
    </response>
    
    

    Sample error JSON format:

    {
        "response": 
        {
            "uri": "\/api\/abc@zoho.com\/Employee",
            "action": "COPYDATABASE",
            "error": 
            {
            "code":7103,
            "message": "Database not found! Please check whether 
                                   the database exists"
            } 
        }
    }
    

    This section lists all possible error response codes that could be sent from the Zoho Reports server on failure of Modeling APIs. You can use this for appropriate error handling.

    Error Codes

    Error-Code Reason Solution
    7101 Database with the same name exists already. Provide an alternate name.
    7103 The Database Name mentioned in the API URL does not exist. Check the database name in the request URL and provide a valid database name.
    7105 View name specified in the database does not exist. Provide a valid view name.
    7107 The column is not present in the specified Zoho Reports 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 database. Provide an alternate name.
    7128 The column with the same name is already exists in the Zoho Reports 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 database. 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 Reports 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 database specified is a system database (dedicated database created for other Zoho Service integrations) which cannot be deleted. The system database cannot be deleted.
    8023 You do not have required permission to perform this operation. Kindly contact our support team.
    8024 Copy database operation not allowed. Check the database 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 database. Check the destination database and create the missing tables.
    15001 A column which is needed to copy the specified report is missing in the destination database. Check the destination database 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 database. Check the destination database and create the formula column before copying the report.
    15005 The report name specified already exists in the destination database. Check whether the report with the same name exists in the destination database. Try renaming the source report or the report in destination database and invoke the API again.
    15007 Insufficient privileges to copy the report. Check whether the Copy Database Key is valid.
    15009 The formula column name specified already exists in the destination database. Check whether the formula column is already copied, otherwise, try renaming the formula column in the source table or in the destination database 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 Database. Check the reports specified in the ZOHO_VIEWTOCOPY parameter are correct and are available.

    In case of any error other than the above said, mail the API request URL parameters and error response details to support@zohoreports.com. Zoho Reports 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 databases,tables, reports and dashboards created in Zoho Reports.


    Database Metadata

    Download client libraries : C# | GO | JAVA | PHP | PYTHON



    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zoho.com";
        DBNAME = "EmployeeDB";
    
        class Program
        {
            public IReportClient getClient()
            {
                IReportClient RepClient = new ReportClient(AUTHTOKEN);
                return RepClient;
            }
    
            public void getDatabaseMetaData(IReportClient RepClient)
            {
                string dbURI = RepClient.GetURI(EMAIL, DBNAME);
                string metaData = "ZOHO_CATALOG_INFO";
                string format = "XML"
                string result = RepClient.GetDatabaseMetaData(dbURI, metaData, format, null);
            }
    
            static void Main(string[] args)
            {
                Program obj = new Program();
                IReportClient rc = obj.getClient();
                obj.getDatabaseMetaData(rc);
            }
        }
    }
    
    package main
    
    import (
            "fmt"
            "zoho/pkg/reportclient"
    
    )
    
    var(
            email = "user@zoho.com"
            authtoken = "f7d016b46be276cas21asd2a592f40101"
    )
    
    func databasemetadata() {
            url := reportclient.GetUserUri(email)
            metadata := "ZOHO_CATALOG_LIST"
            data , err := reportclient.GetDatabaseMetadata(url, metadata)
            if(err != nil){
                    fmt.Println(err.ErrorMessage)
                    fmt.Println(err.ErrorCode)
                    fmt.Println(err.Action)
                    fmt.Println(err.HttpStatusCode)
            }else{
                    fmt.Println(data)
            }
    }
    
    func main() {
            reportclient.SetAuthToken(authtoken)
            databasemetadata()
    }
    
    import java.util.HashMap;
    import java.util.Map;
    
    import org.w3c.dom.Document;
    
    import com.adventnet.zoho.client.report.*;
    
    public class Sample
    {
    
            String authtoken = "f7d016b46be272s4r1fa32a592f40101";
            String email = "abc@zoho.com";
            Map<String, String> config = new HashMap<String, String>();
    
            private ReportClient rc = new ReportClient(authtoken);
    
            public void metadata() throws Exception
            {
                    String uri = rc.getURI(email);
                    Document result = rc.getDatabaseMetaData(uri,"ZOHO_CATALOG_LIST",config);
            }
    
            public static void main(String[] args)
            throws Exception
            {
                    Sample obj = new Sample();
                    obj.metadata();
            }
    }
    
    <?php
        require 'ReportClient.php';
    
        $EMAIL_ID = "abc@zoho.com";
        $AUTHTOKEN = "f7d016b46be2763wasda32a592f40101";
    
        $report_client_request = new ReportClient($AUTHTOKEN); 
    
        $uri = $report_client_request->getUserURI($EMAIL_ID);
        $metadata = "ZOHO_CATALOG_LIST";
        $report_client_response = $report_client_request->getDatabaseMetadata($uri, $metadata);
    ?>
    
    from __future__ import with_statement
    from ReportClient import ReportClient
    import sys
    
    class Sample:
    
        LOGINEMAILID="abc@zoho.com"
        AUTHTOKEN="f7d016b46be276ca12fa32a592f40101"
        rc = None
        rc = ReportClient(self.AUTHTOKEN)
    
        def getdatabasemetadata(self,rc):
            uri = rc.getUserURI(self.LOGINEMAILID)
            result = rc.getDatabaseMetadata(uri,"ZOHO_CATALOG_LIST")
            print result
    
    obj = Sample()
    obj.getdatabasemetadata(obj.rc)
    
    curl -d "ZOHO_ACTION=DATABASEMETADATA&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=
             XML&ZOHO_API_VERSION=1.0&authtoken=f7d016b46be276cd4cfa32a592f40101
             &ZOHO_METADATA=ZOHO_CATALOG_LIST" 
             https://reportsapi.zoho.com/api/abc@zoho.com
    
    

    Sample Response XML Format:

    <response URI="/api/abc@zoho.com" ACTION="ZOHO_CATALOG_LIST">
        <ZCATALOGS>
            <ZCATALOG IS_DEFAULT="1" TABLE_CAT="SalesDB"></ZCATALOG>
            <ZCATALOG IS_DEFAULT="0" TABLE_CAT="Super Store Sales"></ZCATALOG>
            <ZCATALOG IS_DEFAULT="0" TABLE_CAT="Project Manager"></ZCATALOG>
        </ZCATALOGS>
    </response>
    
    
    

    Sample Response JSON Format:

    {
        "response": 
        {
            "uri": "\/api\/abc@zoho.com",
            "action": "ZOHO_CATALOG_LIST",
            "result": 
            [ 
            {
                "isDefault": true,
                "tableCat": "SalesDB"
            }, 
            {
                "isDefault": false,
                "tableCat": "Super Store Sales"
            },
            {
                "isDefault": false,
                "tableCat": "Project Manager"
            } 
            ]
        }
    }
    
    

    Sample Responses for Catalog Information

    XML Format:

    <response URI="/api/abc@zoho.com/SalesDB" ACTION="ZOHO_CATALOG_INFO">
        <ZCATALOG TABLE_CAT="SalesDB">
        <ZVIEW REMARKS="\N" TABLE_NAME="SalesTable" TABLE_TYPE="TABLE">
        <ZCOLUMNS>
            <ZCOLUMN COLUMN_NAME="REGION" PKCOLUMN_NAME="\N" NULLABLE="true"
            COLUMN_SIZE="100"PKTABLE_NAME="\N" DATA_TYPE="12" REMARKS="\N" 
            TYPE_NAME="Plain Text" 
            DECIMAL_DIGITS="-1" ORDINAL_POSITION="1"></ZCOLUMN>
            <ZCOLUMN COLUMN_NAME="Order Date" PKCOLUMN_NAME="\N" NULLABLE="true" 
            COLUMN_SIZE="19" 
            PKTABLE_NAME="\N" DATA_TYPE="93" REMARKS="\N" TYPE_NAME="Date" 
            DECIMAL_DIGITS="-1" ORDINAL_POSITION="6"></ZCOLUMN>
        </ZCOLUMNS>
        </ZVIEW>
        <ZVIEW REMARKS="\N" TABLE_NAME="Region" TABLE_TYPE="REPORT"></ZVIEW>
        <ZVIEW REMARKS="\N" TABLE_NAME="SalesTabular" TABLE_TYPE="REPORT">
        <ZVIEW REMARKS="\N" TABLE_NAME="SalesQuery" TABLE_TYPE="VIEW">
        <ZCOLUMNS>
            <ZCOLUMN COLUMN_NAME="Market Type" PKCOLUMN_NAME="\N"NULLABLE="false"
            COLUMN_SIZE="100" 
            PKTABLE_NAME="\N" DATA_TYPE="12" REMARKS="\N" TYPE_NAME="Plain Text" 
            DECIMAL_DIGITS="-1" ORDINAL_POSITION="1"></ZCOLUMN>
            <ZCOLUMN COLUMN_NAME="Order Date" PKCOLUMN_NAME="\N"NULLABLE="false"
            COLUMN_SIZE="19" 
            PKTABLE_NAME="\N" DATA_TYPE="93" REMARKS="\N" TYPE_NAME="Date" 
            DECIMAL_DIGITS="-1" ORDINAL_POSITION="2"></ZCOLUMN>
        </ZCOLUMNS>
        </ZVIEW>
        <ZVIEW REMARKS="\N" TABLE_NAME="SalesPivot" TABLE_TYPE="REPORT"></ZVIEW>
        <ZVIEW REMARKS="\N" TABLE_NAME="SalesSummary" TABLE_TYPE="REPORT"></ZVIEW>
    </response>
    
    

    JSON Format:

    {
        "response": 
        {
            "uri": "\/api\/abc@zoho.com\/SalesDB",
            "action": "ZOHO_CATALOG_INFO",
            "result": 
            {
                "views": 
                [ 
                {
                    "remarks": null,
                    "tableName": "SalesTable",
                    "tableType": "TABLE",
                    "columns": 
                    [ 
                    {
                        "columnName": "REGION",
                        "pkcolumnName": null,
                        "nullable": true,
                        "columnSize": 100,
                        "pktableName": null,
                        "dataType": "12",
                        "remarks": null,
                        "typeName": "Plain Text",
                        "decimalDigits": -1,
                        "ordinalPosition": 1
                    }, 
                    {
                        "columnName": "Order Date",
                        "pkcolumnName": null,
                        "nullable": true,
                        "columnSize": 19,
                        "pktableName": null,
                        "dataType": "93",
                        "remarks": null,
                        "typeName": "Date",
                        "decimalDigits": -1,
                        "ordinalPosition": 6
                    }
                    ]
                }, 
                {
                    "remarks": "Region wise chart for the year 2009",
                    "tableName": "Region",
                    "tableType": "REPORT",
                    "columns": 
                    [
                    ]
                },
                {
                    "remarks": null,
                    "tableName": "SalesTabular",
                    "tableType": "REPORT",
                    "columns": 
                    [
                    ]
                }, 
                {
                    "remarks": null,
                    "tableName": "SalesQuery",
                    "tableType": "VIEW",
                    "columns": 
                    [
                    {
                        "columnName": "Market Type",
                        "pkcolumnName": null,
                        "nullable": false,
                        "columnSize": 100,
                        "pktableName": null,
                        "dataType": "12",
                        "remarks": null,
                        "typeName": "Plain Text",
                        "decimalDigits": -1,
                        "ordinalPosition": 1
                    },
                    {
                        "columnName": "Order Date",
                        "pkcolumnName": null,
                        "nullable": false,
                        "columnSize": 19,
                        "pktableName": null,
                        "dataType": "93",
                        "remarks": null,
                        "typeName": "Date",
                        "decimalDigits": -1,
                        "ordinalPosition": 2
                    }
                    ]
                },
                {
                    "remarks": null,
                    "tableName": "SalesPivot",
                    "tableType": "REPORT",
                    "columns": 
                    [
                    ]
                }, 
                {
                    "remarks": null,
                    "tableName": "SalesSummary",
                    "tableType": "REPORT",
                    "columns": 
                    [
                    ]
                }
                ],
                "tableCat": "SalesDB"
            }
        }
    }
    
    

    Sample Responses for Datatype Information

    XML Format:

    <response URI="/api/abc@zoho.com" ACTION="ZOHO_DATATYPES">
        <ZDATATYPES>
            <ZDATATYPE LITERAL_PREFIX="&apos;" MAXSIZE="19" MAXIMUM_SCALE="\N" 
            NULLABLE="1" 
            TYPE_NAME="Positive Number" DATA_TYPE="-5" MINIMUM_SCALE="\N" 
            SQL_DATA_TYPE="-5" 
            FIXED_PREC_SCALE="false" LOCAL_TYPE_NAME="\N" AUTO_INCREMENT="false"
            SQL_DATETIME_SUB="0" PRECISION="-1" UNSIGNED_ATTRIBUTE="true" ID="5">
            </ZDATATYPE>
            <ZDATATYPE LITERAL_PREFIX="&apos;" MAXSIZE="1" MAXIMUM_SCALE="\N" 
            NULLABLE="1" 
            TYPE_NAME="Yes/No Decision" DATA_TYPE="-7" MINIMUM_SCALE="\N" 
            SQL_DATA_TYPE="-7" 
            FIXED_PREC_SCALE="false" LOCAL_TYPE_NAME="\N" AUTO_INCREMENT="false"
            SQL_DATETIME_SUB="0" PRECISION="-1" UNSIGNED_ATTRIBUTE="false" ID="10">
            </ZDATATYPE>
        </ZDATATYPES>
    </response>
    
    

    JSON Format

    { 
        "response": 
        {
            "uri": "\/api\/abc@zoho.com",
            "action": "ZOHO_DATATYPES",
            "result": 
            [ 
            {
                "literalPrefix": "\'",
                "maxsize": 19,
                "maximumScale": null,
                "nullable": true,
                "dataType": -5,
                "minimumScale": null,
                "sqlDataType": -5,
                "fixedPrecScale": false,
                "localTypeName": null,
                "autoIncrement": false,
                "searchable": false,
                "literalSuffix": "\'",
                "caseSensitive": true,
                "numPrecRadix": "10",
                "typeName": "Positive Number",
                "createParams": "500",
                "sqlDatetimeSub": "0",
                "precision": -1,
                "unsignedAttribute": true,
                "id": "5"
            },
            {
                "literalPrefix": "\'",
                "maxsize": 1,
                "maximumScale": null,
                "nullable": true,
                "dataType": -7,
                "minimumScale": null,
                "sqlDataType": -7,
                "fixedPrecScale": false,
                "localTypeName": null,
                "autoIncrement": false,
                "searchable": false,
                "literalSuffix": "\'",
                "caseSensitive": true,
                "numPrecRadix": "10",
                "typeName": "Yes\/No Decision",
                "createParams": "500",
                "sqlDatetimeSub": "0",
                "precision": -1,
                "unsignedAttribute": false,
                "id": "10"
            }
            ]
        }
    }
    
    

    Sample Responses for Table Types

    XML Format:

    <response URI="/api/abc@zoho.com" ACTION="ZOHO_TABLETYPES">
        <ZVIEWTYPES >
            <ZVIEWTYPE TYPE="TABLE"></ZVIEWTYPE>
            <ZVIEWTYPE TYPE="VIEW"></ZVIEWTYPE>
            <ZVIEWTYPE TYPE="REPORT"></ZVIEWTYPE>
        </ZVIEWTYPES>
    </response> 
    
    

    JSON Format

    {
        "response": 
        {
            "uri": "\/api\/abc@zoho.com",
            "action": "ZOHO_TABLETYPES",
            "result": 
            [
                "TABLE",
                "VIEW",
                "REPORT"
            ]
        }
    }
    

    Using the Database Metadata API, you can get the following meta information.

    URL

    https://reportsapi.zoho.com/api/<Email>

    URL parameters

    Parameter Name Possible Values Description
    ZOHO_ACTION DATABASEMETADATA This parameter specifies the action to be performed by the API request.
    ZOHO_METADATA The supported values are:
  • ZOHO_CATALOG_LIST: To list the Zoho Reports databases for the specified user
  • ZOHO_CATALOG_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
  • specifies the information to be fetched.
    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.
    authtoken user authtoken Auth Token is an unique token that authenticates the user to access the Zoho Account.
    ZOHO_API_VERSION 1.0 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.

    1.Getting Databases (Catalog) List

    To list the Zoho Reports databases for the specified user

    URL

    https://reportsapi.zoho.com/api/<Email>

    URL parameters

    Parameter Name Possible Values Description
    ZOHO_ACTION DATABASEMETADATA This parameter specifies the action to be performed by the API request.
    ZOHO_METADATA ZOHO_CATALOG_LIST To list the Zoho Reports databases for the specified user
    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.
    authtoken user authtoken Auth Token is an unique token that authenticates the user to access the Zoho Account.
    ZOHO_API_VERSION 1.0 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.

    2.Getting Tables and Reports in a Database (Catalog Information)

    To fetch information about the tables & reports (view) present in the given reporting database in Zoho Reports.

    URL

    https://reportsapi.zoho.com/api/<Email>/<Databasename>

    URL parameters

    Parameter Name Possible Values Description
    ZOHO_ACTION DATABASEMETADATA This parameter specifies the action to be performed by the API request.
    ZOHO_METADATA ZOHO_CATALOG_INFO To fetch information about the tables & reports (view) present in the given reporting database in Zoho Reports.
    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.
    authtoken user authtoken Auth Token is an unique token that authenticates the user to access the Zoho Account.
    ZOHO_API_VERSION 1.0 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.

    3.Getting Datatype Information

    The following table lists the common DATA TYPE numbers and its corresponding TYPE NAMES.

    Data Type Number Type Name
    12 Plain Text / Multi Line Text / Email / URL
    -7 Yes / No Decision
    8 Percent / Currency / Decimal Number
    -5 Number / Auto Number / Positive Number
    93 Date

    URL

    https://reportsapi.zoho.com/api/<Email>

    URL parameters

    Parameter Name Possible Values Description
    ZOHO_ACTION DATABASEMETADATA This parameter specifies the action to be performed by the API request.
    ZOHO_METADATA ZOHO_DATATYPES To get the list of datatypes supported by Zoho Reports
    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.
    authtoken user authtoken Auth Token is an unique token that authenticates the user to access the Zoho Account.
    ZOHO_API_VERSION 1.0 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.

    4.Getting Table Types

    The following table lists the common TABLETYPES.

    Actual View TABLETYPE Value
    Tables TABLE
    Query Tables VIEW
    Charts / Pivots / Tabular Views / Summary Views / Dashboards REPORT

    URL

    https://reportsapi.zoho.com/api/<Email>

    URL parameters

    Parameter Name Possible Values Description
    ZOHO_ACTION DATABASEMETADATA This parameter specifies the action to be performed by the API request.
    ZOHO_METADATA ZOHO_TABLETYPES Various view types available in Zoho Reports
    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.
    authtoken user authtoken Auth Token is an unique token that authenticates the user to access the Zoho Account.
    ZOHO_API_VERSION 1.0 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.

    Response Attributes

    In this section, we have described the detailed explanation of the attribute / property we used in DATABASEMETADATA APIs.

    Attribute/Property Description
    IS_DEFAULT/isDefault Indicates whether a Zoho Reports database is set as the default. Can be used to set default database for third party tools that loads Zoho Reports Databases using JDBC Driver.
    TABLE_CAT/tableCat Zoho Reports database name (ex: SalesDB)
    COLUMN_NAME/columnName Name of the column in table type views (ex: Region)
    LITERAL_PREFIX Prefix character used when literal values found (ex: '45’)
    NULLABLE Will be true if the column can contain null value, false otherwise.
    MAXSIZE Maximum size of the column (ex: 20)
    TYPE_NAME Zoho Reports name for the data type (ex: Positive Number)

    Note:\N in XML response refer to the NULL value

    Getting Metadata Using JDBC Driver

    In case you are using a Java application then Zoho Reports offers a JDBC Driver and which can be used to fetch all the Zoho Reports metadata information. Refer to the page JDBC Driver for details.

    Possible Error Codes In DATABASE METADATA

    7102 , 7103 , 8504 , 8506 , 8516 , 8533


    Get Database Name

    Download client libraries : C# | GO | JAVA | PHP | PYTHON



    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zoho.com";
        DBID = 1148746000003334001;
    
        class Program
        {
            public IReportClient getClient()
            {
                IReportClient RepClient = new ReportClient(AUTHTOKEN);
                return RepClient;
            }
    
            public void getdbname(IReportClient rc)
            {
                string uri = rc.GetURI(EMAIL);
                string result = rc.GetDatabaseName(uri, DBID, null);
                Console.WriteLine(result);
            }
    
            static void Main(string[] args)
            {
                Program obj = new Program();
                IReportClient rc = obj.getClient();
                obj.getdbname(rc);
            }
        }
    }
    
    package main
    
    import (
            "fmt"
            "zoho/pkg/reportclient"
    
    )
    
    var(
            email = "user@zoho.com"
            authtoken = "f7d016b46be276cas21asd2a592f40101"
            dbid = "1148746000000004001"
    )
    
    func getdatabasename() {
            url := reportclient.GetUserUri(email)
            databasename , err := reportclient.GetDatabaseName(url, dbid)
            if(err != nil){
                    fmt.Println(err.ErrorMessage)
                    fmt.Println(err.ErrorCode)
                    fmt.Println(err.Action)
                    fmt.Println(err.HttpStatusCode)
            }else{
                    fmt.Println(databasename)
            }
    }
    
    func main() {
            reportclient.SetAuthToken(authtoken)
            getdatabasename()
    }
    
    import com.adventnet.zoho.client.report.*;
    
    public class Sample 
    {
        String email = "user@zoho.com";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        long dbid = 1148746002350004001L;
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
    
        public void getdbname() throws Exception
        {
            String uri = rc.getURI(email);
            String result =  rc.getDatabaseName(uri,dbid);
            System.out.println(result);
        }
    
        public static void main(String[] args) throws Exception 
        {
            Sample obj = new Sample();
            obj.getdbname();
        }
    }
    
    <?php
        require 'ReportClient.php';
    
        $EMAIL_ID = "abc@zoho.com";
        $AUTHTOKEN = "f7d016b46be2763wasda32a592f40101";
    
        $report_client_request = new ReportClient($AUTHTOKEN); 
    
        $uri = $report_client_request->getUserURI($EMAIL_ID);
        $db_id = 1148216975034504001;
        $database_name = $report_client_request->getDatabaseName($uri, $db_id);
    ?>
    
    from __future__ import with_statement
    from ReportClient import ReportClient
    import sys
    
    class Sample:
    
        LOGINEMAILID="abc@zoho.com"
        AUTHTOKEN="f7d016b46be276ca12fa32a592f40101"
        DBID="1148746001230004001"
        rc = None
        rc = ReportClient(self.AUTHTOKEN)
    
        def getdatabasename(self,rc):
            uri = rc.getUserURI(self.LOGINEMAILID)
            result = rc.getDatabaseName(uri,self.DBID)
            print result
    
    obj = Sample()
    obj.getdatabasename(obj.rc)
    
    curl -d "ZOHO_ACTION=GETDATABASENAME&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=
             XML&ZOHO_API_VERSION=1.0&authtoken=f7d016b46be276cd4cfa32a592f40101&
             DBID=1148746213000004001" 
             https://reportsapi.zoho.com/api/abc@zoho.com
    
    

    Sample Response XML Format:

    <response uri="/api/abc@zoho.com" action="GETDATABASENAME">
        <dbname>Employee</dbname>
    </response>
    
    

    Sample Response JSON Format:

    {
        "response": 
        {
            "uri": "\/api\/abc@zoho.com",
            "action": "GETDATABASENAME",
            "result": 
            {
                "dbname": "Employee"
            } 
        }
    }
    

    This API returns the name of a database in Zoho Reports given its Database ID as input. Database ID’s are unique identifiers that is associated with each reporting database created in Zoho Reports.

    URL

    https://reportsapi.zoho.com/api/<Email>

    URL PARAMETERS

    Parameter Name Possible Values Description
    ZOHO_ACTION GETDATABASENAME 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.
    authtoken user authtoken Auth Token is an unique token that authenticates the user to access the Zoho Account.
    ZOHO_API_VERSION 1.0 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.

    URL PARAMETERS

    Parameter Name Possible Values Description
    DBID
    (mandatory)
    A Long number like 9999999999999 The DBID of the Zoho Reports Online Reporting Database which can be taken from database URL

    Possible Error Codes In GET DATABASE NAME

    7103 , 7104 , 8504 , 8506 , 8516 , 8533


    Is Database Exist

    Download client libraries : C# | GO | JAVA | PHP | PYTHON



    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zoho.com";
    
        class Program
        {
            public IReportClient getClient()
            {
                IReportClient RepClient = new ReportClient(AUTHTOKEN);
                return RepClient;
            }
    
            public void isdbexist(IReportClient rc)
            {
                try
                {
                    string uri = rc.GetURI(EMAIL);
                    bool result = rc.IsDbExist(uri, "Employee", null);
                    Console.WriteLine(result);
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                }
            }
    
            static void Main(string[] args)
            {
                Program obj = new Program();
                IReportClient rc = obj.getClient();
                obj.isdbexist(rc);
            }
        }
    }
    
    package main
    
    import (
            "fmt"
            "zoho/pkg/reportclient"
    
    )
    
    var(
            email = "user@zoho.com"
            authtoken = "f7d016b46be276cas21asd2a592f40101"
    )
    
    func isdbexist(){
            url := reportclient.GetUserUri(email)
            databasename := "Employee"
            params := map[string]string{}
            result , err := reportclient.IsDbExist(url, databasename, params)
            if(err != nil){
            fmt.Println(err.ErrorMessage)
            fmt.Println(err.ErrorCode)
            fmt.Println(err.Action)
            fmt.Println(err.HttpStatusCode)
            }else{
            fmt.Println(result)
            }
    }
    
    func main() {
            reportclient.SetAuthToken(authtoken)
            isdbexist()
    }
    
    import com.adventnet.zoho.client.report.*;
    
    public class Sample 
    {
        String email = "user@zoho.com";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
    
        private ReportClient rc = new ReportClient(authtoken);
    
        public void isdbexist() throws Exception
        {
            String uri = rc.getURI(email);
            boolean result = rc.isDbExist(uri, "Dummy", null);
        }
    
        public static void main(String[] args) throws Exception 
        {
            Sample obj = new Sample();
            obj.isdbexist();
        }
    }
    
    <?php
        require 'ReportClient.php';
    
        $EMAIL_ID = "abc@zoho.com";
        $AUTHTOKEN = "f7d016b46be2763wasda32a592f40101";
    
        $report_client_request = new ReportClient($AUTHTOKEN); 
    
        $uri = $request->getUserURI($EMAIL_ID);
        $dbname = "<db-name>";
        $result = $request->isDbExist($uri, $dbname);
    ?>
    
    from __future__ import with_statement
    from ReportClient import ReportClient
    import sys
    
    class Sample:
    
        LOGINEMAILID="abc@zoho.com"
        AUTHTOKEN="f7d016b46be276ca12fa32a592f40101"
        rc = None
        rc = ReportClient(self.AUTHTOKEN)
    
        def isdbexist(self,rc):
        uri = rc.getUserURI(self.LOGINEMAILID)
        dbname = "Dummy"
        result = rc.isDbExist(uri,dbname)
        print result
    
    obj = Sample()
    obj.isdbexist(obj.rc)
    
    curl -d "ZOHO_ACTION=ISDBEXIST&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML
             &ZOHO_API_VERSION=1.0&authtoken=f7d016b46be276cd4cfa32a592f40101&ZOHO_DB_NAME=dummy"
             https://reportsapi.zoho.com/api/abc@zoho.com
    

    Sample Response XML Format:

    <?xml version="1.0" encoding="UTF-8" ?>
    <response uri="/api/user@zoho.com" action="ISDBEXIST">
        <result>
            <isdbexist>true</isdbexist>
        </result>
    </response>
    
    

    Sample Response JSON Format:

    {
      "response": {
        "uri": "/api/user@zoho.com",
        "action": "ISDBEXIST",
        "result": {
          "isdbexist": "true"
        }
      }
    }
    
    

    The Isdbexist API is used to check wheather the database is exists or not in Zoho Reports Account. The account Administrator and the Database Owner alone can use this API to get check database in the Zoho Reports account.

    URL

    https://reportsapi.zoho.com/api/<Email>

    URL PARAMETERS

    Parameter Name Possible Values Description
    ZOHO_ACTION ISDBEXIST 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.
    authtoken user authtoken Auth Token is an unique token that authenticates the user to access the Zoho Account.
    ZOHO_API_VERSION 1.0 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.

    URL PARAMETERS

    Parameter Name Possible Values Description
    ZOHO_DB_NAME
    (mandatory)
    <databasename> This parameter holds the name of the database

    Possible Error Codes In IS DATABASE EXIST

    8504 , 8506 , 8516 , 8533


    Get Database Key

    Download client libraries : C# | GO | JAVA | PHP | PYTHON



    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zoho.com";
        DBNAME = "EmployeeDB";
    
        class Program
        {
            public IReportClient getClient()
            {
                IReportClient RepClient = new ReportClient(AUTHTOKEN);
                return RepClient;
            }
    
            public void 
    (IReportClient RepClient)
            {
                string dbURI = RepClient.GetURI(EMAIL, DBNAME);
                string key = RepClient.GetCopyDBKey(dbURI, null);
            }
    
            static void Main(string[] args)
            {
                Program obj = new Program();
                IReportClient rc = obj.getClient();
                obj.copyDatabaseKey(rc);
            }
        }
    }
    
    package main
    
    import (
            "fmt"
            "zoho/pkg/reportclient"
    
    )
    
    var(
            email = "user@zoho.com"
            dbname = "Employee"
            authtoken = "f7d016b46be276cas21asd2a592f40101"
            dbkey = "d6e443b4dc3cas421fcc54ff81cd3ad3"
    )
    
    func getcopydbkey() {
        url := reportclient.GetDbUri(email, dbname)
        dbkey , err := reportclient.GetCopyDbKey(url)
        if(err != nil){
            fmt.Println(err.ErrorMessage)
            fmt.Println(err.ErrorCode)
            fmt.Println(err.Action)
            fmt.Println(err.HttpStatusCode)
        }else{
            fmt.Println(dbkey)
        }
    }
    
    func main() {
            reportclient.SetAuthToken(authtoken)
            getcopydbkey()
    }
    
    import com.adventnet.zoho.client.report.*;
    
    public class Sample 
    {
        String email = "user@zoho.com";
        String dbname = "EmployeeDB";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
    
        public void copydatabasekey() throws Exception
        {
            String uri = rc.getURI(email,dbname);
            String key = rc.getCopyDBKey(uri, null);
        }
    
        public static void main(String[] args) throws Exception 
        {
            Sample obj = new Sample();
            obj.copydatabasekey();
        }
    }
    
    <?php
        require 'ReportClient.php';
    
        $EMAIL_ID = "abc@zoho.com";
        $DB_NAME = "EmployeeDB";
        $AUTHTOKEN = "f7d016b46be2763wasda32a592f40101";
    
        $report_client_request = new ReportClient($AUTHTOKEN); 
    
        $uri = $request->getDbURI($EMAIL_ID, $DB_NAME);
        $database_key = $request->getCopyDbKey($uri);
    ?>
    
    from __future__ import with_statement
    from ReportClient import ReportClient
    import sys
    
    class Sample:
    
        LOGINEMAILID="abc@zoho.com"
        AUTHTOKEN="f7d016b46be276ca12fa32a592f40101"
        DATABASENAME="Employee"
        rc = None
        rc = ReportClient(self.AUTHTOKEN)
    
        def CopyDatabaseKey(self,rc):
            uri = rc.getDBURI(self.LOGINEMAILID,self.DATABASENAME)
            result = rc.getCopyDBKey(self.uri)
    
    obj = Sample()
    obj.CopyDatabaseKey(obj.rc)
    
    curl -d "ZOHO_ACTION=GETCOPYDBKEY&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML
             &ZOHO_API_VERSION=1.0&authtoken=f7d016b46be2ewcd4cfa32a592f40101"
             https://reportsapi.zoho.com/api/abc@zoho.com/Employee
    
    

    Sample Response XML Format:

    <?xml version="1.0" encoding="UTF-8" ?>
    <response uri="/api/user@zoho.com/Auto-Copy" action="GETCOPYDBKEY">
        <result>
            <copydbkey>42005e8f0a6804c8adfdffeda24d4f92</copydbkey>
        </result>
    </response>
    
    

    Sample Response JSON Format:

    {
      "response": {
        "uri": "/api/user@zoho.com/Auto-Copy",
        "action": "GETCOPYDBKEY",
        "result": {
          "copydbkey": "42005e8f0a6804aadawf3fada24d4f92"
        }
      }
    }
    
    

    The Get Database Key API is used to get the particular database key.

    URL

    https://reportsapi.zoho.com/api/<Email>/<Databasename>

    URL PARAMETERS

    Parameter Name Possible Values Description
    ZOHO_ACTION GETCOPYDBKEY 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.
    authtoken user authtoken Auth Token is an unique token that authenticates the user to access the Zoho Account.
    ZOHO_API_VERSION 1.0 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.

    Possible Error Codes In COPY DATABASE KEY

    7102 , 7103 , 8504 , 8506 , 8516 , 8533


    Get View Name

    Download client libraries : C# | GO | JAVA | PHP | PYTHON



    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zoho.com";
        OBJID = 1148746037400004006;
    
        class Program
        {
            public IReportClient getClient()
            {
                IReportClient RepClient = new ReportClient(AUTHTOKEN);
                return RepClient;
            }
    
            public void getviewname(IReportClient rc)
            {
                string uri = rc.GetURI(EMAIL);
                string result = rc.GetViewName(uri, OBJID, null);
                Console.WriteLine(result);
            }
    
            static void Main(string[] args)
            {
                Program obj = new Program();
                IReportClient rc = obj.getClient();
                obj.getviewname(rc);
            }
        }
    }
    
    package main
    
    import (
            "fmt"
            "zoho/pkg/reportclient"
    
    )
    
    var(
            email = "user@zoho.com"
            authtoken = "f7d016b46be276cas21asd2a592f40101"
            objid = "1148746000000004006"
    )
    
    func getviewname() {
            url := reportclient.GetUserUri(email)
            viewname , err := reportclient.GetViewname(url, objid)
            if(err != nil){
                    fmt.Println(err.ErrorMessage)
                    fmt.Println(err.ErrorCode)
                    fmt.Println(err.Action)
                    fmt.Println(err.HttpStatusCode)
            }else{
                    fmt.Println(viewname)
            }
    }
    
    func main() {
            reportclient.SetAuthToken(authtoken)
            getviewname()
    }
    
    import com.adventnet.zoho.client.report.*;
    
    public class Sample 
    {
        String email = "user@zoho.com";
        String dbname = "EmployeeDB";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        long objid = 1148746000033204006L;
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
    
        public void getviewname() throws Exception
        {
            String uri = rc.getURI(email,dbname);
            String result =  rc.getViewName(uri,objid,config);
            System.out.println(result);
        }
    
        public static void main(String[] args) throws Exception 
        {
            Sample obj = new Sample();
            obj.getviewname();
        }
    }
    
    <?php
        require 'ReportClient.php';
    
        $EMAIL_ID = "abc@zoho.com";
        $AUTHTOKEN = "f7d016b46be2763wasda32a592f40101";
    
        $report_client_request = new ReportClient($AUTHTOKEN);
    
        $uri = $report_client_request->getUserURI($EMAIL_ID);
        $objid = 1148746000000001206;
        $view_name = $report_client_request->getViewName($uri, $objid);
    ?>
    
    from __future__ import with_statement
    from ReportClient import ReportClient
    import sys
    
    class Sample:
    
        LOGINEMAILID="abc@zoho.com"
        AUTHTOKEN="f7d016b46be276ca12fa32a592f40101"
        ODBID="1148746001230004001"
        rc = None
        rc = ReportClient(self.AUTHTOKEN)
    
        def getviewname(self,rc):
            uri = rc.getUserURI(self.LOGINEMAILID)
            result = rc.getViewName(uri,self.OBJID)
            print result
    
    obj = Sample()
    obj.getviewname(obj.rc)
    
    curl -d "ZOHO_ACTION=GETVIEWNAME&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML
             &ZOHO_API_VERSION=1.0&authtoken=f7d016b46be276as3cfa32a592f40101
             &OBJID=1148746000000001206" 
             https://reportsapi.zoho.com/api/abc@zoho.com
    
    

    Sample Response XML Format:

    <response uri="/api/abc@zoho.com" action="GETVIEWNAME">
        <viewname>Employee Details</viewname>
    </response>
    
    

    Sample Response JSON Format:

    {
        "response": 
        {
            "uri": "\/api\/abc@zoho.com",
            "action": "GETVIEWNAME",
            "result": 
            {
                "viewname": "Employee Details"
            } 
        }
    }
    

    This API returns the name of a view in Zoho Reports given its View ID as input. View ID’s are unique identifiers that is associated with each view (tables, reports and dashboards) that is created in Zoho Reports.

    URL

    https://reportsapi.zoho.com/api/<Email>

    URL PARAMETERS

    Parameter Name Possible Values Description
    ZOHO_ACTION GETVIEWNAME 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.
    authtoken user authtoken Auth Token is an unique token that authenticates the user to access the Zoho Account.
    ZOHO_API_VERSION 1.0 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.

    URL PARAMETERS:

    Parameter Name Possible Values Description
    OBJID
    (mandatory)
    A Long number like 9999999999999 The ID of the view which can be taken from the corresponding view URL.

    Possible Error Codes In GET VIEW NAME

    7104 , 7106 , 8504 , 8506 , 8516 , 8533


    Get Info

    Download client libraries : C# | GO | JAVA | PHP | PYTHON



    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zoho.com";
        DBNAME = "EmployeeDB";
        TBNAME = "EmployeeTB";
    
        class Program
        {
            public IReportClient getClient()
            {
                IReportClient RepClient = new ReportClient(AUTHTOKEN);
                return RepClient;
            }
    
            public void getinfo(IReportClient rc)
            {
                string uri = rc.GetURI(EMAIL, DBNAME, TBNAME);
                var result = rc.GetInfo(uri, null);
                foreach (KeyValuePair<string, long> kvp in result)
                {
                    Console.WriteLine(kvp.Key + " " + kvp.Value);
                }
            }
    
            static void Main(string[] args)
            {
                Program obj = new Program();
                IReportClient rc = obj.getClient();
                obj.getinfo(rc);
            }
        }
    }
    
    package main
    
    import (
            "fmt"
            "zoho/pkg/reportclient"
    
    )
    
    var(
            email = "user@zoho.com"
            dbname = "Employee"
            tbname = "sample"
            authtoken = "f7d016b46be276cas21asd2a592f40101"
    )
    
    func getinfo() {
            url := reportclient.GetUri(email, dbname, tbname)
            info , err := reportclient.GetInfo(url)
            if(err != nil){
                    fmt.Println(err.ErrorMessage)
                    fmt.Println(err.ErrorCode)
                    fmt.Println(err.Action)
                    fmt.Println(err.HttpStatusCode)
            }else{
                    fmt.Println(info)
            }
    }
    
    func main() {
            reportclient.SetAuthToken(authtoken)
            getinfo()
    }
    
    import com.adventnet.zoho.client.report.*;
    
    public class Sample 
    {
        String email = "user@zoho.com";
        String dbname = "EmployeeDB";
        String tbname = "EmployeeTB";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
    
        public void getinfo() throws Exception
        {
            String uri = rc.getURI(email,dbname,tbname);
            Map result =  rc.getInfo(uri,config);
            System.out.println(result);
        }
    
        public static void main(String[] args) throws Exception 
        {
            Sample obj = new Sample();
            obj.getinfo();
        }
    }
    
    <?php
        require 'ReportClient.php';
    
        $EMAIL_ID = "abc@zoho.com";
        $DB_NAME = "EmployeeDB";
        $TABLE_NAME = "EmployeeTB";
    
        $report_client_request = new ReportClient($AUTHTOKEN);
    
        $uri = $report_client_request->getURI($EMAIL_ID, $DB_NAME, $TABLE_NAME);
        $report_info = $report_client_request->getInfo($uri);
    ?>
    
    from __future__ import with_statement
    from ReportClient import ReportClient
    import sys
    
    class Sample:
    
        LOGINEMAILID="abc@zoho.com"
        AUTHTOKEN="f7d016b46be276ca12fa32a592f40101"
        DATABASENAME="Employee"
        TABLENAME="Employee"
        rc = None
        rc = ReportClient(self.AUTHTOKEN)
    
        def getinfo(self,rc):
            uri = rc.getURI(self.LOGINEMAILID,self.DATABASENAME,self.TABLENAME)
            result = rc.getInfo(uri)
            print result
    
    obj = Sample()
    obj.getinfo(obj.rc)
    
    curl -d "ZOHO_ACTION=GETINFO&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML
             &ZOHO_API_VERSION=1.0&authtoken=f7d016b46be276cd4cfa32a592f40101" 
             https://reportsapi.zoho.com/api/abc@zoho.com/Employee/EmployeeDetails
    
    

    Sample Response XML Format:

    <response uri="/api/abc@zoho.com/Employee/EmployeeDetails" action="GETINFO">
        <objid>99999999999999</objid>
        <dbid>88888888888888</dbid>
    </response>
    
    

    Sample Response JSON Format:

    {
        "response": 
        {
            "uri": "\/api\/abc@zoho.com\/Employee\/EmployeeDetails",
            "action": "GETINFO",
            "result": 
            {
                "objid": "99999999999999",
                "dbid": "88888888888888"
            } 
        }
    }
    

    This API returns the Database ID (DBID) and View ID (OBJID) of the corresponding Database and View Name provided as input for the API.

    URL

    https://reportsapi.zoho.com/api/<Email>/<Databasename>/<Tablename>

    URL PARAMETERS

    Parameter Name Possible Values Description
    ZOHO_ACTION GETINFO 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.
    authtoken user authtoken Auth Token is an unique token that authenticates the user to access the Zoho Account.
    ZOHO_API_VERSION 1.0 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.

    Possible Error Codes In GET INFO

    7102 , 7103 , 7104 , 8504 , 8506 , 8516 , 8533


    Error codes in Metadata API

    sample error XML Format:

    
    <response uri="/api/abc@zoho.com/Employee" action="DATABASEMETADATA">
        <error> 
            <code>7103</code>
            <message>
            Database not found! Please check whether the database exists
            </message>
        </error>
    </response>
    
    

    sample error JSON Format:

    {
        "response": 
        {
            "uri": "\/api\/abc@zoho.com\/Employee",
            "action": "DATABASEMETADATA",
            "error": 
            {
            "code":7103,
            "message": "Database not found! Please check whether 
                                   the database exists"
            } 
        }
    }
    

    This section lists all possible error response codes that could be sent from the Zoho Reports server on failure of Metadata APIs. You can use this for appropriate error handling.

    Error Codes

    Error-Code Reason Solution
    7102 The database name specified in the API request URL is empty. Check the API Request URL and provide a valid Database Name.
    7103 The Database Name mentioned in the API URL does not exist. Check the database name in the request URL and provide a valid database name.
    7104 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.
    7106 View id not present in the database. Provide a valid OBJID.
    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@zohoreports.com. Zoho Reports Team will get back to you with the best possible solution.

    Sharing and 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.


    Share View(s)

    Download client libraries : C# | GO | JAVA | PHP | PYTHON



    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zoho.com";
        DBNAME = "EmployeeDB";
    
        class Program
        {
            public IReportClient getClient()
            {
                IReportClient RepClient = new ReportClient(AUTHTOKEN);
                return RepClient;
            }
    
            public void shareview(IReportClient rc)
            {
                string uri = rc.GetURI(EMAIL, DBNAME);
                string emails = "user1@zoho.com";
                string views = "Employee";
                Dictionary<string, string> dic = new Dictionary<string, string>();
                dic.Add("ZOHO_READ", "true");
                rc.ShareView(uri, emails, views, dic);
            }
    
            static void Main(string[] args)
            {
                Program obj = new Program();
                IReportClient rc = obj.getClient();
                obj.shareview(rc);
            }
        }
    }
    
    package main
    
    import (
            "fmt"
            "zoho/pkg/reportclient"
    
    )
    
    var(
            email = "user@zoho.com"
            dbname = "Employee"
            authtoken = "f7d016b46be276cas21asd2a592f40101"
    )
    
    func shareview() {
            url := reportclient.GetDbUri(email, dbname)
            emailids := "user1@zoho.com"
            views := "view1"
            params := map[string]string{}
            params["ZOHO_READ"] = "true"
            err := reportclient.ShareView(url, emailids, views, params)
            if(err != nil){
                    fmt.Println(err.ErrorMessage)
                    fmt.Println(err.ErrorCode)
                    fmt.Println(err.Action)
                    fmt.Println(err.HttpStatusCode)
            }else{
                    fmt.Println("Success")
            }
    }
    
    func main() {
            reportclient.SetAuthToken(authtoken)
            shareview()
    }
    
    import com.adventnet.zoho.client.report.*;
    
    public class Sample 
    {
        String email = "user@zoho.com";
        String dbname = "EmployeeDB";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        String emails = "abc@zoho.com";
        String views = "new";
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
    
        public void shareview() throws Exception
        {
            String uri = rc.getURI(email,dbname);
            config.put("ZOHO_READ", true);
            rc.shareView(uri,views,emails,config);
        }
    
        public static void main(String[] args) throws Exception 
        {
            Sample obj = new Sample();
            obj.shareview();
        }
    }
    
    <?php
        require 'ReportClient.php';
    
        $EMAIL_ID = "abc@zoho.com";
        $DB_NAME = "EmployeeDB";
        $AUTHTOKEN = "f7d016b46be2763wasda32a592f40101";
    
        $report_client_request = new ReportClient($AUTHTOKEN); 
    
        $uri = $report_client_request->getDbURI($EMAIL_ID, $DB_NAME);
        $emails = "user@zoho.com";
        $views = "viewname";
        $criteria = NULL;
        $premissions = array('ZOHO_READ' => "true");
        $report_client_request->shareView($uri, $emails, $views, $criteria, $permissions);
    ?>
    
    from __future__ import with_statement
    from ReportClient import ReportClient
    import sys
    
    class Sample:
    
        LOGINEMAILID="abc@zoho.com"
        AUTHTOKEN="f7d016b46be276ca12fa32a592f40101"
        DATABASENAME="Employee"
        rc = None
        rc = ReportClient(self.AUTHTOKEN)
    
        def shareview(self,rc):
            uri = rc.getDBURI(self.LOGINEMAILID,self.DATABASENAME)
            permissions = {"ZOHO_READ":"true"}
            rc.shareView(uri,"user@zoho.com","Employee",None,permissions)
    
    obj = Sample()
    obj.shareview(obj.rc)
    
    curl -d "ZOHO_ACTION=SHARE&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML&
             ZOHO_API_VERSION=1.0&authtoken=f7d016bd23e276cd4cfa32a592f40101&
             ZOHO_VIEWS=new&ZOHO_EMAILS=abc@zoho.com&ZOHO_READ=true" 
             https://reportsapi.zoho.com/api/abc@zoho.com/Employee
    
    

    Sample Response XML Format:

    <?xml version="1.0" encoding="UTF-8" ?>
    <response uri="/api/abc@zoho.com/EmployeeDB" action="SHARE">
        <result>success</result>
    </response>
    
    

    Sample Response JSON Format:

    {
        "response":
        {
            "uri": "/api/abc@zoho.com/EmployeeDB",
            "action": "SHARE",
            "result": "success"
        }
    }
    

    With the Zoho Reports Share API, you can share the views (tables/reports/dashboards) created in Zoho Reports with users. The Share API also allows you to the revoke sharing permission granted. It is recommended that you go through the documentation - Sharing and Collaboration, before using the API for better understanding.

    Note: Sharing permissions can be updated by calling 'Share’ again (over riding the existing share permissions).

    URL

    https://reportsapi.zoho.com/api/<Email>/<Databasename>

    URL PARAMETERS

    Parameter Possible Values Description
    ZOHO_ACTION SHARE 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.
    authtoken user authtoken Auth Token is an unique token that authenticates the user to access the Zoho Account.
    ZOHO_API_VERSION 1.0 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

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

    POST parameters (URL Encoded)

    Parameter Possible Values Description Remarks
    ZOHO_VIEWS Table1,View1,View2,My View List of views which are to be shared. Multiple views can be shared by providing them separated by comma.
    Note: ZOHO_VIEWS is encoded in URL encoding format. Value without encoding is given below:
    ZOHO_VIEWS=Table1,View1,View2,My View
    Mandatory Parameter
    ZOHO_EMAILS user1@finepick.com, user2@finepick.com User email addresses as comma separated values to whom the views need to be shared.
    Note: ZOHO_EMAILS is encoded in URL encoding format. Value without encoding is given below:
    ZOHO_EMAILS=user1@finepick.com,user2@finepick.com
    Mandatory Parameter
    ZOHO_DOMAINNAME
    (Only for White Label customers)
    Domain name It’s used to share views to the whitelabel domain. Optional

    POST parameters for fine-grained permissions (At least one parameter is required from the below)

    Parameter Allowed Values Default value Description
    ZOHO_READ true or false false Read Access to the view
    ZOHO_EXPORT true or false false Export permission for a view
    ZOHO_VUD true or false false Permission to view underlying data in a Chart / Pivot / Summary view
    ZOHO_DRILLDOWN true or false false Permission to drill down in a Chart
    ZOHO_ADDROW true or false false Permission to add a row in the table
    ZOHO_UPDATEROW true or false false Permission to update a row in the table
    ZOHO_DELETEROW true or false false Permission to delete a row in the table
    ZOHO_DELETEALLROWS true or false false Permission to delete all rows in the table
    ZOHO_IMPORT_APPEND true or false false Permission to import data into the table using APPEND option
    ZOHO_IMPORT_ADDORUPDATE true or false false Permission to import data into the table using ADD or UPDATE option i.e new rows will be appended and existing rows will be updated based on the matching columns provided in IMPORT action
    ZOHO_IMPORT_DELETEALLADD true or false false Permission to import data into the table using the option: deleting all the existing records and adding the new records
    ZOHO_SHARE true or false false Permission to share the table / view to others

    Other Parameters

    Parameter Allowed Values Default Value Description Remarks
    ZOHO_CRITERIA Filter Criteria should be specified in the format as given in the example below. It is similar to a WHERE clause in SQL languages. Read More ZOHO_CRITERIA:
    This parameter allows you to apply a filter criteria while sharing a view to users. The specified criteria will be applied on the reports shared, there by filtering the data viewed, when the report is accessed by the shared user.
    Refer the below link to use ZOHO_CRITERIA:
    Criteria
    ZOHO_INHERIT_PARENT_CRITERIA true or false false This is valid only for reports(not tables). If true, then its parent tables’ criteria is also taken into account while sharing
    ZOHO_INVITE_MAIL true or false false Whether to send an invitation mail on sharing For White Label Customers:
    If this parameter is set to 'true’, use your white label domain URL instead of reportsapi.zoho.com in the Share API request.
    ZOHO_MAIL_SUBJECT Required only if ZOHO_INVITE_MAIL is true
    ZOHO_MAIL_MESSAGE
    ZOHO_INVITE_MAIL_CCME true or false false Whether to CC the invitation mail to you on sharing This parameter is valid only if ZOHO_INVITE_MAIL is true

    Possible Error Codes In SHARE VIEWS

    7103 , 8026 , 8027 , 8509 , 8504 , 8506 , 8516 , 8533


    Remove Sharing

    Download client libraries : C# | GO | JAVA | PHP | PYTHON



    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zoho.com";
        DBNAME = "EmployeeDB";
    
        class Program
        {
            public IReportClient getClient()
            {
                IReportClient RepClient = new ReportClient(AUTHTOKEN);
                return RepClient;
            }
    
            public void removeshare(IReportClient rc)
            {
                string uri = rc.GetURI(EMAIL, DBNAME);
                string emails = "user1@zoho.com";
                Dictionary<string, string> dic = new Dictionary<string, string>();
                dic.Add("ZOHO_VIEWS", "Employee"); 
                rc.RemoveShare(uri, emails,dic);
            }
    
            static void Main(string[] args)
            {
                Program obj = new Program();
                IReportClient rc = obj.getClient();
                obj.removeshare(rc);
            }
        }
    }
    
    package main
    
    import (
            "fmt"
            "zoho/pkg/reportclient"
    
    )
    
    var(
            email = "user@zoho.com"
            dbname = "Employee"
            authtoken = "f7d016b46be276cas21asd2a592f40101"
    )
    
    func removeshare() {
            url := reportclient.GetDbUri(email, dbname)
            emailids := "user1@zoho.com"
            params := map[string]string{}
            params["ZOHO_ALLVIEWS"] = "true"
            err := reportclient.RemoveShare(url, emailids, params)
            if(err != nil){
                    fmt.Println(err.ErrorMessage)
                    fmt.Println(err.ErrorCode)
                    fmt.Println(err.Action)
                    fmt.Println(err.HttpStatusCode)
            }else{
                    fmt.Println("Success")
            }
    }
    
    func main() {
            reportclient.SetAuthToken(authtoken)
            removeshare()
    }
    
    import com.adventnet.zoho.client.report.*;
    
    public class Sample 
    {
        String email = "user@zoho.com";
        String dbname = "EmployeeDB";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        String emails = "abc@zoho.com";
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
    
        public void removeshare() throws Exception
        {
            String uri = rc.getURI(email,dbname);
            config.put("ZOHO_ALLVIEWS", true);
            rc.removeShare(uri,emails,config);
        }
    
        public static void main(String[] args) throws Exception 
        {
            Sample obj = new Sample();
            obj.removeshare();
        }
    }
    
    <?php
        require 'ReportClient.php';
    
        $EMAIL_ID = "abc@zoho.com";
        $DB_NAME = "EmployeeDB";
        $AUTHTOKEN = "f7d016b46be2763wasda32a592f40101";
    
        $report_client_request = new ReportClient($AUTHTOKEN);
    
        $uri = $report_client_request->getDbURI($EMAIL_ID, $DB_NAME);
        $emails = "user@zoho.com";
        $permissions = array('ZOHO_ALLVIEWS' => "true");
        $report_client_request->removeShare($uri, $emails, $permissions);
    ?>
    
    from __future__ import with_statement
    from ReportClient import ReportClient
    import sys
    
    class Sample:
    
        LOGINEMAILID="abc@zoho.com"
        AUTHTOKEN="f7d016b46be276ca12fa32a592f40101"
        DATABASENAME="Employee"
        rc = None
        rc = ReportClient(self.AUTHTOKEN)
    
        def removeshare(self,rc):
            uri = rc.getDBURI(self.LOGINEMAILID,self.DATABASENAME)
            params = {"ZOHO_ALLVIEWS":"true"}
            rc.removeShare(uri,"user@zoho.com",params)
    
    obj = Sample()
    obj.removeshare(obj.rc)
    
    curl -d "ZOHO_ACTION=REMOVESHARE&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML&
             ZOHO_API_VERSION=1.0&authtoken=f7d016b46be2sw2d4cfa32a592f40101&
             ZOHO_EMAILS=abc@zoho.com&ZOHO_ALLVIEWS=true" 
             https://reportsapi.zoho.com/api/abc@zoho.com/Employee
    
    

    Sample Response XML Format:

    <?xml version="1.0" encoding="UTF-8" ?>
    <response uri="/api/abc@zoho.com/EmployeeDB" action="REMOVESHARE">
        <result>success</result>
    </response>
    
    

    Sample Response JSON Format:

    {
        "response":
        {
            "uri": "/api/abc@zoho.com/EmployeeDB",
            "action": "REMOVESHARE",
            "result": "success"
        }
    }
    

    With the Zoho Reports Database Owner API, you can add / remove the database owners. It is recommended that you go through the documentation on Multiple Database Owners, before using the API for better understanding.

    URL

    https://reportsapi.zoho.com/api/<Email>/<Databasename>

    URL PARAMETERS

    Parameter Possible Values Description
    ZOHO_ACTION REMOVESHARE 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.
    authtoken user authtoken Auth Token is an unique token that authenticates the user to access the Zoho Account.
    ZOHO_API_VERSION 1.0 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

    POST parameters (URL Encoded)

    Parameter Possible Values Default Value Description Remarks
    ZOHO_VIEWS Table1,View1,View2,My View Views whose sharing need to be removed. Multiple views can be passed using comma separator.
    Note: ZOHO_VIEWS is encoded in URL encoding format. Value without encoding is given below:
    ZOHO_VIEWS=Table1,View1,View2,My View
    Any one of the parameter (ZOHO_VIEWS or ZOHO_ALLVIEWS) is a mandatory Parameter.
    ZOHO_ALLVIEWS true or false false If true passed to this parameter it will remove the sharing for all the views which are shared to the corresponding users
    (users identified by the email addresses passed in the parameter ZOHO_EMAILS)
    Any one of the parameter (ZOHO_VIEWS or ZOHO_ALLVIEWS) is a mandatory Parameter.
    ZOHO_EMAILS user1@finepick.com, user2@finepick.com User email addresses as comma separated values to whom the sharing need to be removed for the specified views
    Note: ZOHO_EMAILS is encoded in URL encoding format. Value without encoding is given below:
    ZOHO_EMAILS=user1@finepick.com,user2@finepick.com
    Mandatory Parameter
    ZOHO_DOMAINNAME
    (Only for White Label customers)
    Domain name It’s used to remove shared views from the whitelabel domain. Optional

    Possible Error Codes In REMOVE SHARE

    7003 , 7103 , 8027 , 8509 , 8504 , 8506 , 8516 , 8533


    Add Database Owner

    Download client libraries : C# | GO | JAVA | PHP | PYTHON



    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zoho.com";
        DBNAME = "EmployeeDB";
    
        class Program
        {
            public IReportClient getClient()
            {
                IReportClient RepClient = new ReportClient(AUTHTOKEN);
                return RepClient;
            }
    
            public void adddbowner(IReportClient rc)
            {
                string uri = rc.GetURI(EMAIL, DBNAME);
                string emails = "user@zoho.com";
                rc.AddDbOwner(uri, emails, null);
            }
    
            static void Main(string[] args)
            {
                Program obj = new Program();
                IReportClient rc = obj.getClient();
                obj.adddbowner(rc);
            }
        }
    }
    
    package main
    
    import (
            "fmt"
            "zoho/pkg/reportclient"
    
    )
    
    var(
            email = "user@zoho.com"
            dbname = "Employee"
            authtoken = "f7d016b46be276cas21asd2a592f40101"
    )
    
    func adddbowner() {
            url := reportclient.GetDbUri(email, dbname)
            emailids := "user1@zoho.com"
            params := map[string]string{}
            err := reportclient.AddDbOwner(url, emailids, params)
            if(err != nil){
                    fmt.Println(err.ErrorMessage)
                    fmt.Println(err.ErrorCode)
                    fmt.Println(err.Action)
                    fmt.Println(err.HttpStatusCode)
            }else{
                    fmt.Println("Success")
            }
    }
    
    func main() {
            reportclient.SetAuthToken(authtoken)
            adddbowner()
    }
    
    import com.adventnet.zoho.client.report.*;
    
    public class Sample 
    {
        String email = "user@zoho.com";
        String dbname = "EmployeeDB";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        String emails = "abc@zoho.com";
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
    
        public void adddbowner() throws Exception
        {
            String uri = rc.getURI(email,dbname);
            rc.addDbOwner(uri,emails,config);
        }
    
        public static void main(String[] args) throws Exception 
        {
            Sample obj = new Sample();
            obj.adddbowner();
        }
    }
    
    <?php
        require 'ReportClient.php';
    
        $EMAIL_ID = "abc@zoho.com";
        $DB_NAME = "EmployeeDB";
        $AUTHTOKEN = "f7d016b46be2763wasda32a592f40101";
    
        $report_client_request = new ReportClient($AUTHTOKEN); 
    
        $uri = $report_client_request->getDbURI($EMAIL_ID, $DB_NAME);
        $emails = "user@zoho.com";
        $report_client_request->addDbOwner($uri, $emails);
    ?>
    
    from __future__ import with_statement
    from ReportClient import ReportClient
    import sys
    
    class Sample:
    
        LOGINEMAILID="abc@zoho.com"
        AUTHTOKEN="f7d016b46be276ca12fa32a592f40101"
        DATABASENAME="Employee"
        rc = None
        rc = ReportClient(self.AUTHTOKEN)
    
        def adddbowner(self,rc):
            uri = rc.getDBURI(self.LOGINEMAILID,self.DATABASENAME)
            rc.addDbOwner(uri,"user@zoho.com")
    
    obj = Sample()
    obj.adddbowner(obj.rc)
    
    curl -d "ZOHO_ACTION=ADDDBOWNER&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML
             &ZOHO_API_VERSION=1.0&authtoken=f7d016b46be276cd4cfa32a592f40101
             &ZOHO_EMAILS=user@zoho.com" 
             https://reportsapi.zoho.com/api/abc@zoho.com/EmployeeDB
    
    

    Sample Response XML Format:

    <?xml version="1.0" encoding="UTF-8" ?>
    <response uri="/api/abc@zoho.com/EmployeeDB" action="ADDDBOWNER">
        <result>success</result>
    </response>
    
    

    Sample Response JSON Format:

    {
        "response":
        {
            "uri": "/api/abc@zoho.com/EmployeeDB",
            "action": "ADDDBOWNER",
            "result": "success"
        }
    }
    

    This api used to add database owner for the particular database.

    URL

    https://reportsapi.zoho.com/api/<Email>/<Databasename>

    URL PARAMETERS

    Parameter Possible Values Description
    ZOHO_ACTION ADDDBOWNER 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.
    authtoken user authtoken Auth Token is an unique token that authenticates the user to access the Zoho Account.
    ZOHO_API_VERSION 1.0 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

    POST parameters (URL Encoded)

    Parameter Possible Values Description Remarks
    ZOHO_EMAILS user1@finepick.com, user2@finepick.com User email addresses as comma separated values to whom the sharing need to be removed for the specified views
    Note: ZOHO_EMAILS is encoded in URL encoding format. Value without encoding is given below:
    ZOHO_EMAILS=user1@finepick.com,user2@finepick.com
    Mandatory Parameter
    ZOHO_DOMAINNAME
    (Only for White Label customers)
    Domain name It’s used to add database owner to the whitelabel domain. Optional

    Other Parameters

    Parameter Allowed Values Default Value Description Remarks
    ZOHO_INVITE_MAIL true or false false Whether to send an invitation mail on sharing For White Label Customers:
    If this parameter is set to 'true’, use your white label domain URL instead of reportsapi.zoho.com in the Share API request.
    ZOHO_MAIL_SUBJECT Required only if ZOHO_INVITE_MAIL is true
    ZOHO_MAIL_MESSAGE

    Possible Error Codes In ADD DATABASE OWNER

    7103 , 8504 , 8506 , 8509 , 8516 , 8533


    Remove Database Owner

    Download client libraries : C# | GO | JAVA | PHP | PYTHON



    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zoho.com";
        DBNAME = "EmployeeDB";
    
        class Program
        {
            public IReportClient getClient()
            {
                IReportClient RepClient = new ReportClient(AUTHTOKEN);
                return RepClient;
            }
    
            public void removedbowner(IReportClient rc)
            {
                string uri = rc.GetURI(EMAIL, DBNAME);
                string emails = "user@zoho.com";
                rc.RemoveDbOwner(uri, emails, null);
            }
    
            static void Main(string[] args)
            {
                Program obj = new Program();
                IReportClient rc = obj.getClient();
                obj.removedbowner(rc);
            }
        }
    }
    
    package main
    
    import (
            "fmt"
            "zoho/pkg/reportclient"
    
    )
    
    var(
            email = "user@zoho.com"
            dbname = "Employee"
            authtoken = "f7d016b46be276cas21asd2a592f40101"
    )
    
    func removedbowner() {
            url := reportclient.GetDbUri(email, dbname)
            emailids := "user1@zoho.com"
            params := map[string]string{}
            err := reportclient.RemoveDbOwner(url, emailids, params)
            if(err != nil){
                    fmt.Println(err.ErrorMessage)
                    fmt.Println(err.ErrorCode)
                    fmt.Println(err.Action)
                    fmt.Println(err.HttpStatusCode)
            }else{
                    fmt.Println("Success")
            }
    }
    
    func main() {
            reportclient.SetAuthToken(authtoken)
            removedbowner()
    }
    
    import com.adventnet.zoho.client.report.*;
    
    public class Sample 
    {
        String email = "user@zoho.com";
        String dbname = "EmployeeDB";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        String emails = "abc@zoho.com";
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
    
        public void removedbowner() throws Exception
        {
            String uri = rc.getURI(email,dbname);
            rc.removeDbOwner(uri,emails,config);
        }
    
        public static void main(String[] args) throws Exception 
        {
            Sample obj = new Sample();
            obj.removedbowner();
        }
    }
    
    <?php
        require 'ReportClient.php';
    
        $EMAIL_ID = "abc@zoho.com";
        $DB_NAME = "EmployeeDB";
        $AUTHTOKEN = "f7d016b46be2763wasda32a592f40101";
    
        $report_client_request = new ReportClient($AUTHTOKEN); 
    
        $uri = $report_client_request->getDbURI($EMAIL_ID, $DB_NAME);
        $emails = "user@zoho.com";
        $report_client_request->removeDbOwner($uri, $emails);
    ?>
    
    from __future__ import with_statement
    from ReportClient import ReportClient
    import sys
    
    class Sample:
    
        LOGINEMAILID="abc@zoho.com"
        AUTHTOKEN="f7d016b46be276ca12fa32a592f40101"
        DATABASENAME="Employee"
        rc = None
        rc = ReportClient(self.AUTHTOKEN)
    
        def removedbowner(self,rc):
            uri = rc.getDBURI(self.LOGINEMAILID,self.DATABASENAME)
            rc.removeDbOwner(uri,"user@zoho.com")
    
    obj = Sample()
    obj.removedbowner(obj.rc)
    
    curl -d "ZOHO_ACTION=REMOVEDBOWNER&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML
             &ZOHO_API_VERSION=1.0&authtoken=f7d016b46beas2cd4cfa32a592f40101
             &ZOHO_EMAILS=user@zoho.com" 
             https://reportsapi.zoho.com/api/abc@zoho.com/EmployeeDB
    
    

    Sample Response XML Format:

    <?xml version="1.0" encoding="UTF-8" ?>
    <response uri="/api/abc@zoho.com/EmployeeDB" action="REMOVEDBOWNER">
        <result>success</result>
    </response>
    
    

    Sample Response JSON Format:

    {
        "response":
        {
            "uri": "/api/abc@zoho.com/EmployeeDB",
            "action": "REMOVEDBOWNER",
            "result": "success"
        }
    }
    

    This api used to remove database owner from the particular database.

    URL

    https://reportsapi.zoho.com/api/<Email>/<Databasename>

    URL PARAMETERS

    Parameter Possible Values Description
    ZOHO_ACTION REMOVEDBOWNER 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.
    authtoken user authtoken Auth Token is an unique token that authenticates the user to access the Zoho Account.
    ZOHO_API_VERSION 1.0 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

    POST parameters (URL Encoded)

    Parameter Possible Values Description Remarks
    ZOHO_EMAILS user1@finepick.com, user2@finepick.com User email addresses as comma separated values to whom the sharing need to be removed for the specified views
    Note: ZOHO_EMAILS is encoded in URL encoding format. Value without encoding is given below:
    ZOHO_EMAILS=user1@finepick.com,user2@finepick.com
    Mandatory Parameter
    ZOHO_DOMAINNAME
    (Only for White Label customers)
    Domain name It’s used to remove database owner from the whitelabel domain. Optional

    Other Parameters

    Parameter Allowed Values Default Value Description Remarks
    ZOHO_INVITE_MAIL true or false false Whether to send an invitation mail on sharing For White Label Customers:
    If this parameter is set to 'true’, use your white label domain URL instead of reportsapi.zoho.com in the Share API request.
    ZOHO_MAIL_SUBJECT Required only if ZOHO_INVITE_MAIL is true
    ZOHO_MAIL_MESSAGE

    Possible Error Codes In REMOVE DATABASE OWNER

    7103 , 8504 , 8506 , 8509 , 8516 , 8533


    Get Share Info

    Download client libraries : C# | GO | JAVA | PHP | PYTHON



    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zoho.com";
        DBNAME = "EmployeeDB";
    
        class Program
        {
            public IReportClient getClient()
            {
                IReportClient RepClient = new ReportClient(AUTHTOKEN);
                return RepClient;
            }
    
            public void getshareinfo(IReportClient rc)
            {
                string uri = rc.GetURI(EMAIL, DBNAME);
                var result = rc.GetShareInfo(uri, null);
                var list = result.GetGroupMembers();   
            }
    
            static void Main(string[] args)
            {
                Program obj = new Program();
                IReportClient rc = obj.getClient();
                obj.getshareinfo(rc);
            }
        }
    }
    
    package main
    
    import (
            "fmt"
            "zoho/pkg/reportclient"
    
    )
    
    var(
            email = "user@zoho.com"
            dbname = "Employee"
            tbname = "sample"
            authtoken = "f7d016b46be276cas21asd2a592f40101"
    )
    
    func getshareinfo() {
            url := reportclient.GetDbUri(email, dbname)
            shareinfo , err := reportclient.GetShareInfo(url)
            if(err != nil){
                    fmt.Println(err.ErrorMessage)
                    fmt.Println(err.ErrorCode)
                    fmt.Println(err.Action)
                    fmt.Println(err.HttpStatusCode)
            }else{
                    fmt.Println(shareinfo.GroupMembers)
                    fmt.Println(shareinfo.UserInfo)
            }
    }
    
    func main() {
            reportclient.SetAuthToken(authtoken)
            getshareinfo()
    }
    
    import com.adventnet.zoho.client.report.*;
    
    public class Sample 
    {
        String email = "user@zoho.com";
        String dbname = "EmployeeDB";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
    
        public void shareinfo() throws Exception
        {
            String uri = rc.getURI(email,dbname);
            Object shareinfoobj = rc.getShareInfo(uri,config);
        }
    
        public static void main(String[] args) throws Exception 
        {
            Sample obj = new Sample();
            obj.shareinfo();
        }
    }
    
    <?php
        require 'ReportClient.php';
    
        $EMAIL_ID = "abc@zoho.com";
        $DB_NAME = "EmployeeDB";
        $AUTHTOKEN = "f7d016b46be2763wasda32a592f40101";
    
        $report_client_request = new ReportClient($AUTHTOKEN); 
    
        $uri = $report_client_request->getDbURI($EMAIL_ID, $DB_NAME);
        $report_client_response = $report_client_request->getShareInfo($uri);
    ?>
    
    from __future__ import with_statement
    from ReportClient import ReportClient
    import sys
    
    class Sample:
    
        LOGINEMAILID="abc@zoho.com"
        AUTHTOKEN="f7d016b46be276ca12fa32a592f40101"
        DATABASENAME="Employee"
        rc = None
        rc = ReportClient(self.AUTHTOKEN)
    
        def getshareinfo(self,rc):
            uri = rc.getDBURI(self.LOGINEMAILID,self.DATABASENAME)
            result = rc.getShareInfo(uri)
            print result.sharedUsers
    
    obj = Sample()
    obj.getshareinfo(obj.rc)
    
    curl -d "ZOHO_ACTION=GETSHAREINFO&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML
             &ZOHO_API_VERSION=1.0&authtoken=f7d016b46be276cd4cfa32a592f40101" 
             https://reportsapi.zoho.com/api/abc@zoho.com/SalesDB
    
    

    Sample Response XML Format:

    <?xml version="1.0" encoding="UTF-8" ?>
    <response uri="/api/abc@zoho.com/SalesDB" action="GETSHAREINFO">
      <result>
          <usershareinfo>
            <shareinfo>
                <email>user1@mydomain.com</email>
                    <permissions>
                        <perminfo viewname="Table1" sharedby="user@mydomain.com">
                            <permission>
                                <read>true</read>
                                <export>true</export>
                                <vud>false</vud>
                                <addrow>false</addrow>
                                <updaterow>false</updaterow>
                                <deleterow>false</deleterow>
                                <deleteallrows>false</deleteallrows>
                                <appendimport>false</appendimport>
                                <updateimport>false</updateimport>
                                <truncateimport>false</truncateimport>
                                <deleteupdateaddimport>false</deleteupdateaddimport>
                                <share>false</share>
                            </permission>
                        </perminfo>
                    </permissions>
            </shareinfo>
            <shareinfo>
                <email>user4@mydomain.com</email>
                    <permissions>
                        <perminfo viewname="Table1" sharedby="user@mydomain.com">
                            <permission>
                                <read>true</read>
                                <export>true</export>
                                <vud>false</vud>
                                <addrow>false</addrow>
                                <updaterow>false</updaterow>
                                <deleterow>false</deleterow>
                                <deleteallrows>false</deleteallrows>
                                <appendimport>false</appendimport>
                                <updateimport>false</updateimport>
                                <truncateimport>false</truncateimport>
                                <deleteupdateaddimport>false</deleteupdateaddimport>
                                <share>false</share>
                            </permission>
                        </perminfo>
                    </permissions>
            </shareinfo>
            <shareinfo>
                <email>user215@mydomain.com</email>
                    <permissions>
                        <perminfo viewname="finepick1" sharedby="user@mydomain.com">
                            <permission>
                                <read>true</read>
                                <export>false</export>
                                <vud>false</vud>
                                <addrow>false</addrow>
                                <updaterow>false</updaterow>
                                <deleterow>false</deleterow>
                                <deleteallrows>false</deleteallrows>
                                <appendimport>false</appendimport>
                                <updateimport>false</updateimport>
                                <truncateimport>false</truncateimport>
                                <deleteupdateaddimport>false</deleteupdateaddimport>
                                <share>false</share>
                            </permission>
                        </perminfo>
                    </permissions>
            </shareinfo>
            <shareinfo>
                <email>userlf12@mydomain.com</email>
                    <permissions>
                        <perminfo viewname="Parent" sharedby="user@mydomain.com">
                            <permission>
                                <read>true</read>
                                <export>false</export>
                                <vud>false</vud>
                                <addrow>false</addrow>
                                <updaterow>false</updaterow>
                                <deleterow>false</deleterow>
                                <deleteallrows>false</deleteallrows>
                                <appendimport>false</appendimport>
                                <updateimport>false</updateimport>
                                <truncateimport>false</truncateimport>
                                <deleteupdateaddimport>false</deleteupdateaddimport>
                                <share>false</share>
                            </permission>
                        </perminfo>
                    </permissions>
            </shareinfo>
            <shareinfo>
                <email>user33@mydomain.com</email>
                    <permissions>
                        <perminfo viewname="Parent" sharedby="user@mydomain.com">
                            <permission>
                                <read>true</read>
                                <export>false</export>
                                <vud>false</vud>
                                <addrow>false</addrow>
                                <updaterow>false</updaterow>
                                <deleterow>false</deleterow>
                                <deleteallrows>false</deleteallrows>
                                <appendimport>false</appendimport>
                                <updateimport>false</updateimport>
                                <truncateimport>false</truncateimport>
                                <deleteupdateaddimport>false</deleteupdateaddimport>
                                <share>false</share>
                            </permission>
                        </perminfo>
                        <perminfo viewname="sss" sharedby="user@mydomain.com">
                            <permission>
                                <read>true</read>
                                <export>false</export>
                                <vud>false</vud>
                                <addrow>false</addrow>
                                <updaterow>false</updaterow>
                                <deleterow>false</deleterow>
                                <deleteallrows>false</deleteallrows>
                                <appendimport>false</appendimport>
                                <updateimport>false</updateimport>
                                <truncateimport>false</truncateimport>
                                <deleteupdateaddimport>false</deleteupdateaddimport>
                                <share>false</share>
                            </permission>
                        </perminfo>
                        <perminfo viewname="Table1" sharedby="user@mydomain.com">
                            <permission>
                                <read>true</read>
                                <export>false</export>
                                <vud>false</vud>
                                <addrow>false</addrow>
                                <updaterow>false</updaterow>
                                <deleterow>false</deleterow>
                                <deleteallrows>false</deleteallrows>
                                <appendimport>false</appendimport>
                                <updateimport>false</updateimport>
                                <truncateimport>false</truncateimport>
                                <deleteupdateaddimport>false</deleteupdateaddimport>
                                <share>false</share>
                            </permission>
                        </perminfo>
                    </permissions>
            </shareinfo>
            <shareinfo>
                <email>user1@mydomain.com</email>
                    <permissions>
                        <perminfo viewname="finepick1" sharedby="user@mydomain.com">
                            <permission>
                                <read>true</read>
                                <export>false</export>
                                <vud>false</vud>
                                <addrow>false</addrow>
                                <updaterow>false</updaterow>
                                <deleterow>false</deleterow>
                                <deleteallrows>false</deleteallrows>
                                <appendimport>false</appendimport>
                                <updateimport>false</updateimport>
                                <truncateimport>false</truncateimport>
                                <deleteupdateaddimport>false</deleteupdateaddimport>
                                <share>false</share>
                            </permission>
                        </perminfo>
                    </permissions>
            </shareinfo>
            <shareinfo>
                <email>user115@mydomain.com</email>
                    <permissions>
                        <perminfo viewname="Table1" sharedby="user@mydomain.com">
                            <permission>
                                <read>true</read>
                                <export>true</export>
                                <vud>false</vud>
                                <addrow>false</addrow>
                                <updaterow>false</updaterow>
                                <deleterow>false</deleterow>
                                <deleteallrows>false</deleteallrows>
                                <appendimport>false</appendimport>
                                <updateimport>false</updateimport>
                                <truncateimport>false</truncateimport>
                                <deleteupdateaddimport>false</deleteupdateaddimport>
                                <share>false</share>
                            </permission>
                        </perminfo>
                    </permissions>
            </shareinfo>
            <shareinfo>
                <email>user11@mydomain.com</email>
                    <permissions>
                        <perminfo viewname="grp_pv1" sharedby="user@mydomain.com">
                            <permission>
                                <read>true</read>
                                <export>true</export>
                                <vud>false</vud>
                                <addrow>false</addrow>
                                <updaterow>false</updaterow>
                                <deleterow>false</deleterow>
                                <deleteallrows>false</deleteallrows>
                                <appendimport>false</appendimport>
                                <updateimport>false</updateimport>
                                <truncateimport>false</truncateimport>
                                <deleteupdateaddimport>false</deleteupdateaddimport>
                                <share>false</share>
                            </permission>
                        </perminfo>
                    </permissions>
            </shareinfo>
            <shareinfo>
                <email>user214@mydomain.com</email>
                    <permissions>
                        <perminfo viewname="finepick1" sharedby="user@mydomain.com">
                            <permission>
                                <read>true</read>
                                <export>false</export>
                                <vud>false</vud>
                                <addrow>false</addrow>
                                <updaterow>false</updaterow>
                                <deleterow>false</deleterow>
                                <deleteallrows>false</deleteallrows>
                                <appendimport>false</appendimport>
                                <updateimport>false</updateimport>
                                <truncateimport>false</truncateimport>
                                <deleteupdateaddimport>false</deleteupdateaddimport>
                                <share>false</share>
                            </permission>
                        </perminfo>
                    </permissions>
            </shareinfo>
            <shareinfo>
                <email>user104@mydomain.com</email>
                    <permissions>
                        <perminfo viewname="Table1" sharedby="user@mydomain.com">
                            <permission>
                                <read>true</read>
                                <export>true</export>
                                <vud>false</vud>
                                <addrow>false</addrow>
                                <updaterow>false</updaterow>
                                <deleterow>false</deleterow>
                                <deleteallrows>false</deleteallrows>
                                <appendimport>false</appendimport>
                                <updateimport>false</updateimport>
                                <truncateimport>false</truncateimport>
                                <deleteupdateaddimport>false</deleteupdateaddimport>
                                <share>false</share>
                            </permission>
                        </perminfo>
                    </permissions>
            </shareinfo>
            <shareinfo>
                <email>user10@mydomain.com</email>
                    <permissions>
                        <perminfo viewname="Table2" sharedby="user@mydomain.com">
                            <permission>
                                <read>true</read>
                                <export>false</export>
                                <vud>false</vud>
                                <addrow>false</addrow>
                                <updaterow>false</updaterow>
                                <deleterow>false</deleterow>
                                <deleteallrows>false</deleteallrows>
                                <appendimport>false</appendimport>
                                <updateimport>false</updateimport>
                                <truncateimport>false</truncateimport>
                                <deleteupdateaddimport>false</deleteupdateaddimport>
                                <share>false</share>
                            </permission>
                        </perminfo>
                    </permissions>
            </shareinfo>
            <shareinfo>
                <email>user101@mydomain.com</email>
                    <permissions>
                        <perminfo viewname="Table1" sharedby="user@mydomain.com">
                            <permission>
                                <read>true</read>
                                <export>false</export>
                                <vud>false</vud>
                                <addrow>false</addrow>
                                <updaterow>false</updaterow>
                                <deleterow>false</deleterow>
                                <deleteallrows>false</deleteallrows>
                                <appendimport>false</appendimport>
                                <updateimport>false</updateimport>
                                <truncateimport>false</truncateimport>
                                <deleteupdateaddimport>false</deleteupdateaddimport>
                                <share>false</share>
                            </permission>
                        </perminfo>
                    </permissions>
            </shareinfo>
        </usershareinfo>
        <publicshareinfo>
        </publicshareinfo>
        <privatelinkshareinfo>
        </privatelinkshareinfo>
        <groupshareinfo>
            <groupmembers>
                <member>user10@mydomain.com</member>
                <member>user1@mydomain.com</member>
            </groupmembers>
        </groupshareinfo>
        <dbownershareinfo>
            <dbowners>
                <member>user13@mydomain.com</member>
                <member>user1@mydomain.com</member>
            </dbowners>
        </dbownershareinfo>
      </result>
    </response>
    
    
    

    Sample Response JSON Format:

    { 
       "response":{
          "uri":"\/api\/abc@zoho.com\/SalesDB",
          "action":"GETSHAREINFO",
          "result":{
             "usershareinfo":[  
                {  
                   "shareinfo":{  
                      "email":"user1@mydomain.com",
                      "permissions":[  
                         {  
                            "perminfo":{  
                               "viewname":"Table1",
                               "sharedby":"user@mydomain.com",
                               "permission":{  
                                  "read":"true",
                                  "export":"true",
                                  "vud":"false",
                                  "addrow":"true",
                                  "updaterow":"false",
                                  "deleterow":"false",
                                  "deleteallrows":"false",
                                  "appendimport":"false",
                                  "updateimport":"false",
                                  "truncateimport":"false",
                                  "deleteupdateaddimport":"false",
                                  "share":"false"
                               }
                            }
                         }
                      ]
                   }
                },
                {  
                   "shareinfo":{  
                      "email":"user4@mydomain.com",
                      "permissions":[  
                         {  
                            "perminfo":{  
                               "viewname":"Table1",
                               "sharedby":"user@mydomain.com",
                               "permission":{  
                                  "read":"true",
                                  "export":"true",
                                  "vud":"false",
                                  "addrow":"true",
                                  "updaterow":"false",
                                  "deleterow":"false",
                                  "deleteallrows":"false",
                                  "appendimport":"false",
                                  "updateimport":"false",
                                  "truncateimport":"false",
                                  "deleteupdateaddimport":"false",
                                  "share":"false"
                               }
                            }
                         }
                      ]
                   }
                },
                {  
                   "shareinfo":{  
                      "email":"user215@mydomain.com",
                      "permissions":[  
                         {  
                            "perminfo":{  
                               "viewname":"finepick1",
                               "sharedby":"user@mydomain.com",
                               "permission":{  
                                  "read":"true",
                                  "export":"false",
                                  "vud":"false",
                                  "addrow":"true",
                                  "updaterow":"false",
                                  "deleterow":"false",
                                  "deleteallrows":"false",
                                  "appendimport":"false",
                                  "updateimport":"false",
                                  "truncateimport":"false",
                                  "deleteupdateaddimport":"false",
                                  "share":"false"
                               }
                            }
                         }
                      ]
                   }
                },
                {  
                   "shareinfo":{  
                      "email":"userlf12@mydomain.com",
                      "permissions":[  
                         {  
                            "perminfo":{  
                               "viewname":"Parent",
                               "sharedby":"user@mydomain.com",
                               "permission":{  
                                  "read":"true",
                                  "export":"false",
                                  "vud":"false",
                                  "addrow":"true",
                                  "updaterow":"false",
                                  "deleterow":"false",
                                  "deleteallrows":"false",
                                  "appendimport":"false",
                                  "updateimport":"false",
                                  "truncateimport":"false",
                                  "deleteupdateaddimport":"false",
                                  "share":"false"
                               }
                            }
                         }
                      ]
                   }
                },
                {  
                   "shareinfo":{  
                      "email":"user33@mydomain.com",
                      "permissions":[  
                         {  
                            "perminfo":{  
                               "viewname":"Parent",
                               "sharedby":"user@mydomain.com",
                               "permission":{  
                                  "read":"true",
                                  "export":"false",
                                  "vud":"false",
                                  "addrow":"true",
                                  "updaterow":"false",
                                  "deleterow":"false",
                                  "deleteallrows":"false",
                                  "appendimport":"false",
                                  "updateimport":"false",
                                  "truncateimport":"false",
                                  "deleteupdateaddimport":"false",
                                  "share":"false"
                               }
                            }
                         },
                         {  
                            "perminfo":{  
                               "viewname":"sss",
                               "sharedby":"user@mydomain.com",
                               "permission":{  
                                  "read":"true",
                                  "export":"false",
                                  "vud":"false",
                                  "addrow":"true",
                                  "updaterow":"false",
                                  "deleterow":"false",
                                  "deleteallrows":"false",
                                  "appendimport":"false",
                                  "updateimport":"false",
                                  "truncateimport":"false",
                                  "deleteupdateaddimport":"false",
                                  "share":"false"
                               }
                            }
                         },
                         {  
                            "perminfo":{  
                               "viewname":"Table1",
                               "sharedby":"user@mydomain.com",
                               "permission":{  
                                  "read":"true",
                                  "export":"false",
                                  "vud":"false",
                                  "addrow":"true",
                                  "updaterow":"false",
                                  "deleterow":"false",
                                  "deleteallrows":"false",
                                  "appendimport":"false",
                                  "updateimport":"false",
                                  "truncateimport":"false",
                                  "deleteupdateaddimport":"false",
                                  "share":"false"
                               }
                            }
                         }
                      ]
                   }
                },
                {  
                   "shareinfo":{  
                      "email":"user1@mydomain.com",
                      "permissions":[  
                         {  
                            "perminfo":{  
                               "viewname":"finepick1",
                               "sharedby":"user@mydomain.com",
                               "permission":{  
                                  "read":"true",
                                  "export":"false",
                                  "vud":"false",
                                  "addrow":"true",
                                  "updaterow":"false",
                                  "deleterow":"false",
                                  "deleteallrows":"false",
                                  "appendimport":"false",
                                  "updateimport":"false",
                                  "truncateimport":"false",
                                  "deleteupdateaddimport":"false",
                                  "share":"false"
                               }
                            }
                         }
                      ]
                   }
                },
                {  
                   "shareinfo":{  
                      "email":"user115@mydomain.com",
                      "permissions":[  
                         {  
                            "perminfo":{  
                               "viewname":"Table1",
                               "sharedby":"user@mydomain.com",
                               "permission":{  
                                  "read":"true",
                                  "export":"true",
                                  "vud":"false",
                                  "addrow":"true",
                                  "updaterow":"false",
                                  "deleterow":"false",
                                  "deleteallrows":"false",
                                  "appendimport":"false",
                                  "updateimport":"false",
                                  "truncateimport":"false",
                                  "deleteupdateaddimport":"false",
                                  "share":"false"
                               }
                            }
                         }
                      ]
                   }
                },
                {  
                   "shareinfo":{  
                      "email":"user11@mydomain.com",
                      "permissions":[  
                         {  
                            "perminfo":{  
                               "viewname":"grp_pv1",
                               "sharedby":"user@mydomain.com",
                               "permission":{  
                                  "read":"true",
                                  "export":"true",
                                  "vud":"false",
                                  "addrow":"true",
                                  "updaterow":"false",
                                  "deleterow":"false",
                                  "deleteallrows":"false",
                                  "appendimport":"false",
                                  "updateimport":"false",
                                  "truncateimport":"false",
                                  "deleteupdateaddimport":"false",
                                  "share":"false"
                               }
                            }
                         }
                      ]
                   }
                },
                {  
                   "shareinfo":{  
                      "email":"user214@mydomain.com",
                      "permissions":[  
                         {  
                            "perminfo":{  
                               "viewname":"finepick1",
                               "sharedby":"user@mydomain.com",
                               "permission":{  
                                  "read":"true",
                                  "export":"false",
                                  "vud":"false",
                                  "addrow":"true",
                                  "updaterow":"false",
                                  "deleterow":"false",
                                  "deleteallrows":"false",
                                  "appendimport":"false",
                                  "updateimport":"false",
                                  "truncateimport":"false",
                                  "deleteupdateaddimport":"false",
                                  "share":"false"
                               }
                            }
                         }
                      ]
                   }
                },
                {  
                   "shareinfo":{  
                      "email":"user104@mydomain.com",
                      "permissions":[  
                         {  
                            "perminfo":{  
                               "viewname":"Table1",
                               "sharedby":"user@mydomain.com",
                               "permission":{  
                                  "read":"true",
                                  "export":"true",
                                  "vud":"false",
                                  "addrow":"true",
                                  "updaterow":"false",
                                  "deleterow":"false",
                                  "deleteallrows":"false",
                                  "appendimport":"false",
                                  "updateimport":"false",
                                  "truncateimport":"false",
                                  "deleteupdateaddimport":"false",
                                  "share":"false"
                               }
                            }
                         }
                      ]
                   }
                },
                {  
                   "shareinfo":{  
                      "email":"user10@mydomain.com",
                      "permissions":[  
                         {  
                            "perminfo":{  
                               "viewname":"Table2",
                               "sharedby":"user@mydomain.com",
                               "permission":{  
                                  "read":"true",
                                  "export":"false",
                                  "vud":"false",
                                  "addrow":"true",
                                  "updaterow":"false",
                                  "deleterow":"false",
                                  "deleteallrows":"false",
                                  "appendimport":"false",
                                  "updateimport":"false",
                                  "truncateimport":"false",
                                  "deleteupdateaddimport":"false",
                                  "share":"false"
                               }
                            }
                         }
                      ]
                   }
                },
                {  
                   "shareinfo":{  
                      "email":"user101@mydomain.com",
                      "permissions":[  
                         {  
                            "perminfo":{  
                               "viewname":"Table1",
                               "sharedby":"user@mydomain.com",
                               "permission":{  
                                  "read":"true",
                                  "export":"false",
                                  "vud":"false",
                                  "addrow":"true",
                                  "updaterow":"false",
                                  "deleterow":"false",
                                  "deleteallrows":"false",
                                  "appendimport":"false",
                                  "updateimport":"false",
                                  "truncateimport":"false",
                                  "deleteupdateaddimport":"false",
                                  "share":"false"
                               }
                            }
                         }
                      ]
                   }
                }
             ],
             "publicshareinfo":{  
    
             },
             "privatelinkshareinfo":{  
    
             },
             "groupshareinfo":{  
                "groupmembers":[  
                   "user10@mydomain.com",
                   "user1@mydomain.com"
                ]
             },
             "dbownershareinfo":{  
                "dbowners":[  
                   "user13@mydomain.com",
                   "user1@mydomain.com"
                ]
             }
          }
       }
    }
    

    The Get Share Info API is used to fetch all the Sharing information of a Database. Only the Administrator of the database (one who created the database) can use this API.

    URL

    https://reportsapi.zoho.com/api/<Email>/<Databasename>

    URL PARAMETERS

    Parameter Possible Values Description
    ZOHO_ACTION GETSHAREINFO 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.
    authtoken user authtoken Auth Token is an unique token that authenticates the user to access the Zoho Account.
    ZOHO_API_VERSION 1.0 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

    Possible Error Codes In GET SHARE INFO

    7103 , 7301 , 8504 , 8506 , 8516 , 8533


    Error codes in Sharing API

    sample error XML Format:

    
    <response uri="/api/abc@zoho.com/Employee" action="GETVIEWURL">
        <error> 
            <code>7103</code>
            <message>
            Database not found! Please check whether the database exists
            </message>
        </error>
    </response>
    
    

    sample error JSON Format:

    {
        "response": 
        {
            "uri": "\/api\/abc@zoho.com\/Employee",
            "action": "GETVIEWURL",
            "error": 
            {
            "code":7103,
            "message": "Database not found! Please check whether 
                                   the database exists"
            } 
        }
    }
    

    This section lists all possible error response codes that could be sent from the Zoho Reports server on failure of Sharing APIs. You can use this for appropriate error handling.

    Error Codes

    Error-Code Reason Solution
    7003 Required parameters are missing in the request. Send all the required parameters related to that particular action.
    7103 The Database Name mentioned in the API URL does not exist. Please provide an existing Database Name to get the sharing details.
    7301 You (your full name) do not have the permission to do this operation. Only database owner has the permission. Provide an authtoken for the Administrator or Owner of the database.
    8026 Permission parameter missing. Atleast any one of the following paramaters is required: [ZOHO_READ, ZOHO_EXPORT, ZOHO_VUD, ZOHO_ADDROW, ZOHO_UPDATEROW, ZOHO_DELETEROW, ZOHO_DELETEALLROWS, ZOHO_IMPORT_APPEND, ZOHO_IMPORT_ADDORUPDATE, ZOHO_IMPORT_DELETEALLADD, ZOHO_IMPORT_DELETEUPDATEADD, ZOHO_SHARE, ZOHO_VUD_SELCOL, ZOHO_DRILLDOWN].
    8027 Mentioned view/database is not found. Provide a valid view/database 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.
    8509 The Email Ids provided in ZOHO_EMAILS parameter is not proper / not in the EMAIL ID format. Check the email addresses passed in the parameter and provide a proper email address.
    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 you encounter any other errors, please mail the API request URL parameters and error response details to support@zohoreports.com. Zoho Reports Team will get back to you shortly with the best possible solution.

    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.


    Get View URL

    Download client libraries : C# | GO | JAVA | PHP | PYTHON



    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zoho.com";
        DBNAME = "EmployeeDB";
        TBNAME = "EmployeeTB";
    
        class Program
        {
            public IReportClient getClient()
            {
                IReportClient RepClient = new ReportClient(AUTHTOKEN);
                return RepClient;
            }
    
            public void getviewurl(IReportClient rc)
            {
                string uri = rc.GetURI(EMAIL,DBNAME,TBNAME);
                string result = rc.GetViewUrl(uri, null);
                Console.WriteLine(result);
            }
    
            static void Main(string[] args)
            {
                Program obj = new Program();
                IReportClient rc = obj.getClient();
                obj.getviewurl(rc);
            }
        }
    }
    
    package main
    
    import (
            "fmt"
            "zoho/pkg/reportclient"
    
    )
    
    var(
            email = "user@zoho.com"
            dbname = "Employee"
            tbname = "sample"
            authtoken = "f7d016b46be276cas21asd2a592f40101"
    )
    
    func getviewurl() {
            url := reportclient.GetUri(email, dbname, tbname)
            viewurl , err := reportclient.GetViewUrl(url)
            if(err != nil){
                    fmt.Println(err.ErrorMessage)
                    fmt.Println(err.ErrorCode)
                    fmt.Println(err.Action)
                    fmt.Println(err.HttpStatusCode)
            }else{
                    fmt.Println(viewurl)
            }
    
    }
    
    func main() {
            reportclient.SetAuthToken(authtoken)
            getviewurl()
    }
    
    import com.adventnet.zoho.client.report.*;
    
    public class Sample 
    {
        String email = "user@zoho.com";
        String dbname = "EmployeeDB";
        String tbname = "EmployeeTB";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
    
        public void getviewurl() throws Exception
        {
            String uri = rc.getURI(email,dbname,tbname);
            String result =  rc.getViewURL(uri,config);
            System.out.println(result);
        }
    
        public static void main(String[] args) throws Exception 
        {
            Sample obj = new Sample();
            obj.getviewurl();
        }
    }
    
    <?php
        require 'ReportClient.php';
    
        $EMAIL_ID = "abc@zoho.com";
        $DB_NAME = "EmployeeDB";
        $TABLE_NAME = "EmployeeTB";
        $AUTHTOKEN = "f7d016b46be2763wasda32a592f40101";
    
        $report_client_request = new ReportClient($AUTHTOKEN); 
    
        $uri = $report_client_request->getURI($EMAIL_ID, $DB_NAME, $TABLE_NAME);
        $view_url = $report_client_request->getViewUrl($uri);
    ?>
    
    from __future__ import with_statement
    from ReportClient import ReportClient
    import sys
    
    class Sample:
    
        LOGINEMAILID="abc@zoho.com"
        AUTHTOKEN="f7d016b46be276ca12fa32a592f40101"
        DATABASENAME="Employee"
        TABLENAME="Employee"
        rc = None
        rc = ReportClient(self.AUTHTOKEN)
    
        def getviewurl(self,rc):
            uri = rc.getURI(self.LOGINEMAILID,self.DATABASENAME,self.TABLENAME)
            result = rc.getViewUrl(uri)
            print result
    
    obj = Sample()
    obj.getviewurl(obj.rc)
    
    curl -d "ZOHO_ACTION=GETVIEWURL&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML
             &ZOHO_API_VERSION=1.0&authtoken=f7d016b46be276cd4cfa32a592f40101" 
             https://reportsapi.zoho.com/api/abc@zoho.com/Employee/EmployeeDetails
    
    

    Sample Response XML Format:

    <response uri="/api/abc@zoho.com/Employee/EmployeeDetails" action="GETVIEWURL">
        <result>
            <viewurl>
                https://reports.zoho.com/ZDBDataSheetView.cc?&
                OBJID=9999999999999&STANDALONE=true&REMTOOLBAR=true&
                ZDB_THEME_NAME=blue
            </viewurl> 
        </result>
    </response>
    
    

    Sample Response JSON Format:

    {
        "response": 
        {
            "uri": "\/api\/abc@zoho.com\/Employee\/EmployeeDetails",
            "action": "GETVIEWURL",
            "result": 
            {
                "viewurl": "https://reports.zoho.com/ZDBDataSheetView.cc?&
                          OBJID=9999999999999&STANDALONE=true&REMTOOLBAR=true&
                          ZDB_THEME_NAME=blue"
            } 
        }
    }
    

    This API returns the URL to access the mentioned view. You need to provide a database name and the view name as input for the API.

    URL

    https://reportsapi.zoho.com/api/<Email>/<Databasename>/<Tablename>

    URL PARAMETERS

    Parameter Possible Values Description
    ZOHO_ACTION GETVIEWURL 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.
    authtoken user authtoken Auth Token is an unique token that authenticates the user to access the Zoho Account.
    ZOHO_API_VERSION 1.0 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

    Possible Error Codes In GET VIEW URL

    7103 , 7138 , 8504 , 8506 , 8516 , 8533


    Get Embed URL

    Download client libraries : C# | GO | JAVA | PHP | PYTHON



    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zoho.com";
        DBNAME = "EmployeeDB";
        TBNAME = "EmployeeTB";
    
        class Program
        {
            public IReportClient getClient()
            {
                IReportClient RepClient = new ReportClient(AUTHTOKEN);
                return RepClient;
            }
    
            public void getEmbedURL(IReportClient RepClient)
            {
                string tableURI = RepClient.GetURI(EMAIL, DBNAME, TBNAME);
                string result = RepClient.GetEmbedURL(tableURI, null);
            }
    
            static void Main(string[] args)
            {
                Program obj = new Program();
                IReportClient rc = obj.getClient();
                obj.getEmbedURL(rc);
            }
        }
    }
    
    package main
    
    import (
            "fmt"
            "zoho/pkg/reportclient"
    
    )
    
    var(
            email = "user@zoho.com"
            dbname = "Employee"
            tbname = "sample"
            authtoken = "f7d016b46be276cas21asd2a592f40101"
    )
    
    func getembedurl() {
            url := reportclient.GetUri(email, dbname, tbname)
            params := map[string]string{}
            embedurl , err := reportclient.GetEmbedUrl(url, params)
            if(err != nil){
                    fmt.Println(err.ErrorMessage)
                    fmt.Println(err.ErrorCode)
                    fmt.Println(err.Action)
                    fmt.Println(err.HttpStatusCode)
            }else{
                    fmt.Println(embedurl)
            }
    }
    
    func main() {
            reportclient.SetAuthToken(authtoken)
            getembedurl()
    }
    
    import com.adventnet.zoho.client.report.*;
    
    public class Sample 
    {
        String email = "user@zoho.com";
        String dbname = "EmployeeDB";
        String tbname = "EmployeeTB";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
    
        public void getembedurl() throws Exception
        {
            String uri = rc.getURI(email,dbname,tbname);
            String result =  rc.getEmbedURL(uri,config);
            System.out.println(result);
        }
    
        public static void main(String[] args) throws Exception 
        {
            Sample obj = new Sample();
            obj.getembedurl();
        }
    }
    
    <?php
        require 'ReportClient.php';
    
        $EMAIL_ID = "abc@zoho.com";
        $DB_NAME = "EmployeeDB";
        $TABLE_NAME = "EmployeeTB";
        $AUTHTOKEN = "f7d016b46be2763wasda32a592f40101";
    
        $report_client_request = new ReportClient($AUTHTOKEN); 
    
        $uri = $report_client_request->getURI($EMAIL_ID, $DB_NAME, $TABLE_NAME);
        $criteria = "Department"='Finance';
        $embed_url = $report_client_request->getEmbedURL($uri ,$criteria);
    ?>
    
    from __future__ import with_statement
    from ReportClient import ReportClient
    import sys
    
    class Sample:
    
        LOGINEMAILID="abc@zoho.com"
        AUTHTOKEN="f7d016b46be276ca12fa32a592f40101"
        DATABASENAME="Employee"
        TABLENAME="Employee"
        rc = None
        rc = ReportClient(self.AUTHTOKEN)
    
        def getembedurl(self,rc):
            uri = rc.getURI(self.LOGINEMAILID,self.DATABASENAME,self.TABLENAME)
            result = rc.getEmbedUrl(uri)
            print result
    
    obj = Sample()
    obj.getembedurl(obj.rc)
    
    curl -d "ZOHO_ACTION=GETEMBEDURL&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML
             &ZOHO_API_VERSION=1.0&authtoken=f7d016b46be276cd4cfa32a592f40101" 
             https://reportsapi.zoho.com/api/abc@zoho.com/SalesDB/Sales
    
    

    Sample Response XML Format:

    <response uri="/api/abc@zoho.com/SalesDB/Sales" action="GETEMBEDURL">
        <result>
            <embedurl>https://reports.zoho.com/ZDBDataSheetView.cc?&
                  OBJID=100000000000026025&REMTOOLBAR=>true&FS=OS
                  &RSCONFIG=Ksp6SkShM5/PySm0q3lMQC4lNc6BUVBGQC4wp+YS6ahHG8e1j
                  035yQrpZwAZdq7I
            </embedurl>
        </result>
    </response>
    
    

    Sample Response JSON Format:

    {
        "response":
        {
            "uri":"\/api\/abc@zoho.com\/SalesDB\/Sales",
            "action":"GETEMBEDURL",
            "result": {"embedUrl":"https://reports.zoho.com/ZDBDataSheetView.cc?&
                OBJID=100000000000026025&REMTOOLBAR=true&FS=OS
                &RSCONFIG=Ksp6SkShM5/PySm0q3lMQC4lNc6BUVBGQC4wp+YS6ahHG8e1j
                035yQrpZwAZdq7I"}
        }
    }
    

    The Get Embed URL API is used to get the embed URL of the particular table / view. This API is available only for the White Label Administrator.

    URL

    https://reportsapi.zoho.com/api/<Email>/<Databasename>/<Tablename>

    URL PARAMETERS

    Parameter Possible Values Description
    ZOHO_ACTION GETEMBEDURL 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.
    authtoken user authtoken Auth Token is an unique token that authenticates the user to access the Zoho Account.
    ZOHO_API_VERSION 1.0 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

    URL PARAMETERS

    Parameter Possible Values Description
    ZOHO_CRITERIA
    (optional)
    criteria
    ZOHO_VUD_PERMISSION
    (optional)
    true/false Default is false.
    In case it is true, then the view have the permission to view the Underlying data.
    In case its false, then the view don’t have the permission to view the Underlying data.
    ZOHO_INCLUDE_TOOLBAR
    (optional)
    true/false Default is false.
    In case it is true, then the toolbar is visible in the embed mode.
    In case its false, no toolbar is visible in the embed mode.
    ZOHO_VALIDITY_PERIOD
    (optional)
    <number> Controls the validity period of the embed url.
    Default is 3600 seconds (One hour).
    Value in seconds.
    ZOHO_THEME_COLOR
    (optional)
    blue/brown Theme color.
    Default is blue
    ZOHO_DATATYPE_SYMBOL
    (optional)
    true/false Controls to display the datatype symbol in the table column.
    Default is false
    ZOHO_SEARCH_BOX
    (optional)
    true/false Controls to display the search box in the table
    ZOHO_IS_SECURE
    (optional)
    true/false Controls to access the url in secure mode or not (http or https)
    ZOHO_LEGEND_POSITION
    (optional)
  • RIGHT
  • LEFT
  • TOPLEFT
  • TOPRIGHT
  • TOPCENTER
  • BOTTOMLEFT
  • BOTTOMRIGHT
  • BOTTOMCENTER
  • NONE
  • Controls to display the position on the legend
    ZOHO_EXPORT_PERMISSION
    (optional)
    true/false Default is false.
    If set as true, then the view have the permission to export the data.
    If set as false, then the view don’t have the permission to export the data.

    Possible Error Codes In GET EMBED URL

    7103 , 7138 , 8023 , 8504 , 8506 , 8516 , 8533


    Error codes in Embed API

    sample error XML Format:

    
    <response uri="/api/abc@zoho.com/Employee" action="GETVIEWURL">
        <error> 
            <code>7103</code>
            <message>
            Database not found! Please check whether the database exists
            </message>
        </error>
    </response>
    
    

    sample error JSON Format:

    {
        "response": 
        {
            "uri": "\/api\/abc@zoho.com\/Employee",
            "action": "GETVIEWURL",
            "error": 
            {
            "code":7103,
            "message": "Database not found! Please check whether 
                                   the database exists"
            } 
        }
    }
    

    This section lists all possible error response codes that could be sent from the Zoho Reports server on failure of Embed APIs. You can use this for appropriate error handling.

    Error Codes

    Error-Code Reason Solution
    7103 The Database Name mentioned in the API URL does not exist. Check the database name in the request URL and provide a valid database 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.
    8023 You do not have required permission to perform this operation. Kindly contact our support team.
    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@zohoreports.com. Zoho Reports Team will get back to you with the best possible solution.

    User Management API

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

    Manage User APIs are used to Add / Remove / Activate / Deactivate Users to your Zoho Reports Account. This APIs can be invoked only by the Administrator of the Zoho Reports account to add / activate / deactivate users to his account.

    Note: These API’s cannot be used to create user accounts in Zoho. This is just meant to associate an existing Zoho user to a Zoho Reports account held by an Administrator.


    Get Users

    Download client libraries : C# | GO | JAVA | PHP | PYTHON



    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zoho.com";
    
        class Program
        {
            public IReportClient getClient()
            {
                IReportClient RepClient = new ReportClient(AUTHTOKEN);
                return RepClient;
            }
    
            public void getusers(IReportClient rc)
            {
                try
                {
                    string uri = rc.GetURI(EMAIL);
                    var result = rc.GetUsers(uri, null);
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                }
            }
    
            static void Main(string[] args)
            {
                Program obj = new Program();
                IReportClient rc = obj.getClient();
                obj.getusers(rc);
            }
        }
    }
    
    package main
    
    import (
            "fmt"
            "zoho/pkg/reportclient"
    
    )
    
    var(
            email = "user@zoho.com"
            authtoken = "f7d016b46be276cas21asd2a592f40101"
    )
    
    func getusers(){
        url := reportclient.GetUserUri(email)
        params := map[string]string{}
        result , err := reportclient.GetUsers(url, params)
        if(err != nil){
            fmt.Println(err.ErrorMessage)
            fmt.Println(err.ErrorCode)
            fmt.Println(err.Action)
            fmt.Println(err.HttpStatusCode)
        }else{
            fmt.Println(result)
        }
    }
    
    func main() {
            reportclient.SetAuthToken(authtoken)
            getusers()
    }
    
    import com.adventnet.zoho.client.report.*;
    
    public class Sample 
    {
        String email = "user@zoho.com";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
    
        private ReportClient rc = new ReportClient(authtoken);
    
        public void getusers() throws Exception
        {
            String uri = rc.getURI(email);
            ArrayList resp = rc.getUsers(uri, null);
        }
    
        public static void main(String[] args) throws Exception 
        {
            Sample obj = new Sample();
            obj.getusers();
        }
    }
    
    <?php
        require 'ReportClient.php';
    
        $EMAIL_ID = "abc@zoho.com";
        $AUTHTOKEN = "f7d016b46be2763wasda32a592f40101";
    
        $report_client_request = new ReportClient($AUTHTOKEN); 
    
        $uri = $request->getUserURI($EMAIL_ID);
        $result = $request->getUsers($uri);
    ?>
    
    from __future__ import with_statement
    from ReportClient import ReportClient
    import sys
    
    class Sample:
    
        LOGINEMAILID="abc@zoho.com"
        AUTHTOKEN="f7d016b46be276ca12fa32a592f40101"
        rc = None
        rc = ReportClient(self.AUTHTOKEN)
    
        def getusers(self,rc):
            uri = rc.getUserURI(self.LOGINEMAILID)
            result = rc.getUsers(uri)
            print result
    
    obj = Sample()
    obj.getusers(obj.rc)
    
    curl -d "ZOHO_ACTION=GETUSERS&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML
             &ZOHO_API_VERSION=1.0&authtoken=f7d016b46be276cd4cfa32a592f40101"
             https://reportsapi.zoho.com/api/abc@zoho.com
    

    Sample Response XML Format:

    <?xml version="1.0" encoding="UTF-8" ?>
    <response uri="/api/user@zoho.com" action="GETUSERS">
        <result>
            <user emailId="user+1@zoho.com" status="true" role="User" > </user>
            <user emailId="user+2@zoho.com" status="true" role="Database Owner" > </user>
            <user emailId="user@zoho.com" status="true" role="Admin"> </user>
        </result>
    </response>
    
    

    Sample Response JSON Format:

    {
      "response": {
        "uri": "/api/user@zoho.com",
        "action": "GETUSERS",
        "result": [
          {
            "emailId": "user+1@zoho.com",
            "status": true,
            "role": "User"
          },
          {
            "emailId": "user+2@zoho.com",
            "status": true,
            "role": "Database Owner"
          },
          {
            "emailId": "user@zoho.com",
            "status": true,
            "role": "Admin"
          }
        ]
      }
    }
    
    

    The Get users API is used to get the users in Zoho Reports Account. The account Administrator and the Database Owner alone can use this API to get the users list in the Zoho Reports account.

    URL

    https://reportsapi.zoho.com/api/<Email>

    URL PARAMETERS

    Parameter Name Possible Values Description
    ZOHO_ACTION GETUSERS 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.
    authtoken user authtoken Auth Token is an unique token that authenticates the user to access the Zoho Account.
    ZOHO_API_VERSION 1.0 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.

    Possible Error Codes In GETUSERS

    8504 , 8506 , 8516 , 8533


    Add User

    Download client libraries : C# | GO | JAVA | PHP | PYTHON



    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zoho.com";
    
        class Program
        {
            public IReportClient getClient()
            {
                IReportClient RepClient = new ReportClient(AUTHTOKEN);
                return RepClient;
            }
    
            public void addUser(IReportClient RepClient)
            {
                string userURI = RepClient.GetURI(EMAIL);
                string emailIds = "user1@zoho.com";
                RepClient.AddUser(userURI, emailIds, null);
            }
    
            static void Main(string[] args)
            {
                Program obj = new Program();
                IReportClient rc = obj.getClient();
                obj.addUser(rc);
            }
        }
    }
    
    package main
    
    import (
            "fmt"
            "zoho/pkg/reportclient"
    
    )
    
    var(
            email = "user@zoho.com"
            authtoken = "f7d016b46be276cas21asd2a592f40101"
    )
    
    func adduser() {
            url := reportclient.GetUserUri(email)
            emailids := "user1@zoho.com"
            err := reportclient.AddUser(url, emailids)
            if(err != nil){
                    fmt.Println(err.ErrorMessage)
                    fmt.Println(err.ErrorCode)
                    fmt.Println(err.Action)
                    fmt.Println(err.HttpStatusCode)
            }else{
                    fmt.Println("Success")
            }
    }
    
    func main() {
            reportclient.SetAuthToken(authtoken)
            adduser()
    }
    
    import com.adventnet.zoho.client.report.*;
    
    public class Sample 
    {
        String email = "user@zoho.com";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        String emails = "abc@zoho.com";
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
    
        public void adduser() throws Exception
        {
            String uri = rc.getURI(email);
            rc.addUser(uri,emails,config);
        }
    
        public static void main(String[] args) throws Exception 
        {
            Sample obj = new Sample();
            obj.adduser();
        }
    }
    
    <?php
        require 'ReportClient.php';
    
        $EMAIL_ID = "abc@zoho.com";
        $AUTHTOKEN = "f7d016b46be2763wasda32a592f40101";
    
        $report_client_request = new ReportClient($AUTHTOKEN); 
    
        $uri = $report_client_request->getUserURI($EMAIL_ID);
        $emails = "user1@yourdomain.com,user2@yourdomain.com";
        $report_client_request->addUser($uri, $emails);
    ?>
    
    from __future__ import with_statement
    from ReportClient import ReportClient
    import sys
    
    class Sample:
    
        LOGINEMAILID="abc@zoho.com"
        AUTHTOKEN="f7d016b46be276ca12fa32a592f40101"
        rc = None
        rc = ReportClient(self.AUTHTOKEN)
    
        def AddUser(self,rc):
            uri = rc.getUserURI(self.LOGINEMAILID)
            emailIds = "user@zoho.com"
            rc.addUser(uri,emailIds)
    
    obj = Sample()
    obj.AddUser(obj.rc)
    
    curl -d "ZOHO_ACTION=ADDUSER&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML
             &ZOHO_API_VERSION=1.0&authtoken=f7d016asw6be276cd4cfa32a592f40101
             &ZOHO_EMAILS=user@zoho.com" 
             https://reportsapi.zoho.com/api/abc@zoho.com
    
    

    Sample Response XML Format:

    <response uri="/api/abc@zoho.com" action="ADDUSER">
        <result>
            <message>User(s) added successfully</message>
        </result>
    </response>
    
    

    Sample Response JSON Format:

    {
        "response": 
        {
            "uri": "\/api\/abc@zoho.com",
            "action": "ADDUSER",
            "result": 
            {
                "message": "User(s) added successfully"
            } 
        }
    }
    

    Use this API to add users to your Zoho Reports Account (provided you are the Administrator). The users will be added in “Active State” by default and the active user count in your account will be increased accordingly. Incase your account already has exceeded the allowed user count limit, then the newly added users will be set as “Deactive”. An invitation mail will be triggered to the newly added users.

    Note: This API is used to just add users into your (Administrator’s) Zoho Reports Account. This API does not create user accounts in Zoho.

    URL

    https://reportsapi.zoho.com/api/<Email>

    URL PARAMETERS

    Parameter Possible Values Description
    ZOHO_ACTION ADDUSER 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.
    authtoken user authtoken Auth Token is an unique token that authenticates the user to access the Zoho Account.
    ZOHO_API_VERSION 1.0 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

    URL PARAMETERS

    Parameter Name Possible Values Description
    ZOHO_EMAILS User email ID’s This parameter holds the email addresses of the users to be added in your (Administrator’s) Zoho Reports Account.
    The email addresses should be comma separated.
    Ex:ZOHO_EMAILS=user1@yourdomain.com,user2@yourdomain.com
    ZOHO_DOMAINNAME
    (Only for White Label customers)
    Domain name It’s used to add user to the whitelabel domain.

    Possible Error Codes In ADD USER

    6021 , 8504 , 8506 , 8509 , 8516 , 8533


    Remove User

    Download client libraries : C# | GO | JAVA | PHP | PYTHON



    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zoho.com";
    
        class Program
        {
            public IReportClient getClient()
            {
                IReportClient RepClient = new ReportClient(AUTHTOKEN);
                return RepClient;
            }
    
            public void removeUser(IReportClient RepClient)
            {
                string userURI = RepClient.GetURI(EMAIL);
                string emailIds = "user1@zoho.com";
                RepClient.RemoveUser(userURI, emailIds, null);
            }
    
            static void Main(string[] args)
            {
                Program obj = new Program();
                IReportClient rc = obj.getClient();
                obj.removeUser(rc);
            }
        }
    }
    
    package main
    
    import (
            "fmt"
            "zoho/pkg/reportclient"
    
    )
    
    var(
            email = "user@zoho.com"
            authtoken = "f7d016b46be276cas21asd2a592f40101"
    )
    
    func removeuser() {
            url := reportclient.GetUserUri(email)
            emailids := "user1@zoho.com"
            err := reportclient.RemoveUser(url, emailids)
            if(err != nil){
                    fmt.Println(err.ErrorMessage)
                    fmt.Println(err.ErrorCode)
                    fmt.Println(err.Action)
                    fmt.Println(err.HttpStatusCode)
            }else{
                    fmt.Println("Success")
            }
    }
    
    func main() {
            reportclient.SetAuthToken(authtoken)
            removeuser()
    }
    
    import com.adventnet.zoho.client.report.*;
    
    public class Sample 
    {
        String email = "user@zoho.com";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        String emails = "abc@zoho.com";
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
    
        public void removeuser() throws Exception
        {
            String uri = rc.getURI(email);
            rc.removeUser(uri,emails,config);
        }
    
        public static void main(String[] args) throws Exception 
        {
            Sample obj = new Sample();
            obj.removeuser();
        }
    }
    
    <?php
        require 'ReportClient.php';
    
        $EMAIL_ID = "abc@zoho.com";
        $AUTHTOKEN = "f7d016b46be2763wasda32a592f40101";
    
        $report_client_request = new ReportClient($AUTHTOKEN);
    
        $uri = $report_client_request->getUserURI($EMAIL_ID);
        $emails = "user1@yourdomain.com,user2@yourdomain.com";
        $report_client_request->removeUser($uri, $emails);
    ?>
    
    from __future__ import with_statement
    from ReportClient import ReportClient
    import sys
    
    class Sample:
    
        LOGINEMAILID="abc@zoho.com"
        AUTHTOKEN="f7d016b46be276ca12fa32a592f40101"
        rc = None
        rc = ReportClient(self.AUTHTOKEN)
    
        def RemoveUser(self,rc):
            uri = rc.getUserURI(self.LOGINEMAILID)
            emailIds = "user@zoho.com"
            rc.removeUser(uri,emailIds)
    
    obj = Sample()
    obj.RemoveUser(obj.rc)
    
    curl -d "ZOHO_ACTION=REMOVEUSER&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML
             &ZOHO_API_VERSION=1.0&authtoken=f7d016b46be276cd4cfa32a592f40101
             &ZOHO_EMAILS=user@zoho.com" 
             https://reportsapi.zoho.com/api/abc@zoho.com
    
    

    Sample Response XML Format:

    <response uri="/api/abc@zoho.com" action="REMOVEUSER">
        <result>
            <message>User(s) removed successfully</message>
        </result>
    </response>
    
    

    Sample Response JSON Format:

    {
        "response": 
        {
            "uri": "\/api\/abc@zoho.com",
            "action": "REMOVEUSER",
            "result": 
            {
                "message": "User(s) removed successfully"
            } 
        }
    }
    

    The API to delete the users from the Administrator’s Zoho Reports Account. In case an active user is removed/deleted, then the count of the users associated with the account will decrease. The usage details are below.

    URL

    https://reportsapi.zoho.com/api/<Email>

    URL PARAMETERS

    Parameter Possible Values Description
    ZOHO_ACTION REMOVEUSER 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.
    authtoken user authtoken Auth Token is an unique token that authenticates the user to access the Zoho Account.
    ZOHO_API_VERSION 1.0 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

    URL PARAMETERS

    Parameter Name Possible Values Description
    ZOHO_EMAILS User email ID’s This parameter holds the email addresses of the users to be deleted from the Zoho Reports account.
    The email addresses should be comma separated.
    Ex:- ZOHO_EMAILS=user1@yourdomain.com,user2@yourdomain.com .
    Please note that removing the users from Zoho Reports account doesn’t remove the user from Zoho. It just removes the user from the Administrators Zoho Reports Account.
    ZOHO_DOMAINNAME
    (Only for White Label customers)
    Domain name It’s used to remove user from the whitelabel domain.

    Possible Error Codes In REMOVE USER

    8504 , 8506 , 8509 , 8516 , 8533


    Activate User

    Download client libraries : C# | GO | JAVA | PHP | PYTHON



    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zoho.com";
    
        class Program
        {
            public IReportClient getClient()
            {
                IReportClient RepClient = new ReportClient(AUTHTOKEN);
                return RepClient;
            }
    
            public void activateUser(IReportClient RepClient)
            {
                string userURI = RepClient.GetURI(EMAIL);
                string emailIds = "user1@zoho.com";
                RepClient.ActivateUser(userURI, emailIds, null);
            }
    
            static void Main(string[] args)
            {
                Program obj = new Program();
                IReportClient rc = obj.getClient();
                obj.activateUser(rc);
            }
        }
    }
    
    package main
    
    import (
            "fmt"
            "zoho/pkg/reportclient"
    
    )
    
    var(
            email = "user@zoho.com"
            authtoken = "f7d016b46be276cas21asd2a592f40101"
    )
    
    func activateuser() {
            url := reportclient.GetUserUri(email)
            emailids := "user1@zoho.com"
            err := reportclient.ActivateUser(url, emailids)
            if(err != nil){
                    fmt.Println(err.ErrorMessage)
                    fmt.Println(err.ErrorCode)
                    fmt.Println(err.Action)
                    fmt.Println(err.HttpStatusCode)
            }else{
                    fmt.Println("Success")
            }
    }
    
    func main() {
            reportclient.SetAuthToken(authtoken)
            activateuser()
    }
    
    import com.adventnet.zoho.client.report.*;
    
    public class Sample 
    {
        String email = "user@zoho.com";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        String emails = "abc@zoho.com";
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
    
        public void activateuser() throws Exception
        {
            String uri = rc.getURI(email);
            rc.activateUser(uri,emails,config);
        }
    
        public static void main(String[] args) throws Exception 
        {
            Sample obj = new Sample();
            obj.activateuser();
        }
    }
    
    <?php
        require 'ReportClient.php';
    
        $EMAIL_ID = "abc@zoho.com";
        $AUTHTOKEN = "f7d016b46be2763wasda32a592f40101";
    
        $report_client_request = new ReportClient($AUTHTOKEN);
    
        $uri = $report_client_request->getUserURI($EMAIL_ID);
        $emails = "user1@yourdomain.com,user2@yourdomain.com";
        $report_client_request->activateUser($uri, $emails);
    ?>
    
    from __future__ import with_statement
    from ReportClient import ReportClient
    import sys
    
    class Sample:
    
        LOGINEMAILID="abc@zoho.com"
        AUTHTOKEN="f7d016b46be276ca12fa32a592f40101"
        rc = None
        rc = ReportClient(self.AUTHTOKEN)
    
        def ActivateUser(self,rc):
            uri = rc.getUserURI(self.LOGINEMAILID)
            emailIds = "user@zoho.com"
            rc.activateUser(uri,emailIds)
    
    obj = Sample()
    obj.ActivateUser(obj.rc)
    
    curl -d "ZOHO_ACTION=ACTIVATEUSER&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML
             &ZOHO_API_VERSION=1.0&authtoken=f7d016b46be276cd4cfa32a592f40101
             &ZOHO_EMAILS=user@zoho.com" 
             https://reportsapi.zoho.com/api/abc@zoho.com
    
    

    Sample Response XML Format:

    <response uri="/api/abc@zoho.com" action="ACTIVATEUSER">
        <result>
            <message>User(s) activated successfully</message>
        </result>
    </response>
    
    

    Sample Response JSON Format:

    {
        "response": 
        {
            "uri": "\/api\/abc@zoho.com",
            "action": "ACTIVATEUSER",
            "result": 
            {
                "message": "User(s) activated successfully"
            } 
        }
    }
    

    You can activate an user using the Activate User API. Once you activate a user, he/she will be a part of the total active user count . This API will fail to activate the user, if the user count limit available for the account is reached.

    URL

    https://reportsapi.zoho.com/api/<Email>

    URL PARAMETERS

    Parameter Possible Values Description
    ZOHO_ACTION ACTIVATEUSER 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.
    authtoken user authtoken Auth Token is an unique token that authenticates the user to access the Zoho Account.
    ZOHO_API_VERSION 1.0 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

    URL PARAMETERS

    Parameter Name Possible Values Description
    ZOHO_EMAILS User email ID’s This parameter holds the email addresses of the users to be activated in Administrator’s Zoho Reports Account.
    The email addresses should be comma separated.
    Ex:- ZOHO_EMAILS=user1@yourdomain.com,user2@yourdomain.com
    ZOHO_DOMAINNAME
    (Only for White Label customers)
    Domain name It’s used to activate user in the whitelabel domain.

    Possible Error Codes In ACTIVATE USER

    6021 , 8504 , 8506 , 8509 , 8516 , 8533


    Deactivate User

    Download client libraries : C# | GO | JAVA | PHP | PYTHON



    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zoho.com";
    
        class Program
        {
            public IReportClient getClient()
            {
                IReportClient RepClient = new ReportClient(AUTHTOKEN);
                return RepClient;
            }
    
            public void deActivateUser(IReportClient RepClient)
            {
                string userURI = RepClient.GetURI(EMAIL);
                string emailIds = "user1@zoho.com";
                RepClient.DeActivateUser(userURI, emailIds, null);
            }
    
            static void Main(string[] args)
            {
                Program obj = new Program();
                IReportClient rc = obj.getClient();
                obj.deActivateUser(rc);
            }
        }
    }
    
    package main
    
    import (
            "fmt"
            "zoho/pkg/reportclient"
    
    )
    
    var(
            email = "user@zoho.com"
            authtoken = "f7d016b46be276cas21asd2a592f40101"
    )
    
    func deactivateuser() {
            url := reportclient.GetUserUri(email)
            emailids := "user1@zoho.com"
            err := reportclient.DeActivateUser(url, emailids)
            if(err != nil){
                    fmt.Println(err.ErrorMessage)
                    fmt.Println(err.ErrorCode)
                    fmt.Println(err.Action)
                    fmt.Println(err.HttpStatusCode)
            }else{
                    fmt.Println("Success")
            }
    }
    
    func main() {
            reportclient.SetAuthToken(authtoken)
            deactivateuser()
    }
    
    import com.adventnet.zoho.client.report.*;
    
    public class Sample 
    {
        String email = "user@zoho.com";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        String emails = "abc@zoho.com";
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
    
        public void deactivateuser() throws Exception
        {
            String uri = rc.getURI(email);
            rc.deActivateUser(uri,emails,config);
        }
    
        public static void main(String[] args) throws Exception 
        {
            Sample obj = new Sample();
            obj.deactivateuser();
        }
    }
    
    <?php
        require 'ReportClient.php';
    
        $EMAIL_ID = "abc@zoho.com";
        $AUTHTOKEN = "f7d016b46be2763wasda32a592f40101";
    
        $report_client_request = new ReportClient($AUTHTOKEN); 
    
        $uri = $report_client_request->getUserURI($EMAIL_ID);
        $emails = "user1@yourdomain.com,user2@yourdomain.com";
        $report_client_request->deActivateUser($uri, $emails);
    ?>
    
    from __future__ import with_statement
    from ReportClient import ReportClient
    import sys
    
    class Sample:
    
        LOGINEMAILID="abc@zoho.com"
        AUTHTOKEN="f7d016b46be276ca12fa32a592f40101"
        rc = None
        rc = ReportClient(self.AUTHTOKEN)
    
        def DeActivateUser(self,rc):
            uri = rc.getUserURI(self.LOGINEMAILID)
            emailIds = "user@zoho.com"
            rc.deActivateUser(uri,emailIds)
    
    obj = Sample()
    obj.DeActivateUser(obj.rc)
    
    curl -d "ZOHO_ACTION=DEACTIVATEUSER&ZOHO_OUTPUT_FORMAT=XML
             &ZOHO_ERROR_FORMAT=XML&ZOHO_API_VERSION=1.0&authtoken
             =f7d016b46be276cd4cfa32a592f40101&ZOHO_EMAILS=user@zoho.com" 
             https://reportsapi.zoho.com/api/abc@zoho.com
    
    

    Sample Response XML Format:

    <response uri="/api/abc@zoho.com" action="DEACTIVATEUSER">
        <result>
            <message>User(s) de-activated successfully</message>
        </result>
    </response>
    
    

    Sample Response JSON Format:

    {
        "response": 
        {
            "uri": "\/api\/abc@zoho.com",
            "action": "DEACTIVATEUSER",
            "result": 
            {
                "message": "User(s) de-activated successfully"
            } 
        }
    }
    

    This API is used to de-activate the specified users from the Administrator’s Zoho Reports Account. The activated users will be de-activated using the Deactivate Users API. Once the user is de-activated, the user count will be decreased if the user(s) was in Active State. The usage details are below.

    URL

    https://reportsapi.zoho.com/api/<Email>

    URL PARAMETERS

    Parameter Possible Values Description
    ZOHO_ACTION DEACTIVATEUSER 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.
    authtoken user authtoken Auth Token is an unique token that authenticates the user to access the Zoho Account.
    ZOHO_API_VERSION 1.0 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

    URL PARAMETERS

    Parameter Name Possible Values Description
    ZOHO_EMAILS User email ID’s This parameter holds the email addresses of the users to be deactivated from the Zoho Reports account.
    The email addresses should be comma separated.
    Ex:- ZOHO_EMAILS=user1@yourdomain.com,user2@yourdomain.com
    ZOHO_DOMAINNAME
    (Only for White Label customers)
    Domain name It’s used to deactivate user in the whitelabel domain.

    Possible Error Codes In DEACTIVATE USER

    8504 , 8506 , 8509 , 8516 , 8533


    Get Plan Info

    Download client libraries : C# | GO | JAVA | PHP | PYTHON



    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zoho.com";
    
        class Program
        {
            public IReportClient getClient()
            {
                IReportClient RepClient = new ReportClient(AUTHTOKEN);
                return RepClient;
            }
    
            public void getplaninfo(IReportClient rc)
            {
                try
                {
                    string uri = rc.GetURI(EMAIL);