Comment on page
Generate Images
How to generate several images at once - Abyssale REST API
Multiple images can be created at once by sending data and customisation parameters to the
POST /async/banner-builder/{template_id}/generate
endpoint, which will respond synchronously with only a generation_request_id
property.
Generating images asynchronously with a callback url (webhook system)
- Supported template type: Static
- Generation response type: Asynchronous (Webhooks or Polling)
post
https://api.abyssale.com
/async/banner-builder/{templateId}/generate
Generate Multi-Format Images
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:
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 = {
"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"
}
}
}
// 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()
All formats of a template can be generated by removing the
template_format_names
property.{
"generation_request_id": "df75afa8-5a77-4e03-aeef-6d1b6dd0580a"
}
Last modified 3mo ago