Image Export
How to export images - Abyssale REST API
You can generate an export (.zip format) containing several images.
This process is asynchronous and requires a webhook server to listen to export events.
The export process

(1) Ask an export

post
https://api.abyssale.com
/async/banners/export
Create a banner export
cURL
Javascript
Python
1
# Do not forget to replace {YOUR-API-KEY}
2
curl -X POST -H "x-api-key:{YOUR-API-KEY}" -H "Content-Type: application/json" \
3
-d '{
4
"callback_url": "https://webhook.mycompany.com/export",
5
"ids": ["{banner_id1}", "{banner_id2}", "{banner_id3}"]
6
}' \
7
https://api.abyssale.com//async/banners/export
Copied!
1
const axios = require('axios');
2
3
const payload = {
4
"callback_url": "https://webhook.mycompany.com/export",
5
"ids": ["{banner_id1}", "{banner_id2}", "{banner_id3}"]
6
}
7
8
// Replace {id} by your template ID
9
axios.post("https://api.abyssale.com/banner-builder/{id}/generate", payload, {
10
headers: {"x-api-key": "{YOUR-API-KEY}", "Content-Type": "application/json", "timeout": 30000}
11
}).then(response => {
12
console.log(response.data)
13
})
Copied!
1
import json
2
import requests
3
4
export_payload = {
5
"callback_url": "https://webhook.mycompany.com/export",
6
"ids": ["{banner_id1}", "{banner_id2}", "{banner_id3}"]
7
}
8
9
# Do not forget to replace {YOUR-API-KEY} and {template_id}
10
r = requests.post("https://api.abyssale.com/banner-builder/{template_id}/generate",
11
headers={"x-api-key": "YOUR-API-KEY", "Content-Type": "application/json"},
12
data=json.dumps(export_payload),
13
timeout=30
14
)
15
r.json()
Copied!

(2) Receive the export request ID

If the export request is accepted, the API call returns the export_id. It represents the ID of the asynchronous export and allows toto identify the asynchronous response.

The following errors can occur:

  • 400: A given parameter is invalid. Body response:
1
{
2
"message": "body_validation_errors: {'media': {'ids': {0: ['Length must be 36.']}}}",
3
"errors": {
4
"media": {
5
"ids": {
6
"0": [
7
"Length must be 36."
8
]
9
}
10
}
11
}
12
}
Copied!
  • 404: One the given banner ID cannot be found.

(3) NewExport event

Once the export is generated on the Abyssale side, a NewExport event is sent (POST) to the callback_url
If the initial request returns an export ID, the NewExport event will always be sent.