Home / Zoho - Reports - API - Home / Data API / Adding Single Row

Adding Single Row

Tags:  

Adding a Single Row




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

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

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

Sample Request

A sample request for adding a row to the "EmployeeDetails" table inside the database "EmployeeDB"

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

Data Sent as POST parameters (URL Encoded)
&Name=Gary&Date Of Birth=12-Jun-1980&Country=USA&Salary=10000



Specifying the action

In the query string of the URL, the ZOHO_ACTION parameter should be ADDROW. For other mandatory query string parameters such as ZOHO_OUTPUT_FORMAT, refer this link.

Note: Value of ZOHO_ACTION parameter should be in the same case(UPPER CASE) as given in this document.

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

Sample Success Response

The following code snippets provides the response in JSON and XML formats for the sample refered above.

JSON Format

{
"response":
{
"url": "/api/abc@zoho.com/EmployeeDB/EmployeeDetails",
"action": "ADDROW",
"result":
{
"column_order":["Name","Date Of Birth","Salary","Country"],
"rows":[
//All the columns in the row , including formula columns
["Gary","12-Jun-1980",10000,"USA"]
}
}
}

XML Format

<?xml version="1.0" encoding="UTF-8" ?>
<response url ="/api/abc@zoho.com/EmployeeDB/EmployeeDetails"action="ADDROW">
<result>
<!-- All the columns in the row , including formula columns -->
<row>
<column
name="Name">Gary</column>
<column name="Date Of Birth">12-Jun-1980</column>
<column name="Basic">10000</column>
<column name="Country">USA</column>
</row>
</result>
<response>

    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