import axios from 'axios';
axios.post('https://api.artificialstudio.ai/api/generate', {
model: 'social-media-post',
input: {
platform : "Instagram",
post_type : "Quote",
main_text : "DO YOUR BEST WORK",
visual_style : "Bright and Colorful",
color_scheme : "Blue, turquoise, and coral",
additional_elements : "Include beach imagery, sunglasses, and shopping bag icons",
image_size : "1024x1024",
business_logo : "https://files.artificialstudio.ai/1cbba640-1972-4b85-831b-a7879f8b52ae.jpeg"
},
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");
});