Upload recipients
Sets the recipient list of a draft broadcast; each upload replaces the previous list.
curl --request POST \
--url https://api.vobiz.ai/api/v1/sms/broadcasts/{id}/recipients \
--header 'Content-Type: multipart/form-data' \
--header 'X-Auth-ID: <api-key>' \
--header 'X-Auth-Token: <api-key>' \
--form 'file=@example-file;type=text/csv'from vobiz import Vobiz
client = Vobiz(api_key="MA_XXXXXXXX", auth_token="YOUR_AUTH_TOKEN")
client.sms.broadcasts.upload_recipients(
id="3f8d2a6e-5b1c-4e7f-a9d0-2c4b6e8f1a35",
numbers=[
"+14155550123",
"+14155550124",
"415 555 0125"
],
default_country="US",
)
const form = new FormData();
form.append('file', '<string>');
const options = {
method: 'POST',
headers: {'X-Auth-ID': '<api-key>', 'X-Auth-Token': '<api-key>'}
};
options.body = form;
fetch('https://api.vobiz.ai/api/v1/sms/broadcasts/{id}/recipients', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));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.
Body
A recipient file upload. Every column other than the phone column becomes a template variable named after its header.
A .csv or .xlsx file of at most 10 MB and 10,000 recipients. The phone column is detected from its header (phone, mobile, msisdn, number, to, phonenumber and similar), otherwise the first column is used. Files without a header get the columns phone, column2, column3 and so on; CSV delimiters ,, ; and tab are detected, and for XLSX the first sheet is read.
ISO 3166-1 alpha-2 country code, matched case-insensitively, used to normalise numbers that have no country code. Defaults to US.
US, CA, GB, IN, AU, NZ, IE, DE, FR, ES, IT, NL, BE, CH, AT, SE, NO, DK, FI, PL, PT, BR, MX, AR, CO, CL, SG, MY, ID, PH, TH, VN, JP, KR, CN, HK, AE, SA, QA, IL, TR, ZA, NG, KE, EG, PK, BD, LK, NP "US"
Response
Upload summary. The broadcast's columns and stats are updated.
Summary of a recipient upload. The upload replaces the broadcast's previous recipient list.
Rows read from the file or array, excluding the header line.
5
Rows with a valid, unique number that were stored as recipients, including opted-out numbers.
3
Rejected rows with the reason for each, at most the first 100. Fix them in your file and upload again.
Show child attributes
Show child attributes
Total rejected rows, including any beyond the 100 listed in invalid.
1
Rows dropped because the same number appeared earlier in the upload.
1
Stored rows marked opted_out because the number opted out of SMS from you. They count towards valid and are never sent.
0
Column names detected in the upload, as written in your header. The first is the phone column; the rest are template variables.
["phone", "name", "amount"]
Was this page helpful?
curl --request POST \
--url https://api.vobiz.ai/api/v1/sms/broadcasts/{id}/recipients \
--header 'Content-Type: multipart/form-data' \
--header 'X-Auth-ID: <api-key>' \
--header 'X-Auth-Token: <api-key>' \
--form 'file=@example-file;type=text/csv'from vobiz import Vobiz
client = Vobiz(api_key="MA_XXXXXXXX", auth_token="YOUR_AUTH_TOKEN")
client.sms.broadcasts.upload_recipients(
id="3f8d2a6e-5b1c-4e7f-a9d0-2c4b6e8f1a35",
numbers=[
"+14155550123",
"+14155550124",
"415 555 0125"
],
default_country="US",
)
const form = new FormData();
form.append('file', '<string>');
const options = {
method: 'POST',
headers: {'X-Auth-ID': '<api-key>', 'X-Auth-Token': '<api-key>'}
};
options.body = form;
fetch('https://api.vobiz.ai/api/v1/sms/broadcasts/{id}/recipients', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));