National Library of New Zealand
Harvested by the National Library of New Zealand on: Aug 24 2011 at 11:16:37 GMT
Search boxes and external links may not function. Having trouble viewing this page? Click here
Close Minimize Help
Wayback Machine

We offer four response types in our Advanced API: XML, PHP, JSON, and JSONP. (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 generated_in="0.0438" stat="ok">
  <person id="101193" is_plus="1" is_staff="1">
    <username>brad</username>
    <display_name>Brad Dougherty</display_name>
    <location>Rochester, NY</location>
    <url>http://brad.dougherty.name</url>
    <number_of_contacts>60</number_of_contacts>
    <number_of_uploads>6</number_of_uploads>
    <number_of_likes>216</number_of_likes>
    <number_of_videos>14</number_of_videos>
    <number_of_videos_appears_in>8</number_of_videos_appears_in>
    <profileurl>http://www.vimeo.com/brad/</profileurl>
    <videosurl>http://www.vimeo.com/brad/videos/</videosurl>
  </person>
</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.

To get an API response in PHP format, send a parameter format in the request with a value of php.

stdClass Object
(
    [generated_in] => 0.0717
    [stat] => ok
    [person] => stdClass Object
        (
            [id] => 101193
            [is_plus] => 1
            [is_staff] => 1
            [username] => brad
            [display_name] => Brad Dougherty
            [location] => Rochester, NY
            [url] => http://brad.dougherty.name
            [number_of_contacts] => 60
            [number_of_uploads] => 4
            [number_of_likes] => 215
            [number_of_videos] => 12
            [number_of_videos_appears_in] => 8
            [profileurl] => http://www.vimeo.com/brad/
            [videosurl] => http://www.vimeo.com/brad/videos/
        )

)

In the event of an error, you'll get something like this:

stdClass Object
(
    [generated_in] => 0.0717
    [stat] => fail
    [err] => stdClass Object
        (
            [code] => 1
            [msg] => User Not Found
        )

)

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.

{
    "generated_in": "0.0283",
    "stat": "ok",
    "person": {
        "id": "101193",
        "is_plus": "1",
        "is_staff": "1",
        "username": "brad",
        "display_name": "Brad Dougherty",
        "location": "Rochester, NY",
        "url": "http:\/\/brad.dougherty.name",
        "number_of_contacts": "60",
        "number_of_uploads": "6",
        "number_of_likes": "216",
        "number_of_videos": "14",
        "number_of_videos_appears_in": "8",
        "profileurl": "http:\/\/www.vimeo.com\/brad\/",
        "videosurl": "http:\/\/www.vimeo.com\/brad\/videos\/"
    }
}

In the event of an error, you'll get something like this:

{
    "generated_in": "0.0283",
    "stat": "fail",
    "err": {
        "code": "1",
        "msg": "User Not Found"
    }
}

JSONP

JSONP is the same as the JSON response, but it's wrapped in a callback function.

To get an API response in JSONP format, send a parameter format in the request with a value of jsonp, and a callback parameter set to the name of the function you want to call. If no callback is set, it will default to vimeoCallback.

vimeoCallback({
    "generated_in": "0.0283",
    "stat": "ok",
    "person": {
        "id": "101193",
        "is_plus": "1",
        "is_staff": "1",
        "username": "brad",
        "display_name": "Brad Dougherty",
        "location": "Rochester, NY",
        "url": "http:\/\/brad.dougherty.name",
        "number_of_contacts": "60",
        "number_of_uploads": "6",
        "number_of_likes": "216",
        "number_of_videos": "14",
        "number_of_videos_appears_in": "8",
        "profileurl": "http:\/\/www.vimeo.com\/brad\/",
        "videosurl": "http:\/\/www.vimeo.com\/brad\/videos\/"
    }
})

In the event of an error, you'll get something like this:

vimeoCallback({
    "generated_in": "0.0283",
    "stat": "fail",
    "err": {
        "code": "1",
        "msg": "User Not Found"
    }
})