With the SesameVault API, you access different functionality through standardized URLs.
Access to a particular video's metadata, for example, is accomplished via http://www.sesamevault.com/video/info/[VIDEO ID], while access to a list of all the videos in your vault happens through http://www.sesamevault.com/vault/videos
For many API calls, you are simply requesting information (rather than setting or changing it), and therefore a standard GET request is all that is required. (For how to do this with specific API calls, refer to the documentation on those calls.)
When altering data, however, you will want to make a POST request. The SesameVault API supports POST requests in a number of formats:
Whichever format you choose to use, ultimately your data is just an associative array of information. For example, take the following data:
In XML, this data might be represented as:
<data>
<action>say something</action>
<message>Trust The Computer.</message>
<message>The Computer is your friend.</message>
</data>
In JSON:
{
"action" : "say something",
"message" : ["Trust The Computer.", "The Computer is your friend."]
}
And as a standard URL-encoded string:
All these formats equivalently describe the same data, and as such are valid ways to communicate with SesameVault. Use the "Content-Type" header to tell our servers what format you are using ( e.g. "application/xml" for XML, "application/yaml" for YAML, "application/x-www-form-urlencoded" for URL-encoding, etc).
You may specify which format you would like our servers to use when responding to your request. These formats include:
Specifying the response format couldn't be easier. Just change the file extension of the URL you are requesting:
These all return the same data in the appropriate formats.