Перейти к основному содержимому

Send SMS API

POST /sendSms

Description

This API endpoint allows you to send an SMS message to a specified phone number. It is useful for sending notifications, alerts, or any text-based messages directly to users via SMS.

Request Body

The request utilizes GraphQL to perform the sendSms mutation.

Mutation:

mutation sendSms ($smsRequest: SmsRequest) {
sendSms (smsRequest: $smsRequest)
}

Variables:

{
"smsRequest": {
"phoneNumber": "<Recipient_Phone_Number>",
"message": "<SMS_Message_Content>"
}
}
  • phoneNumber (String): The recipient's phone number in international format (e.g., "+1234567890").
  • message (String): The content of the SMS message.

Response:

  • Success (200 OK):

    • If the SMS is successfully sent, the response will indicate the status of the SMS sending operation.
    {
    "data": {
    "sendSms": true
    }
    }
  • Error (4XX/5XX):

    • If there is an issue with sending the SMS, the response will include an appropriate error message and status code.

Note:

Ensure that the phone number is correctly formatted and that the message content adheres to any length limitations or formatting requirements imposed by the SMS service provider. This API should be used to facilitate direct communication with users via SMS.