Documentation

API Headers Reference

This article documents the available headers you can use when making Headless API requests:

Accept

Indicates what format the response content should take. Defaults to json.

Valid Options

  • json

  • xml

Example

curl --header 'Accept: application/xml' 'example.com/o/headless-admin-user/v1.0/user-accounts'

Accept-Language

For resources containing content translated into multiple languages, indicates the language for the returned response content.

Valid Options

All valid language tags (an ISO-639 language identifier plus ISO-3166-1 alpha-2 country identifier); e.g. en-US, es-ES. Defaults to the default language of the site that houses the requested content.

Example

curl --header 'Accept-Language: pt-BR' 'example.com/o/headless-delivery/v1.0/sites/20124/blog-postings'

Authorization

Identifies which User is making the request, using DXP’s Authentication framework. (See also Cookie.) If both this and Cookie are not supplied, the request is attempted as a guest (unauthenticated) user.

Valid Options

  • Basic + Base64-encoded credentials

  • Bearer + OAuth token

Example

curl --header 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQK' 'example.com/o/headless-admin-user/v1.0/user-accounts'

Content-Type

Allows uploading binary data.

Valid Options

  • multipart/form-data

Example

curl --form '[email protected]' --header 'Content-Type: multipart/form-data; boundary=ARBITRARY' 'example.com'

X-Accept-All-Languages

Indicates that the server should return the requested content in all available languages. (See also Accept-Language.)

Valid Options

  • true

  • false

Example

curl --header 'X-Accept-All-Languages: true' 'example.com/o/headless-admin-user/v1.0/user-accounts'