SMS Operations
You can perform the following SMS-related operations using the endpoint
API:
- List sent and received SMS:
GET /api/v1/endpoint/{endpoint_id}/sms
- Send SMS to a device:
POST /api/v1/endpoint/{endpoint_id}/sms
- Get details about a device SMS:
GET /api/v1/endpoint/{endpoint_id}/sms/{sms_id}
- Cancel a buffered SMS:
DELETE /api/v1/endpoint/{endpoint_id}/sms/{sms_id}
Example
To send SMS directly from your application to a device, make the following API call: POST cdn.emnify.net/api/v1/endpoint/{endpoint_id}/sms
The required headers are Content-Type
and Authorization
with the respective values application/json
and Bearer TOKEN
. Replace TOKEN
with your application token and make sure there’s a non-breaking space between Bearer
and the token value.
Request body for Mobile terminated (MT) SMS:
{
"source_address": 12345,
"payload": "This is the message text"
}
Successful response:
201
The source address is the sender number that appears on the receiving device. The payload is the actual text sent as an SMS.
Tip: To receive SMS on your application from the device, you need to first set up a callback URL in the Service Profile assigned to the device. For more information, see Receive MO SMS via API Callback.