Preview a broadcast
Renders the template for the first pending recipients so you can check personalisation, encoding and segment counts before you launch. Nothing is sent and nothing is charged.
curl --request GET \
--url https://api.vobiz.ai/api/v1/sms/broadcasts/{id}/preview \
--header 'X-Auth-ID: <api-key>' \
--header 'X-Auth-Token: <api-key>'from vobiz import Vobiz
client = Vobiz(api_key="MA_XXXXXXXX", auth_token="YOUR_AUTH_TOKEN")
client.sms.broadcasts.preview_broadcast(
id="3f8d2a6e-5b1c-4e7f-a9d0-2c4b6e8f1a35",
)
const options = {
method: 'GET',
headers: {'X-Auth-ID': '<api-key>', 'X-Auth-Token': '<api-key>'}
};
fetch('https://api.vobiz.ai/api/v1/sms/broadcasts/{id}/preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"samples": [
{
"to": "+14155550123",
"text": "Hi Priya, your refund of $42.00 is on its way.",
"segments": 1,
"encoding": "GSM-7"
},
{
"to": "+14155550124",
"text": "Hi Sam, your refund of $18.50 is on its way.",
"segments": 1,
"encoding": "GSM-7"
}
],
"missingVariables": [],
"estimatedSegments": 2
}{
"error": "limit must be between 1 and 50"
}{
"error": "missing or invalid credentials"
}{
"error": "broadcast not found"
}Authorizations
Your Vobiz account Auth ID (MA_XXXXXXXX).
Your Vobiz account Auth Token.
Path Parameters
The broadcast's id (UUID), as returned by POST /broadcasts or GET /broadcasts. An id that is not a UUID, or that belongs to another account, returns 404 with broadcast not found.
Query Parameters
Number of pending recipients to render in samples, from 1 to 50. Defaults to 5 when you omit it or pass 0. A value above 50 returns 400 with limit must be between 1 and 50, and a non-integer returns 400 with limit must be an integer.
1 <= x <= 50Response
Rendered samples and totals.
The template rendered for the first pending recipients, with the information you need to check a broadcast before launching it.
The template rendered for up to limit pending recipients, in upload order. Empty when no recipient is pending.
Show child attributes
Show child attributes
Placeholders in the template that have no matching upload column. They render as empty text; an empty array means every placeholder is filled.
[]
Total SMS segments across all pending recipients. Multiply by your per-segment rate to estimate the cost of the launch.
3
Was this page helpful?
curl --request GET \
--url https://api.vobiz.ai/api/v1/sms/broadcasts/{id}/preview \
--header 'X-Auth-ID: <api-key>' \
--header 'X-Auth-Token: <api-key>'from vobiz import Vobiz
client = Vobiz(api_key="MA_XXXXXXXX", auth_token="YOUR_AUTH_TOKEN")
client.sms.broadcasts.preview_broadcast(
id="3f8d2a6e-5b1c-4e7f-a9d0-2c4b6e8f1a35",
)
const options = {
method: 'GET',
headers: {'X-Auth-ID': '<api-key>', 'X-Auth-Token': '<api-key>'}
};
fetch('https://api.vobiz.ai/api/v1/sms/broadcasts/{id}/preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"samples": [
{
"to": "+14155550123",
"text": "Hi Priya, your refund of $42.00 is on its way.",
"segments": 1,
"encoding": "GSM-7"
},
{
"to": "+14155550124",
"text": "Hi Sam, your refund of $18.50 is on its way.",
"segments": 1,
"encoding": "GSM-7"
}
],
"missingVariables": [],
"estimatedSegments": 2
}{
"error": "limit must be between 1 and 50"
}{
"error": "missing or invalid credentials"
}{
"error": "broadcast not found"
}