Use this API to search for assets. Optionally view connected products, too.
Search for all assets
To view assets, send a GET request to:
https://app.digital-downloads.com/api/v1/assets
Response
Parameter meanings:
- “id”: the UUID for the asset in the URL bar in Fileflare.
- “filename”: The File name of the asset.
- “size”: Size of the asset.
- “is_file”: If “true”, then it is an uploaded file. If “false, then it’s a URL-based asset which is noted as the “is_link” parameter.
- “is_link”: If “true”, then it is a URL asset. If “false, then it’s an uploaded asset which is noted as the “is_file” parameter.
- “url”: This is the URL for URL assets which have the parameter as “is_link” set to “true”. Uploaded files do not utilise this field. If you want the download URL for an uploaded asset, you should use the Download links API because download links are created only along with orders.
JSON
{
"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",
"products": [
{
"id": "82664d96-6dfd-4343-96b0-05c46f412a5q",
"name": "My new Book",
"variant_name": "Paper back",
"sku": "my-sku",
"product_id": 123456,
"variant_id": 1234567,
"vendor": "my-store",
"tags": [
"books",
"paper-books"
]
},
{
"id": "82664d96-6dfd-4343-96b0-05c46f412a5r",
"name": "My new Book",
"variant_name": "Hard back",
"sku": "my-sku",
"product_id": 123456,
"variant_id": 1234563,
"vendor": "my-store",
"tags": [
"books",
"hardback-books"
]
}
]
}
],
"links": {
"first": "https://app.digital-downloads.com/api/v1/assets?page=1",
"last": "https://app.digital-downloads.com/api/v1/assets?page=4",
"prev": null,
"next": "https://app.digital-downloads.com/api/v1/assets?page=2"
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 4,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "https://app.digital-downloads.com/api/v1/assets?page=1",
"label": "1",
"active": true
},
{
"url": "https://app.digital-downloads.com/api/v1/assets?page=2",
"label": "2",
"active": false
},
{
"url": "https://app.digital-downloads.com/api/v1/assets?page=3",
"label": "3",
"active": false
},
{
"url": "https://app.digital-downloads.com/api/v1/assets?page=4",
"label": "4",
"active": false
},
{
"url": "https://app.digital-downloads.com/api/v1/assets?page=2",
"label": "Next »",
"active": false
}
],
"path": "https://app.digital-downloads.com/api/v1/assets",
"per_page": 25,
"to": 25,
"total": 76
}
}
Query parameters for filtering specific assets
To find assets, you can add query string parameters. The results are paginated. Use the query string parameter page
for more pages, or use the links provided in the response.
JSON
{
"limit": 100, // max of 1000 will be retuned
"filename": "My new book",
"with_products": true, // show linked products
"page": 5
}
Examples
Searching the filename to find specific assets. You can add the filename including spaces and it will work. You can search any part of the filename to search for multiple assets with the same letters included:
https://app.digital-downloads.com/api/v1/assets?filename=any part of the filename
Different types of queries:
https://app.digital-downloads.com/api/v1/assets?limit10&filename=My%20new%20book&with_products=true&page=5
View single asset
View individual assets. Optionally load linked products. Send a GET request using the assets ID.
GET https://app.digital-downloads.com/api/v1/assets/:id
Example
https://app.digital-downloads.com/api/v1/assets/82664d96-6dfd-4343-96b0-05c46f412a5b?with_products=true
Response
Parameter meanings:
- “id”: the UUID for the asset in the URL bar in Fileflare.
- “filename”: The File name of the asset.
- “size”: Size of the asset.
- “is_file”: If “true”, then it is an uploaded file. If “false, then it’s a URL-based asset which is noted as the “is_link” parameter.
- “is_link”: If “true”, then it is a URL asset. If “false, then it’s an uploaded asset which is noted as the “is_file” parameter.
- “url”: This is the URL for URL assets which have the parameter as “is_link” set to “true”. Uploaded files do not utilise this field. If you want the download URL for an uploaded asset, you should use the Download links API because download links are created only along with orders.
JSON
{
"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",
"products": [
{
"id": "82664d96-6dfd-4343-96b0-05c46f412a5q",
"name": "My new Book",
"variant_name": "Paper back",
"sku": "my-sku",
"product_id": 123456,
"variant_id": 1234567,
"vendor": "my-store",
"tags": [
"books",
"paper-books"
]
},
{
"id": "82664d96-6dfd-4343-96b0-05c46f412a5r",
"name": "My new Book",
"variant_name": "Hard back",
"sku": "my-sku",
"product_id": 123456,
"variant_id": 1234563,
"vendor": "my-store",
"tags": [
"books",
"hardback-books"
]
}
]
}
}