ZC - View Record

Tags:  

View Record - GET Method

 

Zoho Creator REST style Web API allows client applications to view records from a Zoho Creator form, using the HTTP GET method. The records that satisfy the given criteria will be displayed. You can specify multiple criteria using "AND"/ "OR" operator. In return the user gets a formatted XML/CSV/JSON response from the called method.

View Based on View Name


The rest apis for view based on view name enables you to display all the records in a view.

1. Request URL to get XML response



http://creator.zoho.com/api/xml/
<applicationName>/view/<view_name>/apikey=<API Key>&ticket=<Ticket>



Sample Request



http://creator.zoho.com/api/xml/
recruitment/view/Employee_View/apikey=81d0d3fb0f81892ff681fb4e5c4efd2f&ticket=xxxxx



Sample XML Response




<?xml version="1.0" encoding="UTF-8" ?>
<
response>
<records>
 <record>
 <column name="Name">James</column>
 <column name="DOB">07-Sep-2007</column>
 <column name="Address">Australia</column>
 <column name="EmailId">james@gmail.com</column>
 <column name="Hobbies">Gardening</column>
 <columnname="Basic"/>25000</column>
 <column name="HRA_Eligibility">false</column>
 <column name="ID">4000000003007</column>
</record>
+ <record>
 <column name="Name">Henry</column>
 <column name="DOB">26-Sep-2007</column>
 <column name="Address">USA</column>
 <column name="EmailId">latha@adventnet.com</column>
 <column name="Hobbies">Writing</column>
 <column name="Basic">25000</column>
 <column name="HRA_Eligibility">true</column>
 <column name="ID">4000000003003</column>
 </record>
+ <record>
 <column name="Name">Vishal</column>
 <column name="DOB">05-Sep-2007</column>
 <column name="Address">UK</column>
 <column name="EmailId">latha@adventnet.com</column>
 <column name="Hobbies">Reading</column>
 <column name="Basic">25000</column>
 <column name="HRA_Eligibility">true</column>
 <column name="ID">4000000002208</column>
 </record>
 </records>
 </response>



2. Request URL to get CSV response


http://creator.zoho.com/api/csv/<applicationName>/view/<view_name>/apikey=<API Key>&ticket=<Ticket>



Sample Request

http://creator.zoho.com/api/csv/recruitment/view/Employee_View/apikey=81d0d3fb0f81892ff681fb4e5c4efd2f



Sample CSV Response



Name,DOB,Address,EmailId,Hobbies,Basic,HRA Eligibility,IDJames,07-Sep-2007,Australia,james@adventnet.com,Gardening,,false,4000000003007 Henry,26-Sep-2007,USA,henry@adventnet.com,Writing,25000,true,4000000003003 Vishal,05-Sep-2007,UK,vishal@adventnet.com,Reading,25000,true,4000000002208


3. Request URL to get JSON response

http://creator.zoho.com/api/json/<applicationName>/view/<view_name>/raw=true&apikey=<API Key>&ticket=<Ticket>



Sample Request


http://creator.zoho.com/api/json/recruitment/view/Employee_View/raw=true&apikey=81d0d3fb0f81892ff681fb4e5c4efd2f&ticket=xxxxxxxxxx



Sample Response



{
    "Department":
	[
{
"Department Name":"Payroll","Department Code":"PR"
},
{
"Department Name":"Accounts","Department Code":"AC"
},
]
};



View Based on Form Name

The rest apis for view based on form name enables you to display records in a form based on criteria, start index and limit.

Request URL to view record with criteria and startindex

 


http://creator.zoho.com/api/xml/<applicationName>/<formName>/
view/matchall/<criteriaString>/
apikey=<API Key>&ticket=<Ticket>&limit=3&startindex=1


Sample Request
 

http://creator.zoho.com/api/xml/recruitment/Employee/view/matchall/Basic>10000
/apikey=
81d0d3fb0f81892ff681fb4e5c4efd2f&ticket=xxxxxxxxxxxxxxx&limit=3&startindex=1



Note:

1. In the above request the limit and startindex enables you to limit the number of records to be displayed in the view. If startindex and limit is not specified, the default values will be set as startindex = 1 and limit =1000

2. To create a criteria with AND operator use matchall

3. To create a critieria with OR operator, use matchany 

Sample Response

<?xml version="1.0" encoding="UTF-8" ?>
-<response>

- <form name="Employee">
- <criteria>
 <fieldname="Basic" compOperator="GreaterThan" value="10000" />
</criteria>
- <records>
- <record>
 <column name="ID">4000000002208</column>
 <column name="Name">Vishal</column>
 <column name="DOB">05-Sep-2007</column>
 <column name="Address">UK</column>
 <column name="EmailId">vishal@gmail.com</column>
 <column name="Hobbies">Reading</column>
 <column name="Basic">25000</column>
 <column name="HRA Eligibility">true</column>
</record>
+ <record>
+ <record>
 <column name="ID">4000000004009</column>
 <column name="Name">Dave</column>
 <column name="DOB">24-May-1980</column>
 <column name="Address">New York, USA</column>
 <column name="EmailId">latha@adventnet.com</column>
 <column name="Hobbies">Reading,Writing</column>
 <column name="Basic">20000</column>
 <column name="HRA Eligibility">true</column>
 </record>
 <column name="ID">4000000003003</column>
 <column name="Name">Henry</column>
 <column name="DOB">26-Sep-2007</column>
 <column name="Address">USA</column>
 <column name="EmailId">latha@adventnet.com</column>
 <column name="Hobbies">Writing</column>
 <column name="Basic">25000</column>
 <column name="HRA Eligibility">true</column>
 </record>
</records>
 <status>Success</status>
</form>
</response>


Note:

1. To view records in a public application or a shared application, the application owner name must be specified in the request url as given below:

http://creator.zoho.com/api/xml/<applicationName>/view/<view_name>/apikey=<API Key>&ticket=<Ticket>&<zc_ownername>=<applicationOwnerName>

2. If you are not logged in to your account, you have to get the ticket and send in the request.

 


 RSS of this page