API > Response Formats

Response Formats

The default is XML, however you may specify the response format of XML, JSON, or PHP, through either the file extension or the format parameter:

https://.vendo.co.nz/api/products.json?api_key={YOUR_API_KEY}
is the same as
https://.vendo.co.nz/api/products?api_key={YOUR_API_KEY}&format=JSON

Example:

https://.vendo.co.nz/api/product?api_key={YOUR_API_KEY}&format=JSON&product_id=1&fields=name,price,sale_price,product_id

The JSON response will be:

{"0":"Womens Shoes","name":"Womens Shoes","1":"129.95","price":"129.95","2":"0","sale_price":"0","3":"1","product_id":"1"}

The PHP response would be:

a:1:{i:0;a:8:{i:0;s:12:"Womens Shoes";s:4:"name";s:12:"Womens Shoes";i:1;s:6:"129.95";s:5:"price";s:6:"129.95";i:2;s:1:"0"; s:10:"sale_price";s:1:"0";i:3;s:1:"1";s:10:"product_id";s:1:"1";}}

The default XML response would be:

<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="ok">
<products>
	<product>
		<name>Womens Shoes</name>
		<price>129.95</price>
		<sale_price>0</sale_price>
		<product_id>1</product_id>
	</product>
</products>
</rsp>