MSISDN Blocks
If for some reason you want to ensure that specific numbers do not receive SMS from you, you'll want to block those numbers. On this page we'll look at how to create, query and delete those blocks.
The MSISDN Blocks model
The msisdn block model contains all the about blocked phone numbers and optionally the reason why they have been blocked.
Properties
- Name
id
- Type
- string
- Description
Unique identifier for the block.
- Name
createdAt
- Type
- string
- Description
ISO 8601 formatted date of when the block was created.
- Name
msisdn
- Type
- string
- Description
The blocked number in E164 format.
- Name
reason
- Type
- string|null
- Description
The reason why this number has been blocked.
List all blocks
This endpoint allows you to retrieve a paginated list of all your blocks. By default, a maximum of 30 contacts are shown per page.
Optional attributes
- Name
page
- Type
- integer
- Description
The page you want to fetch
Request
curl -G https://api.onesend.de/api/msisdn_blocks \
-H "Authorization: ProjectKey {token}" \
-d page=1
Response
[
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"createdAt": "2024-02-20T16:15:10.994Z",
"msisdn": "string",
"reason": "string"
}
]
Create a block
This endpoint allows you to create a new block.
Required attributes
- Name
msisdn
- Type
- string
- Description
The number you want to block in E164 format.
Optional attributes
- Name
reason
- Type
- string
- Description
The reason why this number is blocked.
Request
curl https://api.onesend.de/api/msisdn_blocks \
-H "Authorization: ProjectKey {token}" \
-d '{"msisdn": "+491573123123123", "reason": "Complains too much"}'
Response
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"createdAt": "2024-02-20T15:42:00.626Z",
"msisdn":"+491573123123123",
"reason": "Complains too much"
}
Retrieve a block
This endpoint allows you to retrieve a block by providing its ID. Refer to the list at the top of this page to see which properties are included with msisdn block objects
Request
curl https://api.onesend.de/api/msisdn_blocks/3fa85f64-5717-4562-b3fc-2c963f66afa6 \
-H "Authorization: ProjectKey {token}"
Response
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"createdAt": "2024-02-20T15:42:00.626Z",
"msisdn":"+491573123123123",
"reason": "Complains too much"
}
Delete a block
This endpoint allows you to delete a block by providing its ID, to allow sending to this number once more.
Request
curl -X DELETE https://api.onesend.de/api/msisdn_blocks/3fa85f64-5717-4562-b3fc-2c963f66afa6 \
-H "Authorization: ProjectKey {token}"