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/Account/{auth_id}/Sms/Broadcast/{id}/Recipient/ \
--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/Account/{auth_id}/Sms/Broadcast/{id}/Recipient/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"total": 5,
"valid": 3,
"invalid": [
{
"row": 4,
"value": "abc",
"reason": "contains letters or symbols"
}
],
"invalidCount": 1,
"duplicates": 1,
"optedOut": 0,
"columns": [
"phone",
"name",
"amount"
]
}Authorizations
Path Parameters
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.
Was this page helpful?
curl --request POST \
--url https://api.vobiz.ai/api/v1/Account/{auth_id}/Sms/Broadcast/{id}/Recipient/ \
--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/Account/{auth_id}/Sms/Broadcast/{id}/Recipient/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"total": 5,
"valid": 3,
"invalid": [
{
"row": 4,
"value": "abc",
"reason": "contains letters or symbols"
}
],
"invalidCount": 1,
"duplicates": 1,
"optedOut": 0,
"columns": [
"phone",
"name",
"amount"
]
}