Blacklist
API services for managing blocked caller numbers. A block can be global (for all the Maskyoo numbers in the account) or bound to a specific Maskyoo number (a block that applies only when the caller dials that Maskyoo number).
The system automatically normalizes the format of the phone number that is sent.
get_blacklist
Return records from the blacklist. Without parameters the whole list is returned. On success code 200 is returned together with a result field that contains the records.
Endpoint: /api/?service=get_blacklist
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
caller_number | string | NO | Filter by number (matched by the number suffix). |
maskyoo | string | NO | Filter by the binding to a specific Maskyoo number. It takes effect only when caller_number is not empty. When caller_number is sent without maskyoo, both the global block and the Maskyoo-bound blocks that match that number are returned. |
format | string | NO | json / xml. |
Error code
| Code | Description |
|---|---|
2001 | No results |
add_number_to_blacklist
Add a number to the blacklist.
Endpoint: /api/?service=add_number_to_blacklist
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
caller_number | string | YES | The number to block. |
maskyoo | string | NO | When sent, the block applies only to the Maskyoo + caller combination. |
note | string | NO | A note (truncated to 149 characters). |
format | string | NO | json / xml. |
Error codes
| Code | Description |
|---|---|
2021 | caller_number is missing, or is left empty after non-numeric characters are stripped |
2022 | The number is already in the blacklist |
2023 | The insert failed |
Example – global block
curl -H "Authorization: Bearer YOUR_TOKEN_HERE" \
-X POST "https://[MASKYOO_URL]/api/?service=add_number_to_blacklist" \
-d "caller_number=972544224422" \
-d "note=Spam" \
-d "format=json"
Example – block in the context of a specific Maskyoo number
curl -H "Authorization: Bearer YOUR_TOKEN_HERE" \
-X POST "https://[MASKYOO_URL]/api/?service=add_number_to_blacklist" \
-d "caller_number=972544224422" \
-d "maskyoo=972776670000" \
-d "note=blocked at this line only" \
-d "format=json"
remove_number_from_blacklist
Remove a number from the blacklist. If it was added in combination with a Maskyoo number, the maskyoo parameter must be sent here as well.
Endpoint: /api/?service=remove_number_from_blacklist
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
caller_number | string | YES | The number to remove. |
maskyoo | string | NO | Required if the number was added in combination with a Maskyoo number. |
format | string | NO | json / xml. |
Error codes
| Code | Description |
|---|---|
2011 | caller_number is empty / not numeric |
2012 | The number was not found in the list |
2013 | The removal failed |