1. Help Center
  2. Implementation, Deployment, and Security

JSON, Dates, and Formatting

All data should be transferred using valid JSON format (with the exception of Campaign report data which, by default, uses CSV format). Since JSON does not specify how to handle hypermedia, the JSON responds using the HAL specification. Many resources are also specified using URI templates, allowing the client to fill in parts of the URI in order to locate the exact resource. When a link element's href attribute contains a URI template, there is an additional "templated" attribute on the link with a boolean value true.

The following is an example response:

{

   "_links" : {

       "site" : {

          "href" : https://admin1.sitespect.com/api/site/{site-id},

          "title" : "Site Information",

          "templated" : true

       }

   }

}

The response is minified by default but the prettyprint=true query parameter contains stylistic formatting for better readability. All JSON responses are returned with the standard application/json Content-type header to support in-browser display of these resources (with the exception of Campaign report data which is delivered in CSV format by default). If you are using a HAL browser or a client that already understands HAL link relations, you can always pass an Accept: application/hal+json header with your API requests; the server responds with the application/hal+json media type.

All dates must use ISO 8601 format. The following are good examples of a valid ISO 8601 date:

YYYYMMDDThhmmss[+-]hhmm

YYYY-MM-DDThh:mm:ss[+-]hh:mm