Appearance
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
Header | Value |
---|---|
Content-Type | application/json |
Request Body
Field | Type | Required | Description |
---|---|---|---|
api_key | string | Yes | The API key for the authorized user |
phone_number_prefix | string | No | The country code prefix for the phone number (e.g. "+61" for AU or "+64" for NZ |
phone_number | string | Yes | The phone number to send the message to. It must start with + country code, if phone_number_prefix is not provided |
message | string | Yes | The message content |
Response
Success Response
Code: 200 OK
Body:
json
{
"message_id": "<string>"
}
{
"message_id": "<string>"
}
Field | Type | Description |
---|---|---|
message_id | string | The 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 themessage
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:
Parameter | Type | Required | Description |
---|---|---|---|
messageId | int | Yes | The ID of the SMS message. |
api_key | string | No | The API key for authorization. |
JSON Response:
Status: 200 OK
Field | Type | Description |
---|---|---|
message_id | int | The ID of the SMS message. |
status | int | The status code of the SMS message. |
status_message | string | The status message of the SMS message. |
Status Codes:
Code | Code Message |
---|---|
0 | In Queue |
1 | Sending |
2 | Sent |
3 | Delivered |
4 | Received |
5 | Failed |