Creator - Add Record

Tags:  


Add Record - REST API - POST Method

 
Zoho Creator REST style Web API allows client applications to add record to a Zoho Creator form, using the HTTP POST method. You can add only one record at a time to a form. In return the user gets a formatted XML/CSV/JSON response from the called method.  

Who can add a record ?
  • Public Form: Anyone with a valid apikey can add a record to the Form.
  • Private Form:Only the owner of the application with a valid apikey can add a record to the Form.
  • Shared Form: Any user with a valid apikey and share permission can add a record to the Form.

Request URL

The request url to add a record in xml format is given below:

XML : htpp://creator.zoho.com/api/xml/<applicationName>/<formName>/add/
CSV : htpp://creator.zoho.com/api/csv/
<applicationName>/<formName>/add/
JSON : htpp://creator.zoho.com/api/json/
<applicationName>/<formName>/add/


Request Parameters

The request parameters comprises of input type, column name as specified in deluge script and column values.


Field
Description
Column Name
[string] - The name of the column in the form.
Column Value
[string] - The value to be specified for this column.


Sample Form ( POST Method Format )

<form method="POST" action="http://creator.zoho.com/api/xml/<application name>/<form name>/add/apikey=[APIKEY] &ticket=[Ticket]">

<input type="text" name=" Column Name " value=" Column Value ">
<input type="text" name=" Column Name " value=" Column Value ">

<input type="submit" value="Submit XML String">

</form>



Note:


To add records to a shared application or a public application, the zc_ownername must be specified as input to the POST method, in the following format

 


<input type="text" name="zc_ownername" value="Application Owner Name">



Note:

  1. You can add only one record at a time to a specific form.
  2. Multiple picklist values must be seperated by a comma.
  3. Refer http://creator.zoho.com/api/reference to view the list of applications created, the form names and field names used in each application and the deluge field names.

Sample Request


1. Sample request to add a record in a single form. The following sample adds a single record to the form named "Department" in the application named "sample".


<input type="text" name=" Name " value=" Gary ">
<input type="text" name=" DOB " value=" 12-Jun-1980 ">
<input type="text" name=" Address " value=" USA ">
<input type="text" name=" Basic " value=" 10000 ">
<input type="text" name=" Hobbies " value=" Reading,Writing ">




Sample Response

XML Format

 


<?xml version="1.0" encoding="UTF-8" ?>
-<response>
-<result>
-<form name="Employee">
-<add>
-<values>
-<field name="Name">
 <value>Gary</value>
 </field>
-<field name="DOB">
 <value>12-Jun-1980</value>
 </field>
-<field name="Basic">
 <value>10000</value>
 </field>
-<field name="Address">
 <value>USA</value>
 </field>
-<field name="Hobbies">
-<options>
 <option>Reading</option>
 <option>Writing</option>
 </options>
 </field>
 </values>
 <status>Success</status>
 </add>
 </form>
 </result>
 </response>



Equivalent JSON format


{
"formname":
[
"Employee_Details",
{"operation":
[
"add",
{
"values":
[
{
"Address":"USA",
"Basic":"10000",
"Name":"Gary",
"DOB":"12-Jun-1980"
},
{
"Hobbies":["Reading","Writing"]
},
{
"status":
[
"Success"
]
}
]
}
]
}
]
}



Equivalent CSV Format

 

Form Name, Operation

Employee_Details,add

Status,Values


Success,[Name = Gary , DOB = 12-Jun-1980 , Basic = 10000 , Address = USAHobbies = "Reading,Writing"]



If there is an error in the request format, the corresponding error code with the error message will be displayed. Please refer the topic, Error codes and description , to learn about the list of error code displayed.

If the record is added to the database, the response message will be displayed with status as "Success".


 


 RSS of this page