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.


GET/api/msisdn_blocks

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

GET
/api/msisdn_blocks
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"
    }
]


POST/api/msisdn_blocks

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

POST
/api/short_messages
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"
}

GET/api/msisdn_blocks/:id

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

GET
/api/msisdn_blocks/:id
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/api/msisdn_blocks/:id

Delete a block

This endpoint allows you to delete a block by providing its ID, to allow sending to this number once more.

Request

DELETE
/api/msisdn_blocks/:id
curl -X DELETE https://api.onesend.de/api/msisdn_blocks/3fa85f64-5717-4562-b3fc-2c963f66afa6 \
-H "Authorization: ProjectKey {token}"

Was this page helpful?