NAV Navbar
CURL C# GO JAVA PHP PYTHON
  • Zoho Reports API
  • Important Notations
  • Prerequisites
  • API Specification
  • Data API
  • Modeling API
  • Metadata API
  • Sharing and Collaboration API
  • Embed API
  • User Management API
  • Client Libraries
  • 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.

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

    Important Notations

    We have used a few notations in this document. Here are their meanings

    <hostname> is the host name of the Zoho Reports server.

    <webclient port> is the port that Zoho Reports runs on. By default, this is 8443.

    Here is how you can get your web client port

    <zohoreportsemailaddress> is the email address associated with your Zoho Reports user login.

    Prerequisites

    The following are the prerequisites to use Zoho Reports API

    1. Generating an AuthToken

    2. Creating a Reporting Database

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

    Auth Token

    Browser Mode : URL

    
    https://<hostname>:<web client port>/iam/apiauthtoken/create?SCOPE=ZROP/reportsapi
    
    
    
    https://<hostname>:<web client port>/iam/apiauthtoken/create?SCOPE=ZROP/reportsapi
    
    
    
    https://<hostname>:<web client port>/iam/apiauthtoken/create?SCOPE=ZROP/reportsapi
    
    
    
    https://<hostname>:<web client port>/iam/apiauthtoken/create?SCOPE=ZROP/reportsapi
    
    
    
    https://<hostname>:<web client port>/iam/apiauthtoken/create?SCOPE=ZROP/reportsapi
    
    
    
    https://<hostname>:<web client port>/iam/apiauthtoken/create?SCOPE=ZROP/reportsapi
    
    

    API Mode : URL

    
    https://<hostname>:<web client port>/iam/apiauthtoken/nb/create?SCOPE=ZROP/reportsapi?EMAIL_ID=emailid&PASSWORD=password
    
    
    
    https://<hostname>:<web client port>/iam/apiauthtoken/nb/create?SCOPE=ZROP/reportsapi?EMAIL_ID=emailid&PASSWORD=password
    
    
    
    https://<hostname>:<web client port>/iam/apiauthtoken/nb/create?SCOPE=ZROP/reportsapi?EMAIL_ID=emailid&PASSWORD=password
    
    
    
    https://<hostname>:<web client port>/iam/apiauthtoken/nb/create?SCOPE=ZROP/reportsapi?EMAIL_ID=emailid&PASSWORD=password
    
    
    
    https://<hostname>:<web client port>/iam/apiauthtoken/nb/create?SCOPE=ZROP/reportsapi?EMAIL_ID=emailid&PASSWORD=password
    
    
    
    https://<hostname>:<web client port>/iam/apiauthtoken/nb/create?SCOPE=ZROP/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
    
    
    
    The following is a sample response for a Auth Token request.
    
    #
    
    #Wed Jun 29 03:07:33 PST 2013
    
    AUTHTOKEN=bad18eba1ff45jk7858b8ae88a77fa30
    
    RESULT=TRUE
    
    
    
    The following is a sample response for a Auth Token request.
    
    #
    
    #Wed Jun 29 03:07:33 PST 2013
    
    AUTHTOKEN=bad18eba1ff45jk7858b8ae88a77fa30
    
    RESULT=TRUE
    
    
    
    The following is a sample response for a Auth Token request.
    
    #
    
    #Wed Jun 29 03:07:33 PST 2013
    
    AUTHTOKEN=bad18eba1ff45jk7858b8ae88a77fa30
    
    RESULT=TRUE
    
    
    
    The following is a sample response for a Auth Token request.
    
    #
    
    #Wed Jun 29 03:07:33 PST 2013
    
    AUTHTOKEN=bad18eba1ff45jk7858b8ae88a77fa30
    
    RESULT=TRUE
    
    
    
    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.
    
    * #-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.
    
    * #-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.
    
    * #-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.
    
    * #-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.
    
    * #-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 Reports 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 Reports Accounts (web client port/iam) using the URL format given in the sample.

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

    Parameter Description
    EMAIL_ID Specify the email address associated with your Zoho Reports user login.
    PASSWORD Specify your Zoho Reports Password

    Managing Auth Tokens

    You can access and manage all the active secret Auth Tokens of Zoho Reports from the Zoho Reports Auth Token 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 HTTPS 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://<hostname>:<webclient port>/api/abc@zylker.com/EmployeeDB/EmployeeDetails?ZOHO_ACTION=ADDROW&
    ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML&authtoken=g38sl4j4856guvncrywox8251sssds
    &ZOHO_API_VERSION=1.0
    
    
    
    The below URL adds a row in EmployeeDetails table in EmployeeDB database in a CSV format.
    
    https://<hostname>:<webclient port>/api/abc@zylker.com/EmployeeDB/EmployeeDetails?ZOHO_ACTION=ADDROW&
    ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML&authtoken=g38sl4j4856guvncrywox8251sssds
    &ZOHO_API_VERSION=1.0
    
    
    
    The below URL adds a row in EmployeeDetails table in EmployeeDB database in a CSV format.
    
    https://<hostname>:<webclient port>/api/abc@zylker.com/EmployeeDB/EmployeeDetails?ZOHO_ACTION=ADDROW&
    ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML&authtoken=g38sl4j4856guvncrywox8251sssds
    &ZOHO_API_VERSION=1.0
    
    
    
    The below URL adds a row in EmployeeDetails table in EmployeeDB database in a CSV format.
    
    https://<hostname>:<webclient port>/api/abc@zylker.com/EmployeeDB/EmployeeDetails?ZOHO_ACTION=ADDROW&
    ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML&authtoken=g38sl4j4856guvncrywox8251sssds
    &ZOHO_API_VERSION=1.0
    
    
    
    The below URL adds a row in EmployeeDetails table in EmployeeDB database in a CSV format.
    
    https://<hostname>:<webclient port>/api/abc@zylker.com/EmployeeDB/EmployeeDetails?ZOHO_ACTION=ADDROW&
    ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML&authtoken=g38sl4j4856guvncrywox8251sssds
    &ZOHO_API_VERSION=1.0
    
    
    
    The below URL adds a row in EmployeeDetails table in EmployeeDB database in a CSV format.
    
    https://<hostname>:<webclient port>/api/abc@zylker.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
    
    Parameters for EmployeeDetails table in EmployeeDB database. 
    
    &Name=Gary&Date Of Birth=12-Jun-1980&Country=USA&Salary=10000
    
    Parameters for EmployeeDetails table in EmployeeDB database. 
    
    &Name=Gary&Date Of Birth=12-Jun-1980&Country=USA&Salary=10000
    
    Parameters for EmployeeDetails table in EmployeeDB database. 
    
    &Name=Gary&Date Of Birth=12-Jun-1980&Country=USA&Salary=10000
    
    Parameters for EmployeeDetails table in EmployeeDB database. 
    
    &Name=Gary&Date Of Birth=12-Jun-1980&Country=USA&Salary=10000
    
    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://<hostname>:<webclient port>/api/<zohoreportsemailaddress>/<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.
    
    
    
    Sample response to a request adding a row to the EmployeeDetails table in the 
    EmployeeDB database.
    
    
    
    Sample response to a request adding a row to the EmployeeDetails table in the 
    EmployeeDB database.
    
    
    
    Sample response to a request adding a row to the EmployeeDetails table in the 
    EmployeeDB database.
    
    
    
    Sample response to a request adding a row to the EmployeeDetails table in the 
    EmployeeDB database.
    
    
    
    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@zylker.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>
    
    
    <?xml version="1.0" encoding="UTF-8" ?>
    <response uri="/api/abc@zylker.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>
    
    
    <?xml version="1.0" encoding="UTF-8" ?>
    <response uri="/api/abc@zylker.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>
    
    
    <?xml version="1.0" encoding="UTF-8" ?>
    <response uri="/api/abc@zylker.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>
    
    
    <?xml version="1.0" encoding="UTF-8" ?>
    <response uri="/api/abc@zylker.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>
    
    
    <?xml version="1.0" encoding="UTF-8" ?>
    <response uri="/api/abc@zylker.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@zylker.com/EmployeeDB/EmployeeDetails",
            "action": "ADDROW",
            "result":
            {
                "column_order":["Name","Date Of Birth","Salary","Country"],
                "rows":
                ["Gary","12-Jun-1980",10000,"USA"]
            }
        }
    } 
    
    {
        "response":
        {
            "uri": "/api/abc@zylker.com/EmployeeDB/EmployeeDetails",
            "action": "ADDROW",
            "result":
            {
                "column_order":["Name","Date Of Birth","Salary","Country"],
                "rows":
                ["Gary","12-Jun-1980",10000,"USA"]
            }
        }
    } 
    
    {
        "response":
        {
            "uri": "/api/abc@zylker.com/EmployeeDB/EmployeeDetails",
            "action": "ADDROW",
            "result":
            {
                "column_order":["Name","Date Of Birth","Salary","Country"],
                "rows":
                ["Gary","12-Jun-1980",10000,"USA"]
            }
        }
    } 
    
    {
        "response":
        {
            "uri": "/api/abc@zylker.com/EmployeeDB/EmployeeDetails",
            "action": "ADDROW",
            "result":
            {
                "column_order":["Name","Date Of Birth","Salary","Country"],
                "rows":
                ["Gary","12-Jun-1980",10000,"USA"]
            }
        }
    } 
    
    {
        "response":
        {
            "uri": "/api/abc@zylker.com/EmployeeDB/EmployeeDetails",
            "action": "ADDROW",
            "result":
            {
                "column_order":["Name","Date Of Birth","Salary","Country"],
                "rows":
                ["Gary","12-Jun-1980",10000,"USA"]
            }
        }
    } 
    
    {
        "response":
        {
            "uri": "/api/abc@zylker.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/<zohoreportsemailaddress>/<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/<zohoreportsemailaddress>/<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
    
    
    
    Sample error response for import data in Table EmployeeDetails in the database EmployeeDB
    
    
    
    Sample error response for import data in Table EmployeeDetails in the database EmployeeDB
    
    
    
    Sample error response for import data in Table EmployeeDetails in the database EmployeeDB
    
    
    
    Sample error response for import data in Table EmployeeDetails in the database EmployeeDB
    
    
    
    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>
    
    
    <?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>
    
    
    <?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>
    
    
    <?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>
    
    
    <?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>
    
    
    <?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"
            }
        }
    }
    
    {
        "response":
        {
            "url": "/api/demouser/EmployeeDB/EmployeeDetails",
            "action": "IMPORT",
            "error":
            {
                "code":7138,
                "message": "Table EmployeeDetails is not present in the database EmployeeDB"
            }
        }
    }
    
    {
        "response":
        {
            "url": "/api/demouser/EmployeeDB/EmployeeDetails",
            "action": "IMPORT",
            "error":
            {
                "code":7138,
                "message": "Table EmployeeDetails is not present in the database EmployeeDB"
            }
        }
    }
    
    {
        "response":
        {
            "url": "/api/demouser/EmployeeDB/EmployeeDetails",
            "action": "IMPORT",
            "error":
            {
                "code":7138,
                "message": "Table EmployeeDetails is not present in the database EmployeeDB"
            }
        }
    }
    
    {
        "response":
        {
            "url": "/api/demouser/EmployeeDB/EmployeeDetails",
            "action": "IMPORT",
            "error":
            {
                "code":7138,
                "message": "Table EmployeeDetails is not present in the database EmployeeDB"
            }
        }
    }
    
    {
        "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/<zohoreportsemailaddress>/<databasename>/<tablename>" action="<specifiedaction>">

    <error>

    [error details]

    </error>

    </response>

    JSON Format

    {

    "response":

    {

    "uri": "/api/<zohoreportsemailaddress>/<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. 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 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

    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@zylker.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@zylker.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@zylker.com";
        String dbname = "EmployeeDB";
        String tbname = "EmployeeTB";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        Map config = new HashMap();
        Map colval = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
        rc.setIamServerURL("https://<hostname>:<web client port>/iam");
        rc.setReportServerURL("https://<hostname>:<webclient port>");
    
        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@zylker.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@zylker.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://<hostname>:<webclient port>/api/abc@zylker.com/EmployeeDB/EmployeeDetails
    
    
    
    

    Sample Response JSON Format:

    {
        "response":
        {
            "url": "/api/abc@zylker.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@zylker.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://<hostname>:<webclient port>/api/<zohoreportsemailaddress>/<Databasename>/<Tablename>

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

    Delete Data

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

    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zylker.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@zylker.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@zylker.com";
        String dbname = "EmployeeDB";
        String tbname = "EmployeeTB";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
        rc.setIamServerURL("https://<hostname>:<web client port>/iam");
        rc.setReportServerURL("https://<hostname>:<webclient port>");
    
        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@zylker.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@zylker.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://<hostname>:<webclient port>/api/abc@zylker.com/EmployeeDB/EmployeeDetails
    
    
    
    

    Sample Response JSON Format:

    {
        "response":
        {
            "uri": "/api/abc@zylker.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@zylker.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://<hostname>:<webclient port>/api/<zohoreportsemailaddress>/<Databasename>/<Tablename>

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

    Update Data

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

    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zylker.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@zylker.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@zylker.com";
        String dbname = "EmployeeDB";
        String tbname = "EmployeeTB";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        Map config = new HashMap();
        Map colval = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
        rc.setIamServerURL("https://<hostname>:<web client port>/iam");
        rc.setReportServerURL("https://<hostname>:<webclient port>");
    
        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@zylker.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@zylker.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://<hostname>:<webclient port>/api/abc@zylker.com/EmployeeDB/EmployeeDetails
    
    
    
    

    Sample Response JSON Format:

    {
        "response":
        {
            "uri": "/api/abc@zylker.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@zylker.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://<hostname>:<webclient port>/api/<zohoreportsemailaddress>/<Databasename>/<Tablename>

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

    Import Data

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

    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zylker.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");
                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@zylker.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@zylker.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);
        rc.setIamServerURL("https://<hostname>:<web client port>/iam");
        rc.setReportServerURL("https://<hostname>:<webclient port>");
    
        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@zylker.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@zylker.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://<hostname>:<webclient port>/api/abc@zylker.com/sample/Employee
    
    
    

    Sample Response JSON Format:

    {
        " response":
        {
            "uri": "/api/abc@zylker.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@zylker.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://<hostname>:<webclient port>/api/<zohoreportsemailaddress>/<Databasename>/<Tablename>

    URL GET 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.
    ZOHO_API_VERSION 1.0 The API version of Zoho Reports based on which the application(/service) has been written. This parameter allows Zoho Reports to handle applications based on the older versions.The current API version is 1.0.
    ZOHO_FILE or ZOHO_IMPORT_DATA File or string ZOHO_FILE - The file to be imported.
    ZOHO_IMPORT_DATA - The strng to be imported.

    URL POST 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
    (mandatory)
    File The file to 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 exist in the specified database.
  • In case its false, no table is created even if the table refered in the URL does not exist 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

    Export Data

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

    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zylker.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@zylker.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@zylker.com";
        String dbname = "EmployeeDB";
        String tbname = "EmployeeTB";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        File csvFile = new File("samples/StoreSales.csv");
    
        private ReportClient rc = new ReportClient(authtoken);
        rc.setIamServerURL("https://<hostname>:<web client port>/iam");
        rc.setReportServerURL("https://<hostname>:<webclient port>");
    
        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@zylker.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@zylker.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://<hostname>:<webclient port>/api/abc@zylker.com/EmployeeDB/EmployeeDetails
    
    
    

    Sample Response JSON Format:

    { 
        "response":
        {
            "uri": "/api/abc@zylker.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@zylker.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://<hostname>:<webclient port>/api/<zohoreportsemailaddress>/<Databasename>/<Tablename>

    URL GET 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.
    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 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_TEXT
    ZOHO_HEAD_RIGHT_TEXT
    ZOHO_HEAD_CENTER_TEXT
    ZOHO_FOOT_LEFT_TEXT
    ZOHO_FOOT_RIGHT_TEXT
    ZOHO_FOOT_CENTER_TEXT
    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);
            ...
        }
        ...
    }
    </script>
    
    

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

    <script src="
    https://<hostname>:<webclient port>/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,

    sampleFunction
    ({ 
        "response":
        {
            "uri": "/api/abc@zylker.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.

    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 "Department"= 'Finance' 
    is given below.
    
    

    URL:

    
    https://<hostname>:<webclient port>/api/abc@zylker.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:

    (<column name/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.

    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.

    Create Table

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

    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zylker.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\",\"SYSTEMTABLE\": true,\"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@zylker.com"
            dbname = "Employee"
            authtoken = "f7d016b46be276cas21asd2a592f40101"
    )
    
    func createtable() {
            url := reportclient.GetDbUri(email, dbname)
            tableconfig := "{\"TABLENAME\": \"SystemTable\",\"TABLEDESCRIPTION\": \"Testing Purpose\",
                             \"SYSTEMTABLE\": true,\"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@zylker.com";
        String dbname = "EmployeeDB";
        String tbname = "EmployeeTB";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
        rc.setIamServerURL("https://<hostname>:<web client port>/iam");
        rc.setReportServerURL("https://<hostname>:<webclient port>");
    
        public void createtable() throws Exception
        {
            String uri = rc.getURI(email,dbname,tbname);
            String tableDesign = "{\"TABLENAME\":\"SysteTable\",\"TABLEDESCRIPTION\"
                    :\"Testing Purpose\",\"SYSTEMTABLE\": true,\"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@zylker.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",
                "SYSTEMTABLE": true,
                "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@zylker.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\",\"SYSTEMTABLE\": true,\"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://<hostname>:<webclient port>/api/abc@zylker.com/Employee
    
    
    

    Sample Response XML Format:

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

    Sample Response JSON Format:

    { 
        "response": 
        { 
            "uri":"\/api\/abc@zylker.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://<hostname>:<webclient port>/api/<zohoreportsemailaddress>/<Databasename>

    URL GET 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.
    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
    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, 8504, 8506, 8516, 8533, 8534

    Rename View

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

    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zylker.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@zylker.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@zylker.com";
        String dbname = "EmployeeDB";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
        rc.setIamServerURL("https://<hostname>:<web client port>/iam");
        rc.setReportServerURL("https://<hostname>:<webclient port>");
    
        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@zylker.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@zylker.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://<hostname>:<webclient port>/api/abc@zylker.com/Employee
    
    
    

    Sample Response XML Format:

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

    Sample Response JSON Format:

    {
        "response":
        {
            "uri":"\/api\/abc@zylker.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://<hostname>:<webclient port>/api/<zohoreportsemailaddress>/<Databasename>

    URL GET 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.
    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
    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
    (mandatory)
    View description New description for the view

    POSSIBLE ERROR CODES IN RENAME VIEW

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

    Add Column

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

    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zylker.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@zylker.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@zylker.com";
        String dbname = "EmployeeDB";
        String tbname = "EmployeeTB";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
        rc.setIamServerURL("https://<hostname>:<web client port>/iam");
        rc.setReportServerURL("https://<hostname>:<webclient port>");
    
        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@zylker.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@zylker.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(self,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://<hostname>:<webclient port>/api/abc@zylker.com/SalesDB/Sales
    
    
    

    Sample Response XML Format:

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

    Sample Response JSON Format:

    {
        "response":
        {
            "uri":"\/api\/abc@zylker.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://<hostname>:<webclient port>/api/<zohoreportsemailaddress>/<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 GET 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.
    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
    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 VIEW

    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@zylker.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@zylker.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@zylker.com";
        String dbname = "EmployeeDB";
        String tbname = "EmployeeTB";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
        rc.setIamServerURL("https://<hostname>:<web client port>/iam");
        rc.setReportServerURL("https://<hostname>:<webclient port>");
    
        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@zylker.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@zylker.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(self,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://<hostname>:<webclient port>/api/abc@zylker.com/SalesDB/Sales
    
    

    Sample Response XML Format:

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

    Sample Response JSON Format:

    {
        "response":
        {
            "uri":"\/api\/abc@zylker.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://<hostname>:<webclient port>/api/<zohoreportsemailaddress>/<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 GET 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.
    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
    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@zylker.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@zylker.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@zylker.com";
        String dbname = "EmployeeDB";
        String tbname = "EmployeeTB";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
        rc.setIamServerURL("https://<hostname>:<web client port>/iam");
        rc.setReportServerURL("https://<hostname>:<webclient port>");
    
        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@zylker.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@zylker.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(self,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://<hostname>:<webclient port>/api/abc@zylker.com/SalesDB/Sales
    
    
    

    Sample Response XML Format:

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

    Sample Response JSON Format:

    {
        "response":
        {
            "uri":"\/api\/abc@zylker.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://<hostname>:<webclient port>/api/<zohoreportsemailaddress>/<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 GET 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.
    ZOHO_API_VERSION 1.0 The API version of Zoho Reports based on which the application(/service) has been written. This parameter allows 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
    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@zylker.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@zylker.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@zylker.com";
        String dbname = "EmployeeDB";
        String tbname = "EmployeeTB";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
    
        private ReportClient rc = new ReportClient(authtoken);
        rc.setIamServerURL("https://<hostname>:<web client port>/iam");
        rc.setReportServerURL("https://<hostname>:<webclient port>");
    
        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@zylker.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@zylker.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://<hostname>:<webclient port>/api/abc@zylker.com/SalesDB/Sales
    
    
    

    Sample Response XML Format:

    <?xml version="1.0" encoding="UTF-8" ?>
    <response uri="/api/user@zylker.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@zylker.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://<hostname>:<webclient port>/api/<zohoreportsemailaddress>/<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 GET 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.
    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
    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@zylker.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@zylker.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@zylker.com";
        String dbname = "EmployeeDB";
        String tbname = "EmployeeTB";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
    
        private ReportClient rc = new ReportClient(authtoken);
        rc.setIamServerURL("https://<hostname>:<web client port>/iam");
        rc.setReportServerURL("https://<hostname>:<webclient port>");
    
        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@zylker.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@zylker.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://<hostname>:<webclient port>/api/abc@zylker.com/SalesDB/Sales
    
    
    

    Sample Response XML Format:

    <?xml version="1.0" encoding="UTF-8" ?>
    <response uri="/api/user@zylker.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@zylker.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://<hostname>:<webclient port>/api/<zohoreportsemailaddress>/<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 GET 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.
    ZOHO_API_VERSION 1.0 The API version of Zoho Reports based on which the application(/service) has been written. This parameter allows 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
    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

    Autogenerate reports

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

    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zylker.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@zylker.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@zylker.com";
        String dbname = "EmployeeDB";
        String tbname = "EmployeeTB";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
    
        private ReportClient rc = new ReportClient(authtoken);
        rc.setIamServerURL("https://<hostname>:<web client port>/iam");
        rc.setReportServerURL("https://<hostname>:<webclient port>");
    
        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@zylker.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@zylker.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://<hostname>:<webclient port>/api/abc@zylker.com/SalesDB/Sales
    
    
    

    Sample Response XML Format:

    <?xml version="1.0" encoding="UTF-8" ?>
    <response uri="/api/user@zylker.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@zylker.com/Auto-Copy/Auto",
        "action": "AUTOGENREPORTS",
        "result": {
          "status": "success",
          "message": "Reports generated successfully"
        }
      }
    }
    
    

    The Autogen 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://<hostname>:<webclient port>/api/<zohoreportsemailaddress>/<Databasename>/<Tablename>

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

    POSSIBLE ERROR CODES IN AUTOGENERATE REPORTS

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

    Copy Database

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

    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zylker.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@zylker.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@zylker.com";
        String dbname = "EmployeeDB";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
        rc.setIamServerURL("https://<hostname>:<web client port>/iam");
        rc.setReportServerURL("https://<hostname>:<webclient port>");
    
        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@zylker.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@zylker.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(self,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://<hostname>:<webclient port>/api/abc@zylker.com/Employee
    
    
    

    Sample Response XML Format:

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

    Sample Response JSON Format:

    {
        "response": 
        {
            "uri": "\/api\/abc@zylker.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://<hostname>:<webclient port>/api/<zohoreportsemailaddress>/<Databasename>

    URL GET 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.
    ZOHO_API_VERSION 1.0 The API version of Zoho Reports based on which the application(/service) has been written. This parameter allows 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
    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 description 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://<hostname>:<webclient port>/api/abcd@zylker.com/SourceEmployeeDB?ZOHO_ACTION=GETCOPYDBKEY&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML&authtoken=<source_db_owner_authtoken>&ZOHO_API_VERSION=1.0.
    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, 8506, 8516, 8533, 15007

    Delete Database

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

    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zylker.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@zylker.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@zylker.com";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
        rc.setIamServerURL("https://<hostname>:<web client port>/iam");
        rc.setReportServerURL("https://<hostname>:<webclient port>");
    
        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@zylker.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@zylker.com"
        AUTHTOKEN="f7d016b46be276ca12fa32a592f40101"
        rc = None
        rc = ReportClient(self.AUTHTOKEN)
    
        def DeleteDatabase(self,rc):
            uri = rc.getUserURI(self.LOGINEMAILID)
            databaseName = "databaseName"
            rc.deleteDatabase(self,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://<hostname>:<webclient port>/api/abc@zylker.com
    
    

    Sample Response XML Format:

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

    Sample Response JSON Format:

    {
        "response": 
        {
            "uri": "\/api\/abc@zylker.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://<hostname>:<webclient port>/api/<zohoreportsemailaddress>

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

    Create Similar Views

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

    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zylker.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@zylker.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@zylker.com";
        String databaseName = "DB1";
        String tableName = "New table";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
        rc.setIamServerURL("https://<hostname>:<web client port>/iam");
        rc.setReportServerURL("https://<hostname>:<webclient port>");
    
        public void createSimilarViews() throws Exception
        {
            String uri = rc.getURI(emailId,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@zylker.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@zylker.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_REF_VIEW=old_table&ZOHO_FOLDER_NAME=old_report&&ISCOPYCUSTOMFORMULA=false
             &ISCOPYAGGFORMULA=false" 
             https://<hostname>:<webclient port>/api/abc@zylker.com/Database/Table
    
    

    Sample Response XML Format:

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

    Sample Response JSON Format:

    {
        "response": 
        {
            "uri": "\/api\/abc@zylker.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://<hostname>:<webclient port>/api/<zohoreportsemailaddress>/<DatabaseName>/<TableName>

    URL GET 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.
    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
    ZOHO_REF_VIEW
    (mandatory)
    Reference view name This parameter holds the name of the reference view name.
    ZOHO_FOLDER_NAME
    (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

    Add Lookup

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

    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zylker.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@zylker.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@zylker.com";
        String dbname = "EmployeeDB";
        String tbname = "EmployeeTB";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
        rc.setIamServerURL("https://<hostname>:<web client port>/iam");
        rc.setReportServerURL("https://<hostname>:<webclient port>");
    
        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@zylker.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@zylker.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://<hostname>:<webclient port>/api/abc@zylker.com/Employee/Employee
    
    

    Sample Response XML Format:

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

    Sample Response JSON Format:

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

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

    URL

    https://<hostname>:<webclient port>/api/<zohoreportsemailaddress>/<Databasename>/<Tablename>

    URL GET 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.
    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
    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@zylker.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@zylker.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@zylker.com";
        String dbname = "EmployeeDB";
        String tbname = "EmployeeTB";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
        rc.setIamServerURL("https://<hostname>:<web client port>/iam");
        rc.setReportServerURL("https://<hostname>:<webclient port>");
    
        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@zylker.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@zylker.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://<hostname>:<webclient port>/api/abc@zylker.com/Employee/Employee
    
    

    Sample Response XML Format:

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

    Sample Response JSON Format:

    {
        "response":
        {
            "uri":"\/api\/abc@zylker.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://<hostname>:<webclient port>/api/<zohoreportsemailaddress>/<Databasename>/<Tablename>

    URL GET 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.
    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
    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, 7138, 7165, 8504, 8506, 8516, 8533

    Copy Reports

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

    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zylker.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@zylker.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@zylker.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);
        rc.setIamServerURL("https://<hostname>:<web client port>/iam");
        rc.setReportServerURL("https://<hostname>:<webclient port>");
    
        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@zylker.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@zylker.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://<hostname>:<webclient port>/api/abc@zylker.com/Employee
    
    

    Sample Response XML Format:

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

    Sample Response JSON Format:

    {
        "response":
        {
            "uri":"\/api\/source_account@zylker.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://<hostname>:<webclient port>/api/<zohoreportsemailaddress>/<Databasename>

    URL GET 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.
    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
    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://<hostname>:<webclient port>/api/abcd@zylker.com/SourceEmployeeDB?ZOHO_ACTION=GETCOPYDBKEY&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML&authtoken=<source_db_owner_authtoken>&ZOHO_API_VERSION=1.0.
    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@zylker.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@zylker.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@zylker.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);
        rc.setIamServerURL("https://<hostname>:<web client port>/iam");
        rc.setReportServerURL("https://<hostname>:<webclient port>");
    
        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@zylker.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@zylker.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://<hostname>:<webclient port>/api/abc@zylker.com/Employee/Employee
    
    

    Sample Response XML Format:

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

    Sample Response JSON Format:

    {
        "response":
             {
                "uri":"\/api\/source_account@zylker.com\/SourceEmployeeDB\/SourceEmployeeDetails",
                "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://<hostname>:<webclient port>/api/<zohoreportsemailaddress>/<Databasename>/<Tablename>

    URL GET 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.
    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
    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://<hostname>:<webclient port>/api/abcd@zylker.com/SourceEmployeeDB?ZOHO_ACTION=GETCOPYDBKEY&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML&authtoken=<source_db_owner_authtoken>&ZOHO_API_VERSION=1.0.
    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

    Error Codes in Modeling API

    This section explains about the error response sent from the Zoho Reports server on failure of Metadata APIs. You can use this for appropriate error handling.

    Error Handling

    Sample error XML Format:

    
    <response uri="/api/abc@zylker.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@zylker.com\/Employee",
            "action": "DATABASEMETADATA",
            "error": 
            {
            "code":7103,
            "message": "Database not found! Please check whether the database exists"
            } 
        }
    }
    

    Error Codes

    Error Code Reason Solution
    7101 Database with the same name exists already. Provide an alternate name.
    7103 The database specified does not exists Check the name of the database to be deleted.
    7105 View name specified in the database does not exist. Provide a valid view name.
    7107 The column does not exists 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 alread exists in this database. Provide an alternate name.
    7128 The column is already exists in the specified Zoho Reports Table Provide a 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 name.
    7144 Mentioned Folder is not present in the 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) Deleting columns in System Table is not allowed. You could only delete a column in a user created/defined table using this API.
    7165 The database specified is a system database 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.
    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 valid JSON data.
    15000 A table / view which is needed to copy the specified report is missing in the destination database Check the destination database and create the missing table/view
    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 Database Check the formula column name(s) specified in the ZOHO_FORMULATOCOPY parameter is correct
    15012 The reports secified 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 onprem-support@zohoreports.com . Zoho Reports 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

    Get Database Name

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

    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zylker.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@zylker.com
    .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@zylker.com";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        long dbid = 1148746002350004001L;
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
        rc.setIamServerURL("https://<hostname>:<web client port>/iam");
        rc.setReportServerURL("https://<hostname>:<webclient port>");
    
        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@zylker.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@zylker.com
    .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://<hostname>:<webclient port>/api/abc@zylker.com
    
    

    Sample Response XML Format:

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

    Sample Response JSON Format:

    {
        "response": 
        {
            "uri": "\/api\/abc@zylker.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. The account administrator, database owner and all users to whom this database was shared can use this API.

    URL

    https://<hostname>:<webclient port>/api/<zohoreportsemailaddress>

    URL GET 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.
    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
    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@zylker.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@zylker.com
    .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@zylker.com";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
    
        private ReportClient rc = new ReportClient(authtoken);
        rc.setIamServerURL("https://<hostname>:<web client port>/iam");
        rc.setReportServerURL("https://<hostname>:<webclient port>");
    
        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@zylker.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@zylker.com
    .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://<hostname>:<webclient port>/api/abc@zylker.com
    
    

    Sample Response XML Format:

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

    Sample Response JSON Format:

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

    The Isdbexist API is used to check wheather the database is exist 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://<hostname>:<webclient port>/api/<zohoreportsemailaddress>

    URL GET 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.
    ZOHO_API_VERSION 1.0 The API version of Zoho Reports based on which the application(/service) has been written. This parameter allows 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
    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@zylker.com";
        DBNAME = "EmployeeDB";
    
        class Program
        {
            public IReportClient getClient()
            {
                IReportClient RepClient = new ReportClient(AUTHTOKEN);
                return RepClient;
            }
    
            public void copyDatabaseKey(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@zylker.com
    .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@zylker.com";
        String dbname = "EmployeeDB";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
        rc.setIamServerURL("https://<hostname>:<web client port>/iam");
        rc.setReportServerURL("https://<hostname>:<webclient port>");
    
        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@zylker.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@zylker.com
    .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://<hostname>:<webclient port>/api/abc@zylker.com/Employee
    
    
    

    Sample Response XML Format:

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

    Sample Response JSON Format:

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

    The Copy Database Key API is used to copy the database key.

    URL

    https://<hostname>:<webclient port>/api/<zohoreportsemailaddress>/<Databasename>

    URL GET 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.
    ZOHO_API_VERSION 1.0 The API version of Zoho Reports based on which the application(/service) has been written. This parameter allows Zoho Reports to handle applications based on the older versions.The current API version is 1.0.

    POSSIBLE ERROR CODES IN GET 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@zylker.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@zylker.com
    .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@zylker.com";
        String dbname = "EmployeeDB";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        long objid = 1148746000033204006L;
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
        rc.setIamServerURL("https://<hostname>:<web client port>/iam");
        rc.setReportServerURL("https://<hostname>:<webclient port>");
    
        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@zylker.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@zylker.com
    .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://<hostname>:<webclient port>/api/abc@zylker.com
    
    

    Sample Response XML Format:

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

    Sample Response JSON Format:

    {
        "response": 
        {
            "uri": "\/api\/abc@zylker.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://<hostname>:<webclient port>/api/<zohoreportsemailaddress>

    URL GET 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.
    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
    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@zylker.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@zylker.com
    .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@zylker.com";
        String dbname = "EmployeeDB";
        String tbname = "EmployeeTB";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
        rc.setIamServerURL("https://<hostname>:<web client port>/iam");
        rc.setReportServerURL("https://<hostname>:<webclient port>");
    
        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@zylker.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@zylker.com
    .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://<hostname>:<webclient port>/api/abc@zylker.com/Employee/EmployeeDetails
    
    

    Sample Response XML Format:

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

    Sample Response JSON Format:

    {
        "response": 
        {
            "uri": "\/api\/abc@zylker.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://<hostname>:<webclient port>/api/<zohoreportsemailaddress>/<Databasename>/<Tablename>

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

    This section explains about the error response sent from the Zoho Reports server on failure of Metadata APIs. You can use this for appropriate error handling.

    Error Handling

    Sample error XML Format:

    
    <response uri="/api/abc@zylker.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@zylker.com\/Employee",
            "action": "DATABASEMETADATA",
            "error": 
            {
            "code":7103,
            "message": "Database not found! Please check whether the database exists"
            } 
        }
    }
    

    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 the Database Name.
    7103 The database name specified in the API request 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 i 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 onprem-support@zohoreports.com . Zoho Reports 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@zylker.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@zylker.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@zylker.com
    .com"
            dbname = "Employee"
            authtoken = "f7d016b46be276cas21asd2a592f40101"
    )
    
    func shareview() {
            url := reportclient.GetDbUri(email, dbname)
            emailids := "user1@zylker.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@zylker.com";
        String dbname = "EmployeeDB";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        String emails = "abc@zylker.com";
        String views = "new";
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
        rc.setIamServerURL("https://<hostname>:<web client port>/iam");
        rc.setReportServerURL("https://<hostname>:<webclient port>");
    
        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@zylker.com";
        $DB_NAME = "EmployeeDB";
        $AUTHTOKEN = "f7d016b46be2763wasda32a592f40101";
    
        $report_client_request = new ReportClient($AUTHTOKEN); 
    
        $uri = $report_client_request->getDbURI($EMAIL_ID, $DB_NAME);
        $emails = "user@zylker.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@zylker.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@zylker.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@zylker.com&ZOHO_READ=true" 
             https://<hostname>:<webclient port>/api/abc@zylker.com/Employee
    
    

    Sample Response XML Format:

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

    Sample Response JSON Format:

    {
        "response":
        {
            "uri": "/api/abc@zylker.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://<hostname>:<webclient port>/api/<zohoreportsemailaddress>/<Databasename>

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

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

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

    Remove Sharing

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

    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zylker.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@zylker.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@zylker.com
    .com"
            dbname = "Employee"
            authtoken = "f7d016b46be276cas21asd2a592f40101"
    )
    
    func removeshare() {
            url := reportclient.GetDbUri(email, dbname)
            emailids := "user1@zylker.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@zylker.com";
        String dbname = "EmployeeDB";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        String emails = "abc@zylker.com";
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
        rc.setIamServerURL("https://<hostname>:<web client port>/iam");
        rc.setReportServerURL("https://<hostname>:<webclient port>");
    
        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@zylker.com";
        $DB_NAME = "EmployeeDB";
        $AUTHTOKEN = "f7d016b46be2763wasda32a592f40101";
    
        $report_client_request = new ReportClient($AUTHTOKEN);
    
        $uri = $report_client_request->getDbURI($EMAIL_ID, $DB_NAME);
        $emails = "user@zylker.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@zylker.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@zylker.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@zylker.com&ZOHO_ALLVIEWS=true" 
             https://<hostname>:<webclient port>/api/abc@zylker.com/Employee
    
    

    Sample Response XML Format:

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

    Sample Response JSON Format:

    {
        "response":
        {
            "uri": "/api/abc@zylker.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://<hostname>:<webclient port>/api/<zohoreportsemailaddress>/<Databasename>

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

    POSSIBLE ERROR CODES IN REMOVE SHARE

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

    Add Database Owner

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

    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zylker.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@zylker.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@zylker.com"
            dbname = "Employee"
            authtoken = "f7d016b46be276cas21asd2a592f40101"
    )
    
    func adddbowner() {
            url := reportclient.GetDbUri(email, dbname)
            emailids := "user1@zylker.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@zylker.com";
        String dbname = "EmployeeDB";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        String emails = "abc@zylker.com";
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
        rc.setIamServerURL("https://<hostname>:<web client port>/iam");
        rc.setReportServerURL("https://<hostname>:<webclient port>");
    
        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@zylker.com";
        $DB_NAME = "EmployeeDB";
        $AUTHTOKEN = "f7d016b46be2763wasda32a592f40101";
    
        $report_client_request = new ReportClient($AUTHTOKEN); 
    
        $uri = $report_client_request->getDbURI($EMAIL_ID, $DB_NAME);
        $emails = "user@zylker.com";
        $report_client_request->addDbOwner($uri, $emails);
    ?>
    
    from __future__ import with_statement
    from ReportClient import ReportClient
    import sys
    
    class Sample:
    
        LOGINEMAILID="abc@zylker.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@zylker.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@zylker.com" 
             https://<hostname>:<webclient port>/api/abc@zylker.com/EmployeeDB
    
    

    Sample Response XML Format:

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

    Sample Response JSON Format:

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

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

    URL

    https://<hostname>:<webclient port>/api/<zohoreportsemailaddress>/<Databasename>

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

    Other Parameters

    Parameter Allowed Values Default Value Description Remarks
    ZOHO_INVITE_MAIL true or false false Whether to send an invitation mail on sharing
    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@zylker.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@zylker.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@zylker.com"
            dbname = "Employee"
            authtoken = "f7d016b46be276cas21asd2a592f40101"
    )
    
    func removedbowner() {
            url := reportclient.GetDbUri(email, dbname)
            emailids := "user1@zylker.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@zylker.com";
        String dbname = "EmployeeDB";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        String emails = "abc@zylker.com";
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
        rc.setIamServerURL("https://<hostname>:<web client port>/iam");
        rc.setReportServerURL("https://<hostname>:<webclient port>");
    
        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@zylker.com";
        $DB_NAME = "EmployeeDB";
        $AUTHTOKEN = "f7d016b46be2763wasda32a592f40101";
    
        $report_client_request = new ReportClient($AUTHTOKEN); 
    
        $uri = $report_client_request->getDbURI($EMAIL_ID, $DB_NAME);
        $emails = "user@zylker.com";
        $report_client_request->removeDbOwner($uri, $emails);
    ?>
    
    from __future__ import with_statement
    from ReportClient import ReportClient
    import sys
    
    class Sample:
    
        LOGINEMAILID="abc@zylker.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@zylker.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@zylker.com" 
             https://<hostname>:<webclient port>/api/abc@zylker.com/EmployeeDB
    
    

    Sample Response XML Format:

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

    Sample Response JSON Format:

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

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

    URL

    https://<hostname>:<webclient port>/api/<zohoreportsemailaddress>/<Databasename>

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

    Other Parameters

    Parameter Allowed Values Default Value Description Remarks
    ZOHO_INVITE_MAIL true or false false Whether to send an invitation mail on sharing
    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@zylker.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@zylker.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@zylker.com";
        String dbname = "EmployeeDB";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
        rc.setIamServerURL("https://<hostname>:<web client port>/iam");
        rc.setReportServerURL("https://<hostname>:<webclient port>");
    
        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@zylker.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@zylker.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://<hostname>:<webclient port>/api/abc@zylker.com/SalesDB
    
    

    Sample Response XML Format:

    <?xml version="1.0" encoding="UTF-8" ?>
    <response uri="/api/abc@zylker.com/SalesDB" action="GETSHAREINFO">
      <result>
          <usershareinfo>
            <shareinfo>
                <emailuser1@mydomain.com/email>
                    <permissions>
                        <perminfo viewname="Table1" sharedby="user@mydomain.com">
                            <permission>
                                <readtrue/read>
                                <exporttrue/export>
                                <vudfalse/vud>
                                <addrowfalse/addrow>
                                <updaterowfalse/updaterow>
                                <deleterowfalse/deleterow>
                                <deleteallrowsfalse/deleteallrows>
                                <appendimportfalse/appendimport>
                                <updateimportfalse/updateimport>
                                <truncateimportfalse/truncateimport>
                                <deleteupdateaddimportfalse/deleteupdateaddimport>
                                <sharefalse/share>
                            </permission>
                        </perminfo>
                    </permissions>
            </shareinfo>
            <shareinfo>
                <emailuser4@mydomain.com/email>
                    <permissions>
                        <perminfo viewname="Table1" sharedby="user@mydomain.com">
                            <permission>
                                <readtrue/read>
                                <exporttrue/export>
                                <vudfalse/vud>
                                <addrowfalse/addrow>
                                <updaterowfalse/updaterow>
                                <deleterowfalse/deleterow>
                                <deleteallrowsfalse/deleteallrows>
                                <appendimportfalse/appendimport>
                                <updateimportfalse/updateimport>
                                <truncateimportfalse/truncateimport>
                                <deleteupdateaddimportfalse/deleteupdateaddimport>
                                <sharefalse/share>
                            </permission>
                        </perminfo>
                    </permissions>
            </shareinfo>
            <shareinfo>
                <emailuser215@mydomain.com/email>
                    <permissions>
                        <perminfo viewname="finepick1" sharedby="user@mydomain.com">
                            <permission>
                                <readtrue/read>
                                <exportfalse/export>
                                <vudfalse/vud>
                                <addrowfalse/addrow>
                                <updaterowfalse/updaterow>
                                <deleterowfalse/deleterow>
                                <deleteallrowsfalse/deleteallrows>
                                <appendimportfalse/appendimport>
                                <updateimportfalse/updateimport>
                                <truncateimportfalse/truncateimport>
                                <deleteupdateaddimportfalse/deleteupdateaddimport>
                                <sharefalse/share>
                            </permission>
                        </perminfo>
                    </permissions>
            </shareinfo>
            <shareinfo>
                <emailuserlf12@mydomain.com/email>
                    <permissions>
                        <perminfo viewname="Parent" sharedby="user@mydomain.com">
                            <permission>
                                <readtrue/read>
                                <exportfalse/export>
                                <vudfalse/vud>
                                <addrowfalse/addrow>
                                <updaterowfalse/updaterow>
                                <deleterowfalse/deleterow>
                                <deleteallrowsfalse/deleteallrows>
                                <appendimportfalse/appendimport>
                                <updateimportfalse/updateimport>
                                <truncateimportfalse/truncateimport>
                                <deleteupdateaddimportfalse/deleteupdateaddimport>
                                <sharefalse/share>
                            </permission>
                        </perminfo>
                    </permissions>
            </shareinfo>
            <shareinfo>
                <emailuser33@mydomain.com/email>
                    <permissions>
                        <perminfo viewname="Parent" sharedby="user@mydomain.com">
                            <permission>
                                <readtrue/read>
                                <exportfalse/export>
                                <vudfalse/vud>
                                <addrowfalse/addrow>
                                <updaterowfalse/updaterow>
                                <deleterowfalse/deleterow>
                                <deleteallrowsfalse/deleteallrows>
                                <appendimportfalse/appendimport>
                                <updateimportfalse/updateimport>
                                <truncateimportfalse/truncateimport>
                                <deleteupdateaddimportfalse/deleteupdateaddimport>
                                <sharefalse/share>
                            </permission>
                        </perminfo>
                        <perminfo viewname="sss" sharedby="user@mydomain.com">
                            <permission>
                                <readtrue/read>
                                <exportfalse/export>
                                <vudfalse/vud>
                                <addrowfalse/addrow>
                                <updaterowfalse/updaterow>
                                <deleterowfalse/deleterow>
                                <deleteallrowsfalse/deleteallrows>
                                <appendimportfalse/appendimport>
                                <updateimportfalse/updateimport>
                                <truncateimportfalse/truncateimport>
                                <deleteupdateaddimportfalse/deleteupdateaddimport>
                                <sharefalse/share>
                            </permission>
                        </perminfo>
                        <perminfo viewname="Table1" sharedby="user@mydomain.com">
                            <permission>
                                <readtrue/read>
                                <exportfalse/export>
                                <vudfalse/vud>
                                <addrowfalse/addrow>
                                <updaterowfalse/updaterow>
                                <deleterowfalse/deleterow>
                                <deleteallrowsfalse/deleteallrows>
                                <appendimportfalse/appendimport>
                                <updateimportfalse/updateimport>
                                <truncateimportfalse/truncateimport>
                                <deleteupdateaddimportfalse/deleteupdateaddimport>
                                <sharefalse/share>
                            </permission>
                        </perminfo>
                    </permissions>
            </shareinfo>
            <shareinfo>
                <emailuser1@mydomain.com/email>
                    <permissions>
                        <perminfo viewname="finepick1" sharedby="user@mydomain.com">
                            <permission>
                                <readtrue/read>
                                <exportfalse/export>
                                <vudfalse/vud>
                                <addrowfalse/addrow>
                                <updaterowfalse/updaterow>
                                <deleterowfalse/deleterow>
                                <deleteallrowsfalse/deleteallrows>
                                <appendimportfalse/appendimport>
                                <updateimportfalse/updateimport>
                                <truncateimportfalse/truncateimport>
                                <deleteupdateaddimportfalse/deleteupdateaddimport>
                                <sharefalse/share>
                            </permission>
                        </perminfo>
                    </permissions>
            </shareinfo>
            <shareinfo>
                <emailuser115@mydomain.com/email>
                    <permissions>
                        <perminfo viewname="Table1" sharedby="user@mydomain.com">
                            <permission>
                                <readtrue/read>
                                <exporttrue/export>
                                <vudfalse/vud>
                                <addrowfalse/addrow>
                                <updaterowfalse/updaterow>
                                <deleterowfalse/deleterow>
                                <deleteallrowsfalse/deleteallrows>
                                <appendimportfalse/appendimport>
                                <updateimportfalse/updateimport>
                                <truncateimportfalse/truncateimport>
                                <deleteupdateaddimportfalse/deleteupdateaddimport>
                                <sharefalse/share>
                            </permission>
                        </perminfo>
                    </permissions>
            </shareinfo>
            <shareinfo>
                <emailuser11@mydomain.com/email>
                    <permissions>
                        <perminfo viewname="grp_pv1" sharedby="user@mydomain.com">
                            <permission>
                                <readtrue/read>
                                <exporttrue/export>
                                <vudfalse/vud>
                                <addrowfalse/addrow>
                                <updaterowfalse/updaterow>
                                <deleterowfalse/deleterow>
                                <deleteallrowsfalse/deleteallrows>
                                <appendimportfalse/appendimport>
                                <updateimportfalse/updateimport>
                                <truncateimportfalse/truncateimport>
                                <deleteupdateaddimportfalse/deleteupdateaddimport>
                                <sharefalse/share>
                            </permission>
                        </perminfo>
                    </permissions>
            </shareinfo>
            <shareinfo>
                <emailuser214@mydomain.com/email>
                    <permissions>
                        <perminfo viewname="finepick1" sharedby="user@mydomain.com">
                            <permission>
                                <readtrue/read>
                                <exportfalse/export>
                                <vudfalse/vud>
                                <addrowfalse/addrow>
                                <updaterowfalse/updaterow>
                                <deleterowfalse/deleterow>
                                <deleteallrowsfalse/deleteallrows>
                                <appendimportfalse/appendimport>
                                <updateimportfalse/updateimport>
                                <truncateimportfalse/truncateimport>
                                <deleteupdateaddimportfalse/deleteupdateaddimport>
                                <sharefalse/share>
                            </permission>
                        </perminfo>
                    </permissions>
            </shareinfo>
            <shareinfo>
                <emailuser104@mydomain.com/email>
                    <permissions>
                        <perminfo viewname="Table1" sharedby="user@mydomain.com">
                            <permission>
                                <readtrue/read>
                                <exporttrue/export>
                                <vudfalse/vud>
                                <addrowfalse/addrow>
                                <updaterowfalse/updaterow>
                                <deleterowfalse/deleterow>
                                <deleteallrowsfalse/deleteallrows>
                                <appendimportfalse/appendimport>
                                <updateimportfalse/updateimport>
                                <truncateimportfalse/truncateimport>
                                <deleteupdateaddimportfalse/deleteupdateaddimport>
                                <sharefalse/share>
                            </permission>
                        </perminfo>
                    </permissions>
            </shareinfo>
            <shareinfo>
                <emailuser10@mydomain.com/email>
                    <permissions>
                        <perminfo viewname="Table2" sharedby="user@mydomain.com">
                            <permission>
                                <readtrue/read>
                                <exportfalse/export>
                                <vudfalse/vud>
                                <addrowfalse/addrow>
                                <updaterowfalse/updaterow>
                                <deleterowfalse/deleterow>
                                <deleteallrowsfalse/deleteallrows>
                                <appendimportfalse/appendimport>
                                <updateimportfalse/updateimport>
                                <truncateimportfalse/truncateimport>
                                <deleteupdateaddimportfalse/deleteupdateaddimport>
                                <sharefalse/share>
                            </permission>
                        </perminfo>
                    </permissions>
            </shareinfo>
            <shareinfo>
                <emailuser101@mydomain.com/email>
                    <permissions>
                        <perminfo viewname="Table1" sharedby="user@mydomain.com">
                            <permission>
                                <readtrue/read>
                                <exportfalse/export>
                                <vudfalse/vud>
                                <addrowfalse/addrow>
                                <updaterowfalse/updaterow>
                                <deleterowfalse/deleterow>
                                <deleteallrowsfalse/deleteallrows>
                                <appendimportfalse/appendimport>
                                <updateimportfalse/updateimport>
                                <truncateimportfalse/truncateimport>
                                <deleteupdateaddimportfalse/deleteupdateaddimport>
                                <sharefalse/share>
                            </permission>
                        </perminfo>
                    </permissions>
            </shareinfo>
        </usershareinfo>
        <publicshareinfo>
        </publicshareinfo>
        <privatelinkshareinfo>
        </privatelinkshareinfo>
        <groupshareinfo>
            <groupmembers>
                <memberuser10@mydomain.com/member>
                <memberuser1@mydomain.com/member>
            </groupmembers>
        </groupshareinfo>
        <dbownershareinfo>
            <dbowners>
                <memberuser13@mydomain.com/member>
                <memberuser1@mydomain.com/member>
            </dbowners>
        </dbownershareinfo>
      </result>
    </response>
    
    
    

    Sample Response JSON Format:

    { 
       "response":{
          "uri":"\/api\/abc@zylker.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://<hostname>:<webclient port>/api/<zohoreportsemailaddress>/<Databasename>

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

    This section explains about the error response sent from the Zoho Reports server on failure of Sharing APIs. You can use this for appropriate error handling.

    Error Handling

    Sample error XML Format:

    
    <response uri="/api/abc@zylker.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@zylker.com\/Employee",
            "action": "GETVIEWURL",
            "error": 
            {
            "code":7103,
            "message": "Database not found! Please check whether the database exists"
            } 
        }
    }
    

    Error Codes

    Error Code Reason Solution
    7003 Required parameters are missing in the request. Send all the required parameters related tot hat particular action.
    7103 The database name specified in the API request 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 parameters 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. Provie 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 of any error other than the above said, mail the API request URL parameters and error response details to onprem-support@zohoreports.com . Zoho Reports will get back to you 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@zylker.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@zylker.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@zylker.com";
        String dbname = "EmployeeDB";
        String tbname = "EmployeeTB";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
        rc.setIamServerURL("https://<hostname>:<web client port>/iam");
        rc.setReportServerURL("https://<hostname>:<webclient port>");
    
        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@zylker.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@zylker.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://<hostname>:<webclient port>/api/abc@zylker.com/Employee/EmployeeDetails
    
    

    Sample Response XML Format:

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

    Sample Response JSON Format:

    {
        "response": 
        {
            "uri": "\/api\/abc@zylker.com\/Employee\/EmployeeDetails",
            "action": "GETVIEWURL",
            "result": 
            {
                "viewurl": "https://<hostname>:<webclient port>/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 the database name and the view name as input for the API.

    URL

    https://<hostname>:<webclient port>/api/<zohoreportsemailaddress>/<Databasename>/<Tablename>

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

    Error Codes in Embed API

    This section explains about the error response sent from the Zoho Reports server on failure of Sharing APIs. You can use this for appropriate error handling.

    Error Handling

    Sample error XML Format:

    
    <response uri="/api/abc@zylker.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@zylker.com\/Employee",
            "action": "GETVIEWURL",
            "error": 
            {
            "code":7103,
            "message": "Database not found! Please check whether the database exists"
            } 
        }
    }
    

    Error Codes

    Error Code Reason Solution
    7103 The database name specified in the API request URL does not exist. Please provide an existing database name to get the sharing details.
    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 the 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 onprem-support@zohoreports.com . Zoho Reports 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.

    Get Users

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

    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zylker.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@zylker.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@zylker.com";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
    
        private ReportClient rc = new ReportClient(authtoken);
        rc.setIamServerURL("https://<hostname>:<web client port>/iam");
        rc.setReportServerURL("https://<hostname>:<webclient port>");
    
        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@zylker.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@zylker.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://<hostname>:<webclient port>/api/abc@zylker.com
    
    

    Sample Response XML Format:

    <?xml version="1.0" encoding="UTF-8" ?>
    <response uri="/api/user@zylker.com" action="GETUSERS">
        <result>
            <user emailId="user+1@zylker.com" status="true" zuid="xxxxx3457" zaid="-1"> </user>
            <user emailId="user+2@zylker.com" status="true" zuid="631xxxxxx" zaid="-1"> </user>
            <user emailId="user@zylker.com" status="true" zuid="5xxxxx83" zaid="-1"> </user>
        </result>
    </response>
    
    

    Sample Response JSON Format:

    {
      "response": {
        "uri": "/api/user@zylker.com",
        "action": "GETUSERS",
        "result": [
          {
            "emailId": "user+1@zylker.com",
            "status": true,
            "zuid": 629xxxxx7,
            "zaid": -1
          },
          {
            "emailId": "user+2@zylker.com",
            "status": true,
            "zuid": 6318xxxxx,
            "zaid": -1
          },
          {
            "emailId": "user@zylker.com",
            "status": true,
            "zuid": 5xxxx9x3,
            "zaid": -1
          }
        ]
      }
    }
    
    

    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://<hostname>:<webclient port>/api/<zohoreportsemailaddress>

    URL GET 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.
    ZOHO_API_VERSION 1.0 The API version of Zoho Reports based on which the application(/service) has been written. This parameter allows Zoho Reports to handle applications based on the older versions.The current API version is 1.0.

    In case of any error other than the above said, mail the API request URL parameters and error response details to onprem-support@zohoreports.com . Zoho Reports will get back to you with the best possible solution.

    POSSIBLE ERROR CODES IN GETUSERS

    8504, 8506, 8516, 8533

    Add Users

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

    Sample Request:

    using ZReports;
    
    namespace Test
    {
        AUTHTOKEN = "f7d016b46be276cd4cfa32a592f40101";
        EMAIL = "user@zylker.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@zylker.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@zylker.com"
            authtoken = "f7d016b46be276cas21asd2a592f40101"
    )
    
    func adduser() {
            url := reportclient.GetUserUri(email)
            emailids := "user1@zylker.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@zylker.com";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        String emails = "abc@zylker.com";
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
        rc.setIamServerURL("https://<hostname>:<web client port>/iam");
        rc.setReportServerURL("https://<hostname>:<webclient port>");
    
        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@zylker.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@zylker.com"
        AUTHTOKEN="f7d016b46be276ca12fa32a592f40101"
        rc = None
        rc = ReportClient(self.AUTHTOKEN)
    
        def AddUser(self,rc):
            uri = rc.getUserURI(self.LOGINEMAILID)
            emailIds = "user@zylker.com"
            rc.addUser(self,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@zylker.com" 
             https://<hostname>:<webclient port>/api/abc@zylker.com
    
    

    Sample Response XML Format:

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

    Sample Response JSON Format:

    {
        "response": 
        {
            "uri": "\/api\/abc@zylker.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.

    URL

    https://<hostname>:<webclient port>/api/<zohoreportsemailaddress>

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

    POSSIBLE ERROR CODES IN ADD USER

    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@zylker.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@zylker.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@zylker.com"
            authtoken = "f7d016b46be276cas21asd2a592f40101"
    )
    
    func removeuser() {
            url := reportclient.GetUserUri(email)
            emailids := "user1@zylker.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@zylker.com";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        String emails = "abc@zylker.com";
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
        rc.setIamServerURL("https://<hostname>:<web client port>/iam");
        rc.setReportServerURL("https://<hostname>:<webclient port>");
    
        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@zylker.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@zylker.com"
        AUTHTOKEN="f7d016b46be276ca12fa32a592f40101"
        rc = None
        rc = ReportClient(self.AUTHTOKEN)
    
        def RemoveUser(self,rc):
            uri = rc.getUserURI(self.LOGINEMAILID)
            emailIds = "user@zylker.com"
            rc.removeUser(self,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@zylker.com" 
             https://<hostname>:<webclient port>/api/abc@zylker.com
    
    

    Sample Response XML Format:

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

    Sample Response JSON Format:

    {
        "response": 
        {
            "uri": "\/api\/abc@zylker.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://<hostname>:<webclient port>/api/<zohoreportsemailaddress>

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

    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@zylker.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@zylker.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@zylker.com"
            authtoken = "f7d016b46be276cas21asd2a592f40101"
    )
    
    func activateuser() {
            url := reportclient.GetUserUri(email)
            emailids := "user1@zylker.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@zylker.com";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        String emails = "abc@zylker.com";
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
        rc.setIamServerURL("https://<hostname>:<web client port>/iam");
        rc.setReportServerURL("https://<hostname>:<webclient port>");
    
        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@zylker.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@zylker.com"
        AUTHTOKEN="f7d016b46be276ca12fa32a592f40101"
        rc = None
        rc = ReportClient(self.AUTHTOKEN)
    
        def ActivateUser(self,rc):
            uri = rc.getUserURI(self.LOGINEMAILID)
            emailIds = "user@zylker.com"
            rc.activateUser(self,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@zylker.com" 
             https://<hostname>:<webclient port>/api/abc@zylker.com
    
    

    Sample Response XML Format:

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

    Sample Response JSON Format:

    {
        "response": 
        {
            "uri": "\/api\/abc@zylker.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://<hostname>:<webclient port>/api/<zohoreportsemailaddress>

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

    POSSIBLE ERROR CODES IN ACTIVATE USER

    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@zylker.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@zylker.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@zylker.com"
            authtoken = "f7d016b46be276cas21asd2a592f40101"
    )
    
    func deactivateuser() {
            url := reportclient.GetUserUri(email)
            emailids := "user1@zylker.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@zylker.com";
        String authtoken = "f7d016b46be276c22eea32a592f40101";
        String emails = "abc@zylker.com";
        Map config = new HashMap();
    
        private ReportClient rc = new ReportClient(authtoken);
        rc.setIamServerURL("https://<hostname>:<web client port>/iam");
        rc.setReportServerURL("https://<hostname>:<webclient port>");
    
        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@zylker.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@zylker.com"
        AUTHTOKEN="f7d016b46be276ca12fa32a592f40101"
        rc = None
        rc = ReportClient(self.AUTHTOKEN)
    
        def DeActivateUser(self,rc):
            uri = rc.getUserURI(self.LOGINEMAILID)
            emailIds = "user@zylker.com"
            rc.deActivateUser(self,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@zylker.com" 
             https://<hostname>:<webclient port>/api/abc@zylker.com
    
    

    Sample Response XML Format:

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

    Sample Response JSON Format:

    {
        "response": 
        {
            "uri": "\/api\/abc@zylker.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://<hostname>:<webclient port>/api/<zohoreportsemailaddress>

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

    POSSIBLE ERROR CODES IN DEACTIVATE USER

    8504, 8506, 8509, 8516, 8533

    Error Codes in UserManagement API

    Sample error message:

    
    The sample response sent from the server if the  error is occured.
    
    

    XML Format:

    <response uri="/api/abc@zylker.com" action="ADDUSER">
        <error>
            <code>6021</code>
            <message>
                Sorry, you cannot activate additional user(s). Your plan limit allows you to 
                have only 2 shared users.Kindly ;Upgrade your plan to activate more users.
            </message>
        </error>
    </response>
    
    
    

    JSON Format:

    {
        "response": 
        {
            "uri": "\/api\/abc@zylker.com",
            "action": "ADDUSER",
            "error": 
            {
                "code":6021,
                "message": "Sorry, you cannot activate additional user(s). 
                             Your plan limit allows you to have
                only 2 shared users.Kindly ;Upgrade your plan to activate more users."
            } 
        }
    }
    

    This section explains about the possible error responses that could be returned by Zoho Reports on failure of the Manage User API calls discussed above. The sample error response is below.

    Error Codes:

    Error Code Reason Solution
    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 onprem-support@zohoreports.com . We will get back to you shortly with the best possible solution.

    Client Libraries

    Client libraries are programming language wrappers over the raw HTTP APIs. This enables developers to easily use Zoho Reports API in the corresponding programming language. Currently we support the following programming language libraries:

    Java Library

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

    Javadocs

    Click here for javadocs.

    Download Java Client Library

    Download the Java client library from this link.

    Python Library

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

    Pythondocs

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

    Download Python Client Library

    Download the Python client library from this link.

    PHP Library

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

    phpdocs

    Click here for phpdocs.

    Download php Client Library

    Download the php client library from this link.

    GO Library

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

    godocs

    Click here for godocs.

    Download go Client Library

    Download the go client library from this link.

    C# Library

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

    Prerequisites:

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

    C#-docs

    Click here for csharpdocs.

    Download C# Client Library:

    Download the C# client library (dll) from this link.

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

    Methods Summary:

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

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

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