Addition to the Black List
API URL
URL used to send HTTP requests:
https://portal.bulkgate.com/api/1.0/black-list/add
POST /api/1.0/black-list/add HTTP/1.1
Host: portal.bulkgate.com
Content-Type: application/json
Cache-Control: no-cache
Parameters table
| PARAMETER NAME | VALUE | MANDATORY | DEFAULT VALUE |
|---|---|---|---|
| application_id | Application ID | Yes | - |
| application_token | Application token | Yes | - |
| numbers | Array of numbers to blacklist | Yes | - |
| wallet | Wallet on which to blacklist numbers | No | Default wallet |
| type | Parameters identifying if its a black-list of a number, or an opt-out | No | black-list |
| source_id | Identificator of group in blacklisted numbers | No | - |
| reason | Reason for number being blacklisted | No | - |
Example of full request:
POST /api/1.0/black-list/add HTTP/1.1
Host: portal.bulkgate.com
Content-Type: application/json
Cache-Control: no-cache
{
"application_id": "APPLICATION_ID",
"application_token": "APPLICATION_TOKEN",
"numbers": ["420123456789", "420987654321"],
"wallet": "WALLET",
"type": "black-list",
"source_id": "api-my-import",
"reason": "Because it's thursday"
}
Response to this command may be:
In case of success:
{
"data": {
"message": "contacts have been blacklisted"
}
}
In case of error:
{
"type": "invalid_wallet",
"code": 400,
"error": "Invalid wallet",
"detail": null
}
{
"type": "no_valid_numbers",
"code": 400,
"error": "No valid numbers",
"detail": null
}
{
"type": "number_already_exists",
"code": 400,
"error": "Number already exists",
"detail": null
}
{
"type": "you_must_select_wallet",
"code": 400,
"error": "You must select wallet",
"detail": null
}