Download OpenAPI specification:
General description
Using the MessageWhiz API, you can send individual SMS messages or larger scale messaging broadcasts.
This document will guide you through the core endpoints and functionality of the MessageWhiz API, so you can quickly and efficiently start your messaging.
Getting Started
In this section, we describe all the necessary steps to send your first broadcast via the MW API.
To start, MessageWhiz uses integration API keys to allow access to the API. You can generate them for each Team in your organization and distribute these keys to your team members. If you don’t need APIs for specific teams, you can just generate for the default team.
To properly access the MessageWhiz platform, the API key needs to be included in the header for all API requests to the server.
You must replace apikey with your actual integration API key.
Generic Replaceable
The following variables should be replaced with your actual information in requests:
<apikey>
: Personal API key<url>
: URL from which API is accessed - https://sms.messagewhiz.com/Send SMS
required | string or number This parameter allows you to set a specific Sender name to be used on a single message sent to the end user. |
required | string or object The list of recipients who will get the message. Could contain the list of metadata which will be used in the text. |
text required | string non-empty The text of the SMS message. |
client_ref | string Optional context value that will be sent back with any response / update related to this request. |
callback | string Optional callback URL that will be called once the status of the delivery changes |
api_key | string API key (alternative to apikey in header) |
{- "from": "MessageWhiz",
- "to": "1234567890",
- "text": "Hello, World!",
- "client_ref": "123456",
}
{- "message_id": "string"
}
{ }
Get SMS status by ID
id required | string ID of the SMS which should be specified to receive details about sent sms |
GET /sms/{id} HTTP/1.1 Host: sms.messagewhiz.com apikey: <apikey>
{- "message_id": "string",
- "from": "string",
- "to": "string",
- "text": "string",
- "status": "string",
- "client_ref": "string",
- "sent_at": "2019-08-24T14:15:22Z",
- "delivered_at": "2019-08-24T14:15:22Z",
- "pdu_count": 0
}
OTP (One-Time Password) feature provides a robust and flexible authentication solution for enhancing the security of user transactions and access control. This feature allows organizations to either generate an OTP using our secure API or use their own OTP code. To send a message with a verification code, the organization should specify the messaging channel and add any additional details relevant to the message.
We have two options:
Client Authentication service: generated and verified code on our side is sent via SMS channel
Verification code generated by the organization is sent on the MMDSmart predefined template, on a predetermined messaging channel chosen by the organization.
NOTE :
If a verification code is not specified by the organization, it will be generated and verified by our endpoints. If the organization generates its own codes and independently validates the received codes with its own systems, the generation and validation processes are not covered by this API.
Please specify use case AUTH.
Authorization is required and must be passed by API key. API key needs to be specified in the request body.
All requests submitted for the OTP API:
Send OTP
from required | string This parameter allows you to set a specific Sender name to be used on an OTP message sent to the end user. |
to required | string The end user's phone number to which you want to send a message, as a string of digits without spaces or special characters, beginning with the country dialing code. |
use_case | string Use case of the OTP (for template choosing). AUTH is used by default |
language | string Language of the OTP message template. English (en) is the default language. Russian (ru) is also available |
channel | string Enum: "sms" "voice" Channel that is set for sending OTP. |
verify_code | integer [ 1 .. 999999999 ] The verification code from the client’s side used for the code challenge. Could be specified from the client’s side or generated by Message Whiz. |
client_ref | string Optional context value that will be sent back with any response / update related to this request. |
callback | string Optional callback URL that will be called once the status of the OTP delivery changes |
code_length | integer [ 3 .. 10 ] The length of the OTP code. This is an optional parameter with a default value of 6. |
lifetime | integer [ 1 .. 1440 ] The lifetime of the OTP code in minutes. This is an optional parameter with a default value of 1440. |
verification_attempts | integer [ 1 .. 100 ] The number of failed attempts allowed before the OTP code expires. This is an optional parameter with a default value of 100. |
api_key | string API key (alternative to apikey in header) |
{- "from": "MessageWhiz",
- "to": "1234567890",
- "use_case": "AUTH",
- "language": "en",
- "verify_code": "123456",
- "client_ref": "123456",
}
{- "message_id": "string",
- "client_ref": "string"
}
{- "message_id": "1234567890",
- "sender": "MMDSmart",
- "recipient": "1234567890",
- "content": "lang: en , use_case: AUTH, code [generated]",
- "client_ref": "1234567890",
- "state": 1,
- "status": "ENROUTE",
- "timestamp": "2022-01-01T00:00:00Z",
- "otp_vendor": "sms"
}
Get OTP status by ID
message_id required | string Message ID of the OTP message |
GET /otp/status/{id} HTTP/1.1 Host: sms.messagewhiz.com apikey: <apikey>
{- "message_id": "1234567890",
- "from": "MMDSmart",
- "to": "1234567890",
- "client_ref": "1234567890",
- "state": 1,
- "status": "ENROUTE",
- "timestamp": "2022-01-01T00:00:00Z",
- "channel": "sms"
}
Verify OTP Code
message_id required | string The message ID of the OTP message |
verify_code required | string The OTP code that was entered by the user |
{- "message_id": "123-123-123-123",
- "verify_code": "123456"
}
{- "client_ref": "client:1234567890|id:0978,ref:123",
- "message_id": "string",
- "verified": true
}
Send sms broadcast messages
required | string or number This parameter allows you to set a specific Sender name to be used for the end user. |
required | Array of strings or objects The list of recipients who will get the message. Could contain the list of metadata which will be used in the text. |
text required | string Message to send. As placeholders for the recipient's metadata, you can use
|
{- "from": "MySender",
- "to": [
- "string"
], - "text": "string"
}
{- "success": true,
- "broadcast_id": "jEr5Hv_eFjnYuDa6"
}
Get status of SMS broadcasts messages
id required | string ID of the broadcast |
GET /sms/broadcast/{id} HTTP/1.1 Host: sms.messagewhiz.com apikey: <apikey>
{- "broadcast_id": "string",
- "broadcast_status": "string",
- "sent_at": "2019-08-24T14:15:22Z",
- "text": "string",
- "sent_count": 0,
- "delivered_count": 0,
- "undelivered_count": 0,
- "expired_count": 0,
- "failed_count": 0,
- "click_count": 0,
- "cost": 0
}
Allows you to get the detailed delivery report of sent broadcast
id required | string ID of the broadcast |
start | integer start index |
limit | integer limit |
GET /sms/broadcast/{id}/messages?start=0&limit=100 HTTP/1.1 Host: sms.messagewhiz.com apikey: <apikey>
[- {
- "to": "string",
- "status": "string",
- "sent_at": "2019-08-24T14:15:22Z",
- "delivered_at": "2019-08-24T14:15:22Z",
- "cost": 0
}
]
Send a Message
Send a Message.
client_ref | string Client reference of up to 100 characters. The reference will be present in every message status. |
webhook_url | string The URL of callback to which DLR statuses per single message will be sent |
message_type required | string Value: "text" The type of message to be sent. You must provide |
text required | string Text size limit: 599 characters for Latin characters and digits, and 299 characters for other characters like Cyrillic, Arabic, and Chinese. |
to required | string [ 7 .. 15 ] characters The phone number of the message recipient in the E.164 format. Start with the country code followed by the recipient number (for example, 447700900000) without a “+” sign or “00” before the country code. |
from required | string <uuid> Channel ID |
channel required | string Value: "sms" The channel on which the message will be sent. You must provide |
{- "message_type": "text",
- "text": "Hey! this is my awesome message!",
- "to": "447700900000",
- "from": "b38c2869-af85-4a00-8552-51b53667fa11",
- "channel": "sms"
}
{- "message_uuid": "b38c2869-af85-4a00-8552-51b53667fa11"
}
{- "message_uuid": "b38c2869-af85-4a00-8552-51b53667fa11",
- "to": "447700900000",
- "from": "b38c2869-af85-4a00-8552-51b53667fa11",
- "status": "delivered",
- "timestamp": "2020-01-01T14:00:00.000Z",
- "error": {
- "type": 1000,
- "title": 1000,
- "detail": "Throttled - You have exceeded the submission capacity allowed on this account. Please wait and retry",
- "instance": "mmd-12345-76543"
}, - "client_ref": "string",
- "channel": "sms"
}
Webhook for an inbound message from a customer to you.
inboundMessageUrl required | string Webhook url. |
channelID required | string The Channel ID used as the sender's phone number |
{- "channelID": "d2130c95-f8b9-4ab0-8719-36d74af30185"
}
{- "status": 200,
- "message": "Request is successful"
}
Create customer. If the customer creation is successful, you will receive a response status of 200.
phone required | string [ 3 .. 15 ] characters ^[0-9]+$ The phone number of the customer |
name | string <= 32 characters The name of the customer |
{- "phone": "145044111206"
}
{- "id": "76fdcf10-2352-4da1-ab84-4b1f7ddf8cbd",
- "chatbot_enabled": {
- "03dbaafc-a2fe-4aca-9658-dc23dffbfc18": "ENABLED_AUTO"
}, - "phone": "145044111206",
- "name": "John Smith",
- "country": "US",
- "subscriptions": { },
- "created": "2024-04-16T10:51:28.924Z",
- "modified": "2024-04-26T13:33:44.677Z",
- "chatbot_notification_received": { }
}
Get a list of customers with customer data.
offset | number Sets the first position to return from the results of the request. Default - 0 |
limit | number The number of entities to return in result. Default - 50 |
sort | string The field by which entities in the result are sorted. Default - created |
order | string Enum: "ascending" "descending" Direction in which the entities will be sorted - ascending or descending. Default - descending |
search | string The field by which entities in result are searched |
name | string Could be used to filter customers by name field |
phone | string Could be used to filter customers by phone field |
[- {
- "id": "76fdcf10-2352-4da1-ab84-4b1f7ddf8cbd",
- "chatbot_enabled": {
- "03dbaafc-a2fe-4aca-9658-dc23dffbfc18": "ENABLED_AUTO"
}, - "phone": "145044111206",
- "name": "John Smith",
- "country": "US",
- "subscriptions": {
- "56a342e6-fa7b-4959-be4c-d78cecfcd885": "ACTIVE"
}, - "created": "2024-04-16T10:51:28.924Z",
- "modified": "2024-04-26T13:33:44.677Z",
- "last_message_time": "2024-04-27T13:33:44.677Z",
- "telegram_chat_id": "364870593",
- "chatbot_notification_received": { }
}
]
Retrieve customer data by providing either the customer ID or the customer phone number.
customer_id required | string Customer ID or customer phone |
{- "id": "76fdcf10-2352-4da1-ab84-4b1f7ddf8cbd",
- "chatbot_enabled": {
- "03dbaafc-a2fe-4aca-9658-dc23dffbfc18": "ENABLED_AUTO"
}, - "phone": "145044111206",
- "name": "John Smith",
- "country": "US",
- "subscriptions": {
- "56a342e6-fa7b-4959-be4c-d78cecfcd885": "ACTIVE"
}, - "created": "2024-04-16T10:51:28.924Z",
- "modified": "2024-04-26T13:33:44.677Z",
- "last_message_time": "2024-04-27T13:33:44.677Z",
- "telegram_chat_id": "364870593",
- "chatbot_notification_received": { }
}
Update customer. If the customer update is successful, you will receive a response status of 204.
customer_id required | string Customer ID |
object Whether chatbot is enabled for conversations with current customer | |
name | string <= 32 characters The name of the customer |
{- "name": "CustomerName"
}
{- "title": "Bad Request",
- "detail": "invalid payload",
- "instance_id": ""
}
Delete customer. If the customer deletion is successful, you will receive a response status of 204.
customer_id required | string Customer ID |
{- "title": "Bad Request",
- "detail": "invalid payload",
- "instance_id": ""
}