Blacklists¶
Get blacklists¶
- GET /api/v2/routes/blacklists?domain=(domain_name)¶
Example request:
GET /api/v2/routes/blacklists?domain=my.webitel.com HTTP/1.1 X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0NDIwMDIxNzkzNTh9.pKXWfzXqbp8FMbOKocNaSlT1bYq4Xqzol-0kEXOY0_s X-Key: 8fd26a17-eb28-4c74-aa6f-a3794f4f466c
Example response:
HTTP/1.1 200 OK [ { "name": "my_list2" }, { "name": "my_list1" } ]
- Request Headers
X-Key and X-Access-Token – Auth Token
- Parameters
domain_name (string) – Domain name is required
- Status Codes
200 OK – No error
CURL example:
curl -XGET -H 'X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0ODQ5MDQ3MDU3NjIsImFjbCI6eyJjZHIiOlsiKiJdLCJjZHIvZmlsZXMiOlsiKiJdLCJjZHIvbWVkaWEiOlsiKiJdfX0.XnP93LWRYpgXHH3vQ7YQ4Birdq-VSx4t0m8-iPhrvO4' -H 'X-Key: 0158162b-5d7f-498a-b9bb-0dd82b90f521' "https://api.webitel.com/engine/api/v2/routes/blacklists?domain=my.webitel.com"
Get numbers by blacklist name¶
- GET /api/v2/routes/blacklists/(blacklist_name)?domain=(domain_name)¶
Example request:
GET /api/v2/routes/blacklists/my_list2?domain=my.webitel.com HTTP/1.1 X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0NDIwMDIxNzkzNTh9.pKXWfzXqbp8FMbOKocNaSlT1bYq4Xqzol-0kEXOY0_s X-Key: 8fd26a17-eb28-4c74-aa6f-a3794f4f466c
Example response:
HTTP/1.1 200 OK [ { "_id": "57fe05554a68369fc7588212", "number": "0000", "name": "my_list2", "domain": "my.webitel.com" }, { "_id": "57fe04f74a68369fc7588211", "number": "911", "name": "my_list2", "domain": "my.webitel.com" } ]
- Request Headers
X-Key and X-Access-Token – Auth Token
- Parameters
domain_name (string) – Domain name is required
blacklist_name (string) – Blacklist name is required
- Status Codes
200 OK – No error
CURL example:
curl -XGET -H 'X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0ODQ5MDQ3MDU3NjIsImFjbCI6eyJjZHIiOlsiKiJdLCJjZHIvZmlsZXMiOlsiKiJdLCJjZHIvbWVkaWEiOlsiKiJdfX0.XnP93LWRYpgXHH3vQ7YQ4Birdq-VSx4t0m8-iPhrvO4' -H 'X-Key: 0158162b-5d7f-498a-b9bb-0dd82b90f521' "https://api.webitel.com/engine/api/v2/routes/blacklists/my_list2?domain=my.webitel.com"
Add number into the blaklist¶
- POST /api/v2/routes/blacklists/(blacklist_name)?domain=(domain_name)¶
Example request:
POST /api/v2/routes/blacklists/my_list2?domain=my.webitel.com HTTP/1.1 Content-Type: application/json X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0NDIwMDIxNzkzNTh9.pKXWfzXqbp8FMbOKocNaSlT1bYq4Xqzol-0kEXOY0_s X-Key: 8fd26a17-eb28-4c74-aa6f-a3794f4f466c { "number": "123456789" }
Example response:
HTTP/1.1 200 OK { "ok": 1, "Modified": 1, "n": 1 }
- Request JSON Object
number (string) – phone number.
- Request Headers
X-Key and X-Access-Token – Auth Token
Content-Type – application/json
- Parameters
domain_name (string) – Domain name is required
blacklist_name (string) – Blacklist name is required
- Status Codes
200 OK – No error
400 Bad Request – Bad request
CURL example:
curl -XPOST -H 'X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0ODQ5MDQ3MDU3NjIsImFjbCI6eyJjZHIiOlsiKiJdLCJjZHIvZmlsZXMiOlsiKiJdLCJjZHIvbWVkaWEiOlsiKiJdfX0.XnP93LWRYpgXHH3vQ7YQ4Birdq-VSx4t0m8-iPhrvO4' -H 'X-Key: 0158162b-5d7f-498a-b9bb-0dd82b90f521' -H 'Content-Type: application/json' -d ' { "number": 123456789 } ' "https://api.webitel.com/engine/api/v2/routes/blacklists/my_list2?domain=my.webitel.com"
Get number in the blaklist¶
- GET /api/v2/routes/blacklists/(blacklist_name)/(blacklist_number)?domain=(domain_name)¶
Example request:
GET /api/v2/routes/blacklists/my_list2/911?domain=my.webitel.com HTTP/1.1 X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0NDIwMDIxNzkzNTh9.pKXWfzXqbp8FMbOKocNaSlT1bYq4Xqzol-0kEXOY0_s X-Key: 8fd26a17-eb28-4c74-aa6f-a3794f4f466c
Example response:
HTTP/1.1 200 OK [ { "_id": "57fe04f74a68369fc7588211", "number": "911", "name": "my_list2", "domain": "my.webitel.com" } ]
- Request Headers
X-Key and X-Access-Token – Auth Token
- Parameters
domain_name (string) – Domain name is required
blacklist_name (string) – Blacklist name is required
blacklist_number (string) – Number in the blacklist is required
- Status Codes
200 OK – No error
CURL example:
curl -XGET -H 'X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0ODQ5MDQ3MDU3NjIsImFjbCI6eyJjZHIiOlsiKiJdLCJjZHIvZmlsZXMiOlsiKiJdLCJjZHIvbWVkaWEiOlsiKiJdfX0.XnP93LWRYpgXHH3vQ7YQ4Birdq-VSx4t0m8-iPhrvO4' -H 'X-Key: 0158162b-5d7f-498a-b9bb-0dd82b90f521' "https://api.webitel.com/engine/api/v2/routes/blacklists/my_list2/911?domain=my.webitel.com"
Delete number from the blaklist¶
- DELETE /api/v2/routes/blacklists/(blacklist_name)/(blacklist_number)?domain=(domain_name)¶
Example request:
DELETE /api/v2/routes/blacklists/my_list2/911?domain=my.webitel.com HTTP/1.1 X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0NDIwMDIxNzkzNTh9.pKXWfzXqbp8FMbOKocNaSlT1bYq4Xqzol-0kEXOY0_s X-Key: 8fd26a17-eb28-4c74-aa6f-a3794f4f466c
Example response:
HTTP/1.1 200 OK { "ok": 1, "n": 1 }
- Request Headers
X-Key and X-Access-Token – Auth Token
- Parameters
domain_name (string) – Domain name is required
blacklist_name (string) – Blacklist name is required
blacklist_number (string) – Number in the blacklist is required
- Status Codes
200 OK – No error
400 Bad Request – Bad request
CURL example:
curl -XDELETE -H 'X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0ODQ5MDQ3MDU3NjIsImFjbCI6eyJjZHIiOlsiKiJdLCJjZHIvZmlsZXMiOlsiKiJdLCJjZHIvbWVkaWEiOlsiKiJdfX0.XnP93LWRYpgXHH3vQ7YQ4Birdq-VSx4t0m8-iPhrvO4' -H 'X-Key: 0158162b-5d7f-498a-b9bb-0dd82b90f521' "https://api.webitel.com/engine/api/v2/routes/blacklists/my_list2/911?domain=my.webitel.com"
Delete blaklist¶
- DELETE /api/v2/routes/blacklists/(blacklist_name)?domain=(domain_name)¶
Example request:
DELETE /api/v2/routes/blacklists/my_list2?domain=my.webitel.com HTTP/1.1 X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0NDIwMDIxNzkzNTh9.pKXWfzXqbp8FMbOKocNaSlT1bYq4Xqzol-0kEXOY0_s X-Key: 8fd26a17-eb28-4c74-aa6f-a3794f4f466c
Example response:
HTTP/1.1 200 OK { "ok": 1, "n": 1 }
- Request Headers
X-Key and X-Access-Token – Auth Token
- Parameters
domain_name (string) – Domain name is required
blacklist_name (string) – Blacklist name is required
- Status Codes
200 OK – No error
400 Bad Request – Bad request
CURL example:
curl -XDELETE -H 'X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0ODQ5MDQ3MDU3NjIsImFjbCI6eyJjZHIiOlsiKiJdLCJjZHIvZmlsZXMiOlsiKiJdLCJjZHIvbWVkaWEiOlsiKiJdfX0.XnP93LWRYpgXHH3vQ7YQ4Birdq-VSx4t0m8-iPhrvO4' -H 'X-Key: 0158162b-5d7f-498a-b9bb-0dd82b90f521' "https://api.webitel.com/engine/api/v2/routes/blacklists/my_list2?domain=my.webitel.com"