Update Record - REST API - POST Method
Zoho
Creator REST style Web API allows client applications
to update
records from a Zoho Creator form,using the HTTP POST method. The records that
satisfy the given criteria will be updated. You can specify multiple criteria
using "AND"/ "OR" operator. In return the
user gets a formatted XML/CSV/JSON
response from the called method.
Who
can update a record ?
The application owner with valid api key and shared users with valid api key and share permission to update the view.
Updating a record by application owner
Updating a record by shared user
Updating a Record by Application Owner
Request URL
XML : htpp://creator.zoho.com/api/xml/<applicationName>/<formName>/update/
CSV : htpp://creator.zoho.com/api/csv/<applicationName>/<formName>/update/
JSON : htpp://creator.zoho.com/api/json/<applicationName>/<formName>/update/
Request Parameters
The request parameters comprises of criteria, reloperator,
set column name and new value.
Field
|
Description
|
criteria
|
[string] - The criteria must be specified
in the format "<criteria column
name> <operator> <value>"
where,
<Criteria Column
Name >: The column name used to specify the update criteria. <operator>:The operator used in the criteria. The following operators are
supported
<value> : The criteria column value |
reloperator
|
[string] - To AND/OR operator to specify more than
one criteria |
setcolumn name
|
[string] - The
column name to be updated |
new value
|
[string] - the new value to be
updated for this column.
|
Sample Form (POST Method Format)
<form method="POST" action="http://creator.zoho.com/api/xml/<application name>/<form
name>/update/apikey=[APIKEY]&ticket=[Ticket]">
<input type="text" name="Criteria" value="Criteria String in the format specified above">
<input type="text" name="reloperator" value="reloperator AND/OR">
<input type="text" name="<Set column name>" value="new value">
<input type="submit" value="Update Record">
</form>
Note:
- Only Deluge Script
names must be specified for form names, field names and application name. Refer
http://creator.zoho.com/api/referenceto view the list of applications
created, the form names and field names used in each application and the deluge
names.
- Multiple criteria must be seperated
by a comma.
- The following operators
are supported for date fields:equals, not equal to, before, after
- You can update only one record at a time.
Sample Request
1. Sample request to update a record in a single form. The
following sample updates record(s) that satisfies the given criteria, in the form named "Employee"
in the application named "sample" .
<name="criteria" id="criteria" value="Name=Vishal">
<name="Basic"
value=10000>
Sample XML Response
<?xml version="1.0"
encoding="UTF-8" ?>
<response>
<result>
<form
name="Employee">
<update>
<criteria>
<fieldname="Name" compOperator="Equals" value="Vishal" />
</criteria>
<newvalues>
</update>
</form>
</result>
Sample CSV Response
Form Name, Operation
Employee,update
Status,Criteria
Success,[Name Equals Vishal SET
Basic = 10000 ]
Sample JSON Response
{
"formname":
[
"Employee",
{
"operation":
[
"update",
{
"Criteria":
[
"Name Equals
Vishal"
]
},
{
"newvalues":
[
{
"Basic":"10000"
}
]
},
{
"status":
[
"Success"
]
}
]
}
]
}
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 updated in the database, the response message will be displayed with
status as "Success".
Updating a Record by Shared User
Field
|
Description
|
criteria
|
[string] - The criteria must be specified
in the format "<criteria column
name> <operator> <value>"
where,
<Criteria Column
Name >: The column name used to specify the update criteria. <operator>:The operator used in the criteria. The following operators are
supported
<value> : The criteria column value |
reloperator
|
[string] - To AND/OR operator to specify more than
one criteria |
setcolumn name
|
[string] - The
column name to be updated |
new value
|
[string] - the new value to be
updated for this column.
|
Sample Form (POST Method Format)
<form method="POST" action="http://creator.zoho.com/api/xml/<application name>/view/<viewName>/update/apikey=[APIKEY]&ticket=[Ticket]">
<input type="text" name="Criteria" value="Criteria String in the format specified above">
<input type="text" name="reloperator" value="reloperator AND/OR">
<input type="text" name="<Set column name>" value="new value">
<input type="text"
name="zc_ownername"
value="Application Owner
Name">
<input type="submit" value="Update Record">
</form>
Note:
- Only Deluge Script
names must be specified for form names, field names and application name. Refer
http://creator.zoho.com/api/referenceto view the list of applications
created, the form names and field names used in each application and the deluge
names.
- Multiple criteria must be separated
by a comma.
- The following operators
are supported for date fields:equals, not equal to, before, after
- You can update only one record at a time.