Search…
⌃K
Links

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
curl -X POST -H "x-api-key:{YOUR-API-KEY}" -H "Content-Type: application/json" \
-d '{
"callback_url": "https://webhook.mycompany.com/images",
"template_format_names": ["facebook-feed", "instagram-post", "iab-medium"],
"elements": {
"primary_text": {
"payload": "New branding available.",
"color": "#FF0000"
}
}
}' \
https://api.abyssale.com/async/banner-builder/{template_id}/generate
const axios = require('axios');
const payload = {
"template_format_name": "facebook-feed",
"elements": {
"primary_text": {
"payload": "New branding available.",
"color": "#FF0000"
}
}
}
// Replace {id} by your template ID
axios.post("https://api.abyssale.com/async/banner-builder/{id}/generate", payload, {
headers: {"x-api-key": "{YOUR-API-KEY}", "Content-Type": "application/json", "timeout": 30000}
}).then(response => {
console.log(response.data)
}j
import json
import requests
image_generation_payload = {
"callback_url": "https://webhook.mycompany.com/images",
"template_format_names": ["facebook-feed", "instagram-post", "iab-medium"],
"elements": {
"primary_text": {
"payload": "New branding available.",
"color": "#FF0000"
}
}
}
# Do not forget to replace {YOUR-API-KEY} and {template_id}
r = requests.post("https://api.abyssale.com/async/banner-builder/{template_id}/generate",
headers={"x-api-key": "YOUR-API-KEY", "Content-Type": "application/json"},
data=json.dumps(image_generation_payload),
timeout=30
)
r.json()

Sample response

{
"generation_request_id": "df75afa8-5a77-4e03-aeef-6d1b6dd0580a"
}