This documentation is obsolete. Please see updated documentation at http://docs.singleplatform.com/spv2/rest-api/

REST API

General API Information

Content Types

The SinglePlatform REST API is a well-behaving API that returns results according to the requested content type. Use the Accept header in a request to indicate you want the result in a specific format.

Default Content Type

Except where noted, the default content type of all responses in the API is text/html.

Accepted Content Types

The content types currently understood by much of the API includes:

If a URI responds to a differing set of content types, that URI's definition includes the list of content types to which it responds.

Request Header

What is always accepted in the headers:

For specific URIs, other required or optional headers may be defined.

Response Header

What is commonly returned in the response headers:

For specific URI responses, other response headers may be defined.

Default Response

Unless otherwise noted, the default response from an action is a text/html document with the following fields:

To receive a document in another format, that format must be specified in the Content-Type request header.

API Key Use

Unless otherwise noted, all API requests for HTML data should be accompanied by your API Key.

For details about what is the API Key and how you can obtain it, see: API Key.

Authentication Requirements

Unless otherwise noted, all API requests for JSON data require the request to be authenticated using your Client ID and Signing Key.

For details about how to acquire and use them, see API Authentication.

URIs

URI: /locations/search

The search URI should be used to find any locations available for your use.

GET

Request

Headers:

Parameters:

URI Examples:

The following two example URIs are equivalent and return the first 20 of the available locations as the 0th page of locations.

/locations/search
/locations/search?q=&page=0&count=20

An example query URL that returns the third page of results for all locations with Haru in the name:

/locations/search?q=Haru&page=3&count=100

The following example returns the first 20 of the locations updated since January 18, 2013 at 2:03 pm as the 0th page of locations.

/locations/search?updatedSince=2013-01-18T14%3A03%3A00
Response

The JSON response contains the following information:

URI: /locations/LOCATION

In the URI, LOCATION should be replaced by the ID of the location. For example, the ID for Haru might be haru-7 and the URI would be /locations/haru-7

GET

Request

Headers:

Response

Returns the set of information for the location as defined in Location Field Descriptions.