Retailer magic: SMS strategies for Winter | On Demand Sign up for our webinar
Retrieve a list of contacts that are currently blacklisted.
/blacklist
Attribute | Type | Description | Default |
---|---|---|---|
number | int | Fetch a single blacklisted number | |
start | datetime, string | The oldest date of the blacklisted numbers added you want to retrieve. Formats: UNIX: A UNIX timestamp (e.g. 1537525884 )ISO 8601: A string format including the time and timezone (e.g. 2018-02-22T09:03:00+00:00 )Human Readable: A human readable way to write the date or time you want to sent the message at (e.g. 25th December 2019 21:00 , 2 weeks , august 20 , may 11 2019 , last friday of march 2019 , next saturday ) | NOW() |
end | datetime, string | The newest date of the blacklisted numbers added you want to retrieve. Formats: UNIX: A UNIX timestamp (e.g. 1537525884 )ISO 8601: A string format including the time and timezone (e.g. 2018-02-22T09:03:00+00:00 )Human Readable: A human readable way to write the date or time you want to sent the message at (e.g. 25th December 2019 21:00 , 2 weeks , august 20 , may 11 2019 , last friday of march 2019 , next saturday ) | |
sort | string | Sort the response by ID in ASC or DESC order. | DESC |
skip | int | Where to start the returned results | 0 |
limit | int | Where to end the returned results. Limit: 1000 | 25 |
Example Code
cURL
curl https://api.voodoosms.com/blacklist \
-H "Authorization: Bearer {key}"
PHP
<?php
$api_key = 'API KEY';
$query = http_build_query([
"number" => 447800000987
]);
$ch = curl_init('https://api.voodoosms.com/blacklist?' . $query);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: ' . $api_key
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
Response
{
"id": 16333025,
"number": 447800000987,
"status": "SUCCESS",
"created_at": 1618233951
}
There are no required
properties for this API, only optional
Code | Message | Meaning |
---|---|---|
33 | Invalid number | This number is not in your blacklist |
51 | Blacklist is empty | Your Blacklist contains no contacts |
Error Response
{
"error": {
"code": 33,
"msg": "Invalid number"
}
}
This endpoint allows you to add a contact to your Blacklist.
/blacklist
There are no optional
properties for this API, only required
Attribute | Type | Description |
---|---|---|
number | int | The number you want to Blacklist |
Code | Message | Meaning |
---|---|---|
33 | Invalid number | This must be a number |
53 | Number already in Blacklist | Number is already present in the Blacklist |
Example Code
cURL
curl -X POST https://api.voodoosms.com/blacklist \
-H "Authorization: Bearer {key}" \
-d '{
"number": 447800000987
}'
PHP
<?php
$api_key = 'API KEY';
$msg = json_encode(
[
"number" => 447800000987
]
);
$ch = curl_init('https://api.voodoosms.com/blacklist');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: ' . $api_key
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, $msg);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
Response
{
"id": 467787,
"number": 447800000987,
"status": "SUCCESS",
"created_at": 1542811725
}
Error Response
{
"error": {
"code": 33,
"msg": "Invalid number"
}
}
Edit a contact from the Blacklist, by replacing the existing entry with a new number.
/blacklist
Attribute | Type | Description |
---|---|---|
old_number | int | The number you’re changing |
new_number | int | The number you’re amending it to |
Code | Message | Meaning |
---|---|---|
33 | Invalid number | This must be a number |
Code Examples
cURL
curl -X PUT https://api.voodoosms.com/blacklist \
-H "Authorization: Bearer {key}"
-d '{
"old_number": 447000000547,
"new_number": 447000000367
}'
PHP
<?php
$api_key = 'API KEY';
$msg = json_encode(
[
'old_number' => 447000000547,
'new_number' => 447000000367
]
);
$ch = curl_init('https://api.voodoosms.com/blacklist');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: ' . $api_key
]);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($ch, CURLOPT_POSTFIELDS, $msg);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
Response
{
"status": "SUCCESS",
"old_number": 447800000987,
"new_number": 447000000547
}
Error Response
{
"error": {
"code": 33,
"msg": "Invalid number"
}
}
There are no optional
properties for this API, only required
Allows to remove a contact from the Blacklist by using unique ID.
/blacklist/id
Example Code
cURL
curl -X DELETE https://api.voodoosms.com/blacklist/467787 \
-H "Authorization: Bearer {key}"
PHP
<?php
$api_key = 'API KEY';
$ch = curl_init('https://api.voodoosms.com/blacklist/467787');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: ' . $api_key
]);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
Response
{
"status": "SUCCESS",
"message": "Number has been removed from the Blacklist"
}
Code | Message | Meaning |
---|---|---|
23 | Invalid ID | The ID does not belong to a contact in your Blacklist |
Error Response
{
"error": {
"code": 23,
"msg": "Invalid ID"
}
}