• Simple Message Notification

smn
  1. Help Center
  2. Simple Message Notification
  3. API Reference
  4. APIs
  5. SMS Message Operations
  6. Sending a Transactional SMS Message to a Phone Number

Sending a Transactional SMS Message to a Phone Number

Description

  • API name

    SmsPublish

  • Function

    Send a transactional SMS message to a specified phone number, usually used for verification code or notification.

URI

  • URI format

    POST /v2/{project_id}/notifications/sms

  • Parameter description

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Project ID

Request

  • Parameter description

    Parameter

    Mandatory

    Type

    Description

    endpoint

    Yes

    String

    Phone number

    The phone number must be preceded by a plus sign (+) and a country code.

    message

    Yes

    String

    SMS message content

    If the content exceeds 256 bytes, the system will divide it into multiple messages, each containing 256 bytes at most and send only the first two.

  • Request example
    POST /v2/{project_id}/notifications/sms
    { 
       "endpoint": "+00111****1990", 
       "message": "SMS message test"
    }

Response

  • Parameter description

    Parameter

    Type

    Description

    request_id

    String

    Request ID, which is unique

    message_id

    String

    Message ID, which is unique

  • Response example
    { 
       "message_id": "bf94b63a5dfb475994d3ac34664e24f2", 
       "request_id": "9974c07f6d554a6d827956acbeb4be5f" 
    }

Returned Value

See section Returned Value.

Error Code

See section Error Code.