API Response Formats
REST
The REST resposne is really simple. It's just a very simple XML output.
This is the default resposne method. You may specify that the format is rest, but you don't need to.
An method call returns this:
<?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." You can specify that by sending a parameter called jsoncallback. If you don't want any callback function, i.e., only the data, send a parameter called nojsoncallback. nojsoncallback should be true or 1, etc.
Here's an example response to vimeo.auth.checkToken
jsonVimeoApi(
{
{"stat":"ok",
"generated_in":"0.0020",
"auth": {
"token":"33f056f66b19d8fd20443cbd6b95d6a1",
"perms":"write",
"user": {
"nsid":"151542",
"id":"151542",
"username":"ted",
"fullname":"Ted!"
}
}
}
}
);
- Vimeo: About / Blog / Developers / Forums / Help! / Site Map
- Legal: © 2008 Connected Ventures, LLC. All rights reserved. / Terms & Conditions / Privacy Statement


