Show examples as:

The SesameVault API « Back to Developer Page

To retrieve a list of all the videos in your vault, call /vault/videos. For example:

http://www.sesamevault.com/vault/videos.xml

Would return something like this:

  <videos>

    <video>
      <id>0ea1c488-b524-4e17-80ad-86a868a50e9c</id>
      <title>My Video</title>
      <description>The best video evArrrr!</description>
      <owner>Bob</owner>
      <public>true</public>
      <duration>315.6543</duration>
      <date_added>Tue Apr 17 2007 16:44:50 GMT-0400</date_added>
      
      <thumbnail>
        <uris>
          <http>http://www.sesamevault.com/video/2981/thumbnail/file</http>
        </uris>
        <md5>fcdf3ddb25c9dffaaec6150dfbfc1dc7</md5>
      </thumbnail>
    </video>

    <video>
      <id>a2ea2f3e-0cdf-4542-b23c-43d207795242</id>
      <title>Cute Bunny</title>
      <description>An adorable bunny doing silly hops.</description>
      <owner>Bob</owner>
      <public>false</public>
      <duration>1057.1124</duration>
      <date_added>Tue Apr 17 2007 18:14:36 GMT-0400</date_added>
      
      <thumbnail>
        <uris>
          <http>http://www.sesamevault.com/video/5774/thumbnail/file</http>
        </uris>
        <md5>3611340e30691dbc357fd1fbeb2e959f</md5>
      </thumbnail>
    </video>

  </videos>

Filtering Results

The call above will return the entire contents of your vault, but you can restrict the results by using a POST request to send a filter to the above URL. Currently you can filter the results by video title, duration, date added, tag, or any combination of these.

Filters take three different parameters:

Note that the "bool" parameter is optional. If left out, it will default to "true".

An example request might look like this:

  <filters>

    <info>
      <num>12</num>
      <sort_by>dated_added</sort_by>
      <sort_reverse>true</sort_reverse>
    </info>

    <filter>
      <type>title</type>
      <data>computer</data>
    </filter>

    <filter>
      <type>title</type>
      <bool>NOT</bool>
      <data>microsoft</data>
    </filter>

    <filter>
      <type>duration</type>
      <bool>true</bool>
      <data>&lt;</data>
      <data>300</data>
    </filter>

  </filters>

This would return all videos with the word "computer" in their title — as long as they didn't also include the word "microsoft" — and with a duration less than 300 seconds.

Note the (optional) "info" section, which lets you set the number of results that are returned, and the sorting of those results. Results can be sorted by "title", "duration", or "date_added".

The title filter:

  <filter>
    <type>title</type>
    <data>search string</data>
  </filter>

The title filter takes a single data parameter which contains the appropriate search term.

The duration filter:

  <filter>
    <type>duration</type>
    <data>&lt;</data>
    <data>300</data>
  </filter>

The duration filter takes two data parameters. The first is the comparison operator (<, <=, >, >=, or =. If your request is formatted as XML, make sure to encode these characters appropriately). The second parameter is the duration in seconds.

The date_added filter:

  <filter>
    <type>date_added</type>
    <data>&lt;</data>
    <data>Tue Apr 17 2007 16:44:50 GMT-0400</data>
  </filter>

The title filter takes two data parameters. The first is the comparison operator. The second is a date, formatted as an ISO 8601 compatible string.

The tag filter:

  <filter>
    <type>tag</type>
    <data>genre</data>
    <data>action</data>
    <data>kungfu</data>
  </filter>

The title filter takes an arbitrary number of data parameters which represent the taglets which comprise the tag. The taglets are ordered descending from parent to child.

Saved Filters

In the web interface of SesameVault, you can create and save filters for later use. To get a list of these filters, call /vault/available_filter_stacks. You can then use these saved filters in your video requests. To do this, you need to provide the id of the filter stack:

  <filters>
    <info>
      <stackid>143</stackid>
    </info>
  </filters>