Sending SMS
Send SMS and MMS messages from your Level365 numbers through the API.
You can send SMS and MMS messages through the API from any SMS-enabled number on your account, for example to send alerts from a monitoring system or appointment reminders from your scheduling software.
10DLC registration is requiredCarriers require business text messaging to US numbers to be registered through 10DLC before it's delivered. Register your brand and messaging campaign with Level365 before you start sending. See 10DLC registration for how to register.
Before you start
You need:
- An SMS-enabled number assigned to the user you'll send as. List them with
GET /domains/{domain}/users/{user}/smsnumbers. - A credential with messaging access. An API key can be limited to messaging only, which is a good choice for alerting integrations. See Requesting API Access.
Send a message
To send a message without an existing conversation, start a new message session:
curl -X POST https://api.365sip.com/ns-api/v2/domains/~/users/1001/messages \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "sms",
"from-number": "13175551234",
"destination": "13175554321",
"message": "Your appointment is confirmed for tomorrow at 10 AM."
}'| Field | Description |
|---|---|
type | sms for text, or mms for a message with media |
from-number | The SMS-enabled number to send from |
destination | The recipient's number. Use an array to send a group message to several numbers. |
message | The text of the message |
To reply within an existing conversation, send to that session with Send a Message: POST /domains/{domain}/users/{user}/messagesessions/{messagesession}/messages, with the same fields.
Send a picture (MMS)
For MMS, set type to mms and include the file, base64-encoded:
| Field | Description |
|---|---|
data | The file contents, base64-encoded |
mime-type | The file type, for example image/png or image/jpeg |
size | The file size in bytes |
{
"type": "mms",
"from-number": "13175551234",
"destination": ["13175554321"],
"message": "Here's the photo you requested.",
"data": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==",
"mime-type": "image/png",
"size": 70
}Receive messages
To have incoming messages sent to your application as they arrive, create an event subscription with the message or messagesession model.
Updated 11 days ago
