Blogs   Forums   Creator Home Toll Free : 888 900 9646

API Home >> Creator API  >> REST API >> REST API Methods >> Update Record - POST Method

 


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 ?

Only the owner of the application with valid APIKey can update a record in ZohoCreator.


Request URL

XML : htpp://creator.zoho.com/api/xml/
<applicationName>/<formName>/update/
CSV : htpp://creator.zoho.com/api/csv/
<applicationName>/<formName>/update/
JSONhtpp://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="AND/OR">
<input type="text"  name="<Set column name>"  value="new value">

<input type="submit"  value="Update Record">

</form>




Note:

  1. 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.
  2. Multiple criteria must be seperated by a comma.
  3. The following operators are supported for date fields:equals, not equal to, before, after
  4. 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>
<name="reloperator"  value="AND">




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>
                                 <field name="Basic">
                                 <value>10000</value>
 </field>
 </newvalues>
 <status>Success</status>
 </update>
         </form>
 </result>
 </response>



CSV Response

 


Form Name, Operation
Employee,update
Status,Criteria
Success,[Name Equals Vishal SET Basic = 10000 ]



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".