import axios from 'axios';
axios.post('https://api.artificialstudio.ai/api/generate', {
model: 'event-poster',
input: {
event_name : "Jazz Night Under the Stars",
event_type : "Concert",
date_time : "Saturday, August 12 • 8:00 PM",
location : "Central Park Amphitheater",
style : "Elegant",
color_scheme : "Deep blue and gold",
additional_info : "Featuring The John Smith Quartet. Tickets: $25 - Available at www.jazznight.com",
essential_details : "Include silhouettes of jazz musicians, stars, and a night sky theme. Make sure to prominently display ticket information.",
image_size : "1024x1536"
},
webhook: 'https://your-webhook-url.com/api/webhook',
}, {
headers: {
'Content-Type': 'application/json',
'Authorization': 'YOUR_API_KEY'
}
}).then(res => {
console.log('Success:', res.data);
}).catch(error => {
console.error('Error:', error);
});
app.post("/api/webhook", (req: any, res: any) => {
console.log(req.body) // id, output, status, model, payload, error...
res.send("Webhook received");
});