Request Headers
Request headers
You must include the following headers in requests sent to the BOX API:
Name Description Request Type Required Value
content-type
The media type of the requested resource.
POST/PUT/GET
application/json
[ API key name ] The key used for authentication POST/PUT/GET secret supplied by BOX
An Accept header is required for all requests, for example:
Accept: application/json
A Content-Type and Content-Length header must be given when sending data to the API (using POST endpoints), for example:
Content-Type: application/json
Content-Length: 3495
For the Accept and Content-Type headers, you may give either the standard JSON MIME type (application/json), or the JSON-API variant (application/vnd.api+json).
You will receive an (invalid data in request body) message error if you attempt to make a POST request without one of these MIME types.
In the case of a missing Content-Length header, you will receive an Error 411 (Length Required) error message. Although, the majority of HTTP clients should send the header by default.
curl --request POST \
--url https://sandbox-api.sandbox.boxproc.io/create-resource \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'api-key-name: api_key_value' \
--data '{"field_name": "value"}'
Updated almost 2 years ago