Skip to content

SMS API

This API provides SMS service to authorized users with valid API key. The API allows users to send SMS messages, retrieve a list of available devices, check the status of a specific SMS message, and retrieve received SMS messages.

Base URL: https://api.webtender.host

Authentication

All API endpoints require authentication using a valid API key. The API key can be passed in the query parameter or in the request body as api_key. Unauthorized requests will result in an HTTP 401 status code with a corresponding error message.

Get your API key from the WebTender Console.

Send SMS Message

Send an SMS message using the SMS service.

Request

POST /api/sms/send

Request Headers

HeaderValue
Content-Typeapplication/json

Request Body

FieldTypeRequiredDescription
api_keystringYesThe API key for the authorized user
phone_number_prefixstringNoThe country code prefix for the phone number (e.g. "+61" for AU or "+64" for NZ
phone_numberstringYesThe phone number to send the message to. It must start with + country code, if phone_number_prefix is not provided
messagestringYesThe message content

Response

Success Response

Code: 200 OK

Body:

json
{
    "message_id": "<string>"
}
{
    "message_id": "<string>"
}
FieldTypeDescription
message_idstringThe ID of the created SMS message

Error Response

Code: 401 Unauthorized

Body:

json
{
    "error": "Invalid API Key"
}
{
    "error": "Invalid API Key"
}

Code: 403 Forbidden

Body:

json
{
    "error": "Cannot use SMS Service"
}
{
    "error": "Cannot use SMS Service"
}

Code: 422 Unprocessable Entity

Check the phone_number is a valid NZ or AU and the message provided.

Body:

json
{
    "errors": {
        "phone_number": [
            "The phone number field is required."
        ],
        "message": [
            "The message field is required."
        ]
    }
}
{
    "errors": {
        "phone_number": [
            "The phone number field is required."
        ],
        "message": [
            "The message field is required."
        ]
    }
}

Code: 500 Internal Server Error

Uh oh! This likely caused by a service outage on our end, or if your account has been blocked due to service abuse

Body:

{
    "error": "No devices available to send messages"
}
{
    "error": "No devices available to send messages"
}

Check a message's status

Get the status of an SMS message by ID.

Request

GET /sms/status/{messageId}

Request Parameters:

ParameterTypeRequiredDescription
messageIdintYesThe ID of the SMS message.
api_keystringNoThe API key for authorization.

JSON Response:

Status: 200 OK

FieldTypeDescription
message_idintThe ID of the SMS message.
statusintThe status code of the SMS message.
status_messagestringThe status message of the SMS message.

Status Codes:

CodeCode Message
0In Queue
1Sending
2Sent
3Delivered
4Received
5Failed