curl --request GET \
--url https://api.zerogen.com/v1/assets/{assetId}/download \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.zerogen.com/v1/assets/{assetId}/download', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.zerogen.com/v1/assets/{assetId}/download"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"assetId": "<string>",
"projectId": "<string>",
"url": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"filename": "<string>",
"mimeType": "<string>",
"sizeBytes": 4503599627370495
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}Download an asset
A signed URL for the asset’s original file, by the asset’s ID alone, with its filename, media type and size. The URL starts a download until expiresAt, 5 minutes after the response, and needs no API key: send no Authorization header with it. Anyone holding it can download the file. Read this endpoint again for a new URL.
Needs the library:read scope.
curl --request GET \
--url https://api.zerogen.com/v1/assets/{assetId}/download \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.zerogen.com/v1/assets/{assetId}/download', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.zerogen.com/v1/assets/{assetId}/download"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"assetId": "<string>",
"projectId": "<string>",
"url": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"filename": "<string>",
"mimeType": "<string>",
"sizeBytes": 4503599627370495
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}Authorizations
A ZeroGen API key: zg_ for a live key, zg_test_ for a test key.
Path Parameters
The asset's ID
Response
Where to download the file.
A signed storage URL that downloads the original file. Anyone holding it can download the file, so keep it private. GET it without your API key: storage refuses a request that also sends an Authorization header.
When url stops starting downloads; read the endpoint again for a new one
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$The name the file downloads under; untrusted content
0 <= x <= 9007199254740991