Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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:

  • Accept: takes one of: application/json

...

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

Code Block
/restaurantslocations/search
/restaurantslocations/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:

Code Block
/restaurantslocations/search?q=Haru&page=3&count=100

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

Code Block
/restaurantslocations/search?updatedSince=2012-01-18+14:03
Response

The JSON response contains the following information:

  • A map of:
    • query: The original query line sent to the search engine
    • oktrue if the search was a success. false if the search was not a success. If the search was a success but no results were found, this value is true.
    • page: Which page these results are on, should match the original query (or be 0 if not defined in the original query)
    • count: Number of results per page, should match the original query (or be 20 if not defined in the original query)
    • total: The full number of results that the search have matched; can be used to calculate total number of pages
    • time: The date/time when the query was performed in Eastern Standard Time (EST).
    • results: A list of maps, each is a location with the keys as defined in Location Field Descriptions.

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 /restaurantslocations/haru-7/

GET

Request

Headers:

  • Accept: takes one of: application/json
Response

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