Assets
Creating URL assets
There is two types of assets. Files that are uploaded and URLs. We will cover URL assets here, for uploading files view this page.
Creating URL assets
URL assets require three (3) fields. To create a URL asset send a POST request to
https://app.digital-downloads.com/api/v1/assets/store
Request
{
"filename": "My new book",
"size": "10MB",
"url": "https://www.my-website.com/download/my-book.pdf"
}
Response
{
"data": {
"id": "82664d96-6dfd-4343-96b0-05c46f412a5b",
"filename": "My new book",
"size": "10MB",
"is_file": false,
"is_link": true,
"url": "https://www.my-website.com/download/my-book.pdf"
}
}
Using the id returned you can link this asset to a product
Updating URL assets
URL assets can be updated by sending a PUT request with the id in the url
https://app.digital-downloads.com/api/v1/assets/:id
Example PUT url
https://app.digital-downloads.com/api/v1/assets/82664d96-6dfd-4343-96b0-05c46f412a5b
Request
{
"filename": "My new book",
"size": "12MB",
"url": "https://www.my-website.com/download/my-new-book.pdf"
}
Response
{
"data": {
"id": "82664d96-6dfd-4343-96b0-05c46f412a5b",
"filename": "My new book",
"size": "12MB",
"is_file": false,
"is_link": true,
"url": "https://www.my-website.com/download/my-new-book.pdf"
}
}