Add Column

Tags:  

Add Column



Introduction

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. 

Getting Started

It is recommended to go through the Zoho Reports API Prerequisites before using Add Column API.

Request

The following is the sample request URL to add a column.
https://reportsapi.zoho.com/api/abc@zoho.com/SalesDB/Sales?ZOHO_ACTION=ADDCOLUMN
&ZOHO_COLUMNNAME=Region&ZOHO_DATATYPE=PLAIN
&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML
&authtoken=g38sl4j4856guvncrywox8251sssds&ZOHO_API_VERSION=1.0

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

Query String Parameters

The following table shows the list of Query String parameters that has to be passed along with the request URL.

This parameters should be in the same case as given in this document.

Parameter Name Description
ZOHO_ACTION This parameter value should be ADDCOLUMN.   (Upper Case)

 
ZOHO_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 The datatype of the column to be added into Zoho Reports Table. Supported data types are:
  • PLAIN
  • MULTI_LINE
  • EMAIL
  • NUMBER
  • POSITIVE_NUMBER
  • DECIMAL_NUMBER
  • CURRENCY
  • PERCENT
  • DATE
  • BOOLEAN
  • URL
  • AUTO_NUMBER
 
authtoken
The authtoken parameter should hold the Auth Token of the Database Owner Account.

Response

The following sample response will be sent from the server after successfully adding a column.

XML Format:

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

JSON Format:

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

Error Handling


The following is a sample error response format in case of failure of Add Column API.

XML Format:

<response uri="/api/your_account@zoho.com/SalesDB/Sales" action="ADDCOLUMN">
<error>
<code>7128</code>
<message>
The following column names are duplicated in this table [Region]
</message>
</error>
</response>

JSON Format:

{
"response":{
"uri":"\/api\/your_account@zoho.com\/SalesDB\/Sales",
"action":"ADDCOLUMN",
"error":{
"code":7128,
"message":"The following column names are duplicated in this table [Region]"
}
}
}


Error Codes:

The following table shows the list of error codes sent from server on failure of Add Column API Request, along with the reason and the solution for the same.

Error Code Reason Solution
7128 The column is already exists in the specified Zoho Reports Table
Provide a different name for the ZOHO_COLUMNNAME parameter
7161 The Zoho Reports Table specified in this API is a system table (created for Service Integration)
Adding columns into System Table is not allowed. You could only add columns in a non-system table using this API.

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


    Post a comment

    Your Name or E-mail ID (mandatory)

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




     RSS of this page