RATS example - get output list

From Rambla Wiki
Jump to: navigation, search

Request

To retrieve a list of resource instances, send an HTTP GET request to the resource URI. For example, when retrieving a list of output profiles from RATS, send a GET request to http://rats.enc01.rambla.be/output/. Additionally, query-string arguments may be passed to filter the instances that will be returned. In this case, the request only retrieves the output profiles that were created by user "monty" himself (= not the default output profiles).

> GET /output/?owner=self HTTP/1.1
> Host: rats.enc01.rambla.be
> Authorization: Basic ZGFmZnk6c2VjZXJldA==
> Accept: application/json

Response

The response body contains a 'feed' which is the container for a number of 'entry' elements, each containing a single output profile. In this example, the feed only contains a single entry. Each entry object has an 'id' property, containing the URI at which the output profile can be accessed.

The profile content is contained inside a 'params' object (= part of a 'content' object). It includes the 'id' property, of which the value may be passed to a transcoding format or transcoding job to indicate that this output profile should be used.

< HTTP/1.1 200 OK
< Date: Thu, 28 Aug 2012 10:41:11 GMT
< Content-Type: application/json

{
  "feed": {
    "entry": [{
      "content": {
        "params": {
          "id": "192",
          "name": "ftp example.com",
          "description": "ftp to private server",
          "method": "ftp",
          "base_uri": "ftp://ftp.example.com/monty/",
          "cdn": "not applicable",
          "public_uri": "",
          "max_size": "",
          "auth_user": "monty",
          "auth_pwd": "xxxxx",
          "params": ""
        }
      },
      "updated": "2010-11-01T14:00:26+02:00",
      "link": [{
        "href": "https://rats.enc01.rambla.be/output/192/?alt=json",
        "type": "application/json",
        "rel": "self"
      }],
      "id": "https://rats.enc01.rambla.be/output/192/"
    }],
    "updated": "2012-10-03T21:39:38+02:00",
    "link": [{
      "href": "https://rats.enc01.rambla.be/output/",
      "type": "application/json",
      "rel": "self"
    }],
    "id": "https://rats.enc01.rambla.be/output/?owner=self"
  },
  "version": "1.0",
  "encoding": "UTF-8"
}
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox