Create a webhook
Registers an HTTPS endpoint that receives subscribed events as signed POST requests. Only url is required; omit events for the default message events.
curl --request POST \
--url https://api.vobiz.ai/api/v1/Account/{auth_id}/Sms/Webhook/ \
--header 'Content-Type: application/json' \
--header 'X-Auth-ID: <api-key>' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"url": "https://example.com/vobiz/webhooks"
}
'from vobiz import Vobiz
client = Vobiz(api_key="MA_XXXXXXXX", auth_token="YOUR_AUTH_TOKEN")
client.sms.webhooks.create_webhook(
url="https://example.com/vobiz/webhooks",
secret="YOUR_WEBHOOK_SECRET",
events=[
"message.received",
"message.delivered",
"message.failed"
],
)
const options = {
method: 'POST',
headers: {
'X-Auth-ID': '<api-key>',
'X-Auth-Token': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({url: 'https://example.com/vobiz/webhooks'})
};
fetch('https://api.vobiz.ai/api/v1/Account/{auth_id}/Sms/Webhook/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));Authorizations
Path Parameters
Body
The subscription to create. Only url is required.
Event names to deliver to this URL, matched exactly. Defaults to message.received, message.delivered and message.failed when you omit it or send an empty array.
A messaging event name you can subscribe to: message.status (delivery state changed), message.delivered (reached the handset), message.failed (could not be delivered), message.received (inbound message) or broadcast.updated (broadcast status or counters changed).
message.status, message.delivered, message.failed, message.received, broadcast.updated Response
The subscription, active immediately. Call GET /Webhook/{id}/ to read the stored createdAt time.
A webhook subscription: the URL Vobiz delivers your chosen events to, and the secret used to sign them.
Event names delivered to this URL. An event is delivered only when its name appears here exactly.
A messaging event name you can subscribe to: message.status (delivery state changed), message.delivered (reached the handset), message.failed (could not be delivered), message.received (inbound message) or broadcast.updated (broadcast status or counters changed).
message.status, message.delivered, message.failed, message.received, broadcast.updated [ "message.received", "message.delivered", "message.failed" ]
Was this page helpful?
curl --request POST \
--url https://api.vobiz.ai/api/v1/Account/{auth_id}/Sms/Webhook/ \
--header 'Content-Type: application/json' \
--header 'X-Auth-ID: <api-key>' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"url": "https://example.com/vobiz/webhooks"
}
'from vobiz import Vobiz
client = Vobiz(api_key="MA_XXXXXXXX", auth_token="YOUR_AUTH_TOKEN")
client.sms.webhooks.create_webhook(
url="https://example.com/vobiz/webhooks",
secret="YOUR_WEBHOOK_SECRET",
events=[
"message.received",
"message.delivered",
"message.failed"
],
)
const options = {
method: 'POST',
headers: {
'X-Auth-ID': '<api-key>',
'X-Auth-Token': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({url: 'https://example.com/vobiz/webhooks'})
};
fetch('https://api.vobiz.ai/api/v1/Account/{auth_id}/Sms/Webhook/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));