REST API headers

Request

Host

Mandatory.

The Host header defines Carriots REST API server (where to connect). More details at http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.23

Value: api.carriots.com

Example: Host: api.carriots.com

Carriots.apiKey

Mandatory.

This header defines the request API key. This apikey will be used to fully determine privileges and visibility for the request within Carriots platform.
Example: carriots.apiKey: ed5620c5013d782fe2eeaf9fd03b7fc0a42fafb06f0608b58d5ab2f9027f955f

Accept

Mandatory.

Defines expected request MIME type. Carriots currently accepts 4 different MIME types:

  • application/json: Carriots will render the response in JSON format following the current REST API specifications
  • application/xml: Carriots will render the response in XML format following the current REST API specifications
  • application/vnd.carriots.v2+json: Carriots will render the response in JSON format following the version 2 REST API specifications
  • application/vnd.carriots.v2+xml: Carriots will render the response in XML format following the version 2 REST API specifications

Notes:

  • Default value: application/vnd.carriots.v2
  • If no Accept header is present, Carriots will assume the default value
  • If no version is defined, Carriots will assume the most recent version available
  • If Carriots do not understand the Accept header value, default value will be assumed and no error will be returned
  • Several values may be defined separated by commas with priority specified by ;q=
  • More details at http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1

Examples:

Accept: application/vnd.carriots.v2 ? default (API v2 and JSON format)
Accept: application/vnd.carriots.v2+xml ? API v2 and XML format
Accept: application/vnd.carriots ? most recent API and JSON format
Accept: application/vnd.carriots+xml ? most recent API and XML format
Accept: application/json;q=0.9,vnd.carriots,application/xml;q=0.8

User-Agent

Mandatory.

Defines client software. More details at http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.43

Example: User-Agent: device A001

Content-Length

Mandatory.

Defines bodys data length in bytes. More details at http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.13

Example: Content-Length: 209

Content-Type

Mandatory.

Defines expected request MIME type. Carriots currently accepts 4 different MIME types:

  • application/json: Carriots will render the response in JSON format following the current REST API specifications
  • application/xml: Carriots will render the response in XML format following the current REST API specifications
  • application/vnd.carriots.v2+json: Carriots will render the response in JSON format following the version 2 REST API specifications
  • application/vnd.carriots.v2+xml: Carriots will render the response in JSON format following the version 2 REST API specifications

Notes:

  • Default value: application/vnd.carriots.v2+json
  • If no Content-Type header is present, Carriots will assume default value
  • If no version is defined, Carriots will assume the most recent version available
  • If Carriots do not understand the Content-Type header value, default value will be assumed and no error will be returned
  • More details at http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17

Example: Content-Type: application/vnd.carriots.v2+xml

Response

Date

Defines message response date and hour. More details at http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.18

Server

Holds information about request software used by the server. Default value: Carriots REST API

Allow

List of allowed actions for the given resource. More details at http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.7

Connection

Defines connection options for the sender.
Carriots always closes connection after the response.

Cache-Control

Defines the directives for cache management. More details at: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9

Content-Length

Defines bodys data length in bytes. More details at http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.13

Content-Type

Defines response body MIME type. More details at http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17