Generate Multi-format Images
How to generate several images at one - Abyssale REST API
Generating images asynchronously
post
https://api.abyssale.com
/async/banner-builder/{templateId}/generate
Generate Multi-Format Images
The elements property is the same as Generate Image.

The callback_url request parameter and the asynchronous mechanism

As this method is asynchronous you should provide a callback_url. The NewBannerBatch event will be POSTed to this URL when the generation batch finishes.
To discover globally how this system works, check out the following Webhooks guide:

Sample request

​Do not forget to replace {YOUR-API-KEY} and {templateId}
cURL
Javascript
Python
1
curl -X POST -H "x-api-key:{YOUR-API-KEY}" -H "Content-Type: application/json" \
2
-d '{
3
"callback_url": "https://webhook.mycompany.com/images",
4
"template_format_names": ["facebook-feed", "instagram-post", "iab-medium"],
5
"elements": {
6
"primary_text": {
7
"payload": "New branding available.",
8
"color": "#FF0000"
9
}
10
}
11
}' \
12
https://api.abyssale.com/banner-builder/{template_id}/generate
Copied!
1
const axios = require('axios');
2
3
const payload = {
4
"template_format_name": "facebook-feed",
5
"elements": {
6
"primary_text": {
7
"payload": "New branding available.",
8
"color": "#FF0000"
9
}
10
}
11
}
12
13
// Replace {id} by your template ID
14
axios.post("https://api.abyssale.com/banner-builder/{id}/generate", payload, {
15
headers: {"x-api-key": "{YOUR-API-KEY}", "Content-Type": "application/json", "timeout": 30000}
16
}).then(response => {
17
console.log(response.data)
18
}j
Copied!
1
import json
2
import requests
3
4
image_generation_payload = {
5
"callback_url": "https://webhook.mycompany.com/images",
6
"template_format_names": ["facebook-feed", "instagram-post", "iab-medium"],
7
"elements": {
8
"primary_text": {
9
"payload": "New branding available.",
10
"color": "#FF0000"
11
}
12
}
13
}
14
15
# Do not forget to replace {YOUR-API-KEY} and {template_id}
16
r = requests.post("https://api.abyssale.com/banner-builder/{template_id}/generate",
17
headers={"x-api-key": "YOUR-API-KEY", "Content-Type": "application/json"},
18
data=json.dumps(image_generation_payload),
19
timeout=30
20
)
21
r.json()
Copied!

Sample response

1
{
2
"generation_request_id": "df75afa8-5a77-4e03-aeef-6d1b6dd0580a"
3
}
Copied!