General

JSON and XML

Although JSON is preferred and the default, Print API supports both JSON and XML for data interchange. To receive a response in XML, set the Accept header of your HTTP request to application/xml. Of course, be sure to set the appropriate Content-Type header for your requests as well.

TIP: If you're working with JavaScript/AJAX, we recommend always setting the Accept HTTP header of your XMLHttpRequest explicitly, even if you use JSON. If you omit this header, a default value will be used, which varies per browser.

Authentication

Print API is secured with OAuth 2.0. To interact with the API, you must first obtain an access token. Please refer to our main docs and/or code samples for details.

HTTP status codes

Success

200 OK / 201 Created

The request was processed sucessfully. In the case of 201 Created, a new entity was created as the result. This new entity may be found at the URL in the Location HTTP header of the HTTP response.

Errors

The following status codes indicate something went wrong. These will always be accompanied by a detailed error message plus a few hints on what to do in the body of the HTTP response, so be sure to check there for more details.

400 Bad Request

The request was not processed due to invalid input. This status code is used to indicate syntax errors or invalid values, like unknown product ID's, incorrectly formatted dates or PDF files with invalid dimensions.

401 Unauthorized

The request was not processed because it was unauthenticated, the authentication has expired or invalid OAuth 2.0 credentials were supplied. You must supply a valid access token obtained from the OAuth 2.0 endpoint to access the resource. Check the tutorial or code samples for details.

403 Forbidden

The request was not processed because the context was invalid. The input and authentication may be valid, but the request is not allowed given the current server state. For example, this status code may occur if an application tries to use Print API checkout without the right settings.

404 Not Found

The request was not processed because the URL is invalid. There may be a typo or unknown ID in the URL. The body of the HTTP response will explain whether the URL is unrecognized altogether, or if it contains an invalid parameter.

Others

The status codes 405 Method Not Allowed, 406 Not Acceptable and 415 Unsupported Media Type occur if an application sends an HTTP request with an HTTP method, format or data not supported by the URL. Refer to the response body for details.