CloudFire API


Overview

The CloudFire api is implemented as vanilla XML and JSON over HTTP and follows a REST model. Other parts of the API are built using RSS/SSE feeds.

 

Authentication

The api can be called locally (from the computer where CloudFire is running) or remotely. When called locally, it is assumed that the caller has secure access to the computer and no authentication tokens or passwords are required to call the api. This makes it easier for third party services to seamlessly administer and configure CloudFire without user intervention.

 

When called remotely, an authentication token is required to call the api.

 

Read operations

Read actions are done through GET requests and are easily explorable using a browser - FireFox and IE do a good job displaying the resulting xml.

 

These methods can also be invoked using curl:

curl http://localhost:57920/api/photo_sharing/settings

If the read is successful, an XML response is returned along with the status code "200 OK".

 

Write operations

Write operations (CREATE, UPDATE, DELETE) are invoked using POST, PUT, and DELETE. Because of the XML payload, these operations aren't explorable through a browser, but curl can still be used as a quick and easy way to test the api out.

 

Here is an update example:

curl -X PUT -H 'Content-Type: application/xml' \
-d @settings.xml http://localhost:57920/api/photo_sharing/settings

The type of operation is passed using the -X argument and a content type header of "application/xml" needs to be included.