Developers / Advanced API / Response Formats
We offer three response types in our Advanced API: XML
, PHP
, and JSON
. (We offer these same formats for the Simple API as well, but you'll want to look at the Simple API Documentation for that.
XML (REST)
The REST response is really simple. It's just a very simple XML output. This is the default response method, so you don't need to specify the format parameter.
<?xml version="1.0" encoding="utf-8"?> <rsp stat="ok"> (xml stuff here) </rsp>
In the event of an error, you'll get something like this:
<?xml version="1.0" encoding="utf-8"?> <rsp stat="fail" generated_in="0.00032"> <err code="1" msg="User Not Found" /> </rsp>
PHP
The PHP result is a serialized version of the REST format. So the responses will be the same as above, only as PHP objects. If you're using the PHP response, we encourage you to look at the example code we provide. example-php.zip (8.0 K)
JSON
JSON (JavaScript Object Notation) is a lightweight computer data interchange format. It is a text-based, human-readable format for representing objects and other data structures and is mainly used to transmit such structured data over a network connection (in a process called serialization). (Wikipedia)
To get an API response in JSON format, send a parameter format
in the request with a value of json
. As you can see below, by default it will try and call a function called jsonVimeoApi
.
If you want to call a different function, just pass the function name to the API using the jsoncallback
parameter. If you don't want any callback function, just send a parameter called nojsoncallback
with a value of true
or 1
.
jsonVimeoApi({ { "stat": "ok", "generated_in": "0.0020", "auth": { "token": "33f056f66b19d8fd20443cbd6b95d6a1", "perms": "write", "user": { "nsid": "151542", "id": "151542", "username": "ted", "fullname": "Ted!" } } } });
- Vimeo: About / Blog / Roadmap / Developers / Community Guidelines / Forums / Toys / Help! / Site Map / Get Vimeo Plus
- Legal: ©2009 Vimeo, LLC / Terms & Conditions / Privacy Statement