Authenticate with the API using the API key that you generated in the app.
Authentication method
The API key that you use to authenticate should be kept secret and only be used on the server side, not via the client. Exposing this key could cause bad things to happen.
The authentication method used is the Bearer token.
Add the token to your request header.
Authentication: Bearer <token>
JavaScript example:
import axios from 'axios';
axios.defaults.baseURL = 'https://app.digital-downloads.com/api/v1/';
axios.defaults.headers.common = { 'Authorization': 'Bearer Xmwm2j3EPqQOY51F1QfU6aqFHDQsB1nSTGxxII1a3c5MSYULoVBbHKZ1UL3yxntBETADT' };
// example usage
let orders = await axios.get('/orders');
Request headers
This is a JSON API. Make sure you set these headers.
Accept: application/json
Content-Type: application/json
Rate limits – Error code 429
60 requests per minute.
Rate limit headers will be returned on each request, for example:
X-RateLimit-Limit: 15
X-RateLimit-Remaining: 14
Error responses
401 – Unauthorized
Your API key is not valid. The key is incorrect or has been revoked.
402 – Upgrade required
The storage limit has been reached. Upgrade your plan for more space.
404 – Not found
The resource you are trying to access can not be found.
422 – Validation error
Validation error.
Example response when creating a URL asset.
{
"message": "The filename is required. (and 3 more errors)",
"errors": {
"filename": [
"The filename field is required.",
"The filename name must be a string.",
"The filename must be not be more than 255 characters."
],
"size": [
"The size field is required."
],
"url": [
"The url field is required."
]
}
}
500 – Server error
All server errors will be directly reported to us automatically.