Add Record - CSV Format
Zoho Creator
CSV - RPC Web API allows client applications to
add record to a Zoho Creator form, using the HTTP
POST
method.
You can add multiple records at a time to a form. In return the user gets a formatted
XML
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, delete or update a record in csv format is
given below:
http://creator.zoho.com/api/csv/write/apikey=[APIKEY]&ticket=[Ticket]
Request Parameters
The
request parameters comprises of comma separated values to be
specified in the following format:
<application Name>,<formName>,<operationType>
<Comma seperated fieldLabelNames>
<Comma seperated fieldValues>
where,
<applicationName>
:
Name of the application to which the record must be added.
<formName>
:
Name of the form to which the record must be added.
<operationType>
:
The operation type to add a record is "Add".
<Field label names>
:
The deluge field names defined for the form, seperated by a comma.
<Field Values>:
T
he values for each field, seperated by a comma.
Note:
1.
Only Deluge Script names must be specified for form names, field names and application name. 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 names.
2. The Operation Type to add a new record is
"Add"
3. Multiple records can be added at a time.
4. Field values with special characters must be specified within double quotes.
5. Multiple list values must be specified within double quotes with
each value seperated by a comma.
6. Each line must end with a line seperator.
Sample Form
(
POST Method Format
)
<form method="POST" action="http://creator.zoho.com/api/csv/write/apikey=[APIKEY]&ticket=[Ticket]">
<input type="hidden" name="CSVString" value="CSV String in the format as specified in the Sample Request">
<input type="submit" value="Sumit CSV 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="hidden" name="zc_ownername" value="name of the Application Owner">
Sample Request
1. Sample request to add a single record
In this sample,
-
Field "Hobbies" is of type multi-select. Hence, the values for this
field is specified within double-quotes, with each list value seperated
by a comma.
- Field "Address" is of type multi-line text.
Hence, the values for this field is specified within double-quotes.
Sample, Employee_Form, Add
Name, Address, E_mail, Joining_Date, Hobbies, Qualification, Basic,
DepartmentDavid, "1st Cross Street, Australia", david@gmail.com,16-Aug-2006,
"Reading,Writing", B.E, 10000, HR
2. Sample request to add multiple records
Sample,Employee_Form,Add
Name, Address, E_mail, Joining_Date, Hobbies, Qualification, Basic,
Department
John, "10, Downing street", john@gmail.com,16-Aug-2006,
"Reading,Writing" 10000, Accounts
Henry, "25,Green Park, New York", henry@gmail.com,16-Aug-2006, "Reading,Singing"
20000, Payroll
Maria,
"5, Liver Pool, UK", maria@gmail.com,16-Aug-2006, "Reading,Writing"
15000, Operations
Response Format
The response parameters comprises of comma seperated values in the format given below:
Form Name,
Operation
<Form Name>,
Add
Status, Values
<Success/Failure><Comma seperated field values in
the format FieldName=Value>
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".
Sample Response
The
following is the sample response for the above method:
Form Name,
Operation
Employee_Form,add
Status,Values
Success,[ Name=David, Qualification=B.E,
Joining_Date=16-Aug-2006, Basic=10000, E_mail=david@gmail.com,
Department=HR, Address=1st Cross Street, Australia Hobbies = Reading,Writing ]