logo
logo

Headers

The REST API uses standard HTTP headers to decorate its requests and replies.

The following request headers are extensively used.

NameDescription
AcceptIndicates the desired media format. At this time, it should always be application/json.
If-None-MatchIndicates that if the ETag header of the resource matches any of those submitted, the request may be fulfilled with a 304 Not Modified reply so that a locally cached version are used instead.
Content-TypeIf the request contains content, this header indicates the media format used. At this time, only application/json is supported.
X-Auth-TokenUsed to authenticate requests.
X-ImpersonateUsed to impersonate a user.

The following returned response headers are the most common.

NameDescription
Content-TypeMedia format used in the body of the response. At this time, only JSON is supported, so this should always return application/json.
ETagString representation of the version returned by the resource that can be used with the If-None-Match header to optimize network bandwidth usage. See Caching.
LocationIn response to creating a new resource, the server responds with 201 Created and includes this header to provide the URL of the newly created resource.
X-Global-IdentifierIn response to creating a new resource, the server responds with 201 Created and includes this header information to provide the GLOBAL IDENTIFIER of the newly created resource.
Note

For brevity, these headers are not explained again in the documentation when discussing the specific details of a resource.

Example

The following example shows how to use the headers in HTTP requests:

curl --request GET \
--url https://MyInstance/api/entities/48109 \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: XXXXXX' \
--header 'X-Impersonate: TheUserToImpersonate'

Can we improve this article ? Provide feedback