4 ways to send SMS to your devices manually and automatically

30.09.2021
guide-image

While Short Message Service (SMS) is increasingly less relevant for consumer communication thanks to the availability of messenger services such as Facebook, Whatsapp, and Threema, it remains relevant for communication between Things. One big reason being that SMS can be sent to a device even if no data connection is possible. 

SMS can be used for:

  • Initial device configuration, e.g., setting up APN and application server
  • Triggering a reboot of the device
  • Sending data with low battery consumption 
  • Parameter changes during device operations without a data connection

 

In this post, we'll look at fourdifferent ways to send SMS to the device - manually or automatically integrated into your business workflows, using:

  1. SMS console on the EMnify Portal
  2. Automatically from your app through REST API
  3. Automatically from any app using Zapier
  4. Automatically from your app using SMPP

1. Sending SMS to the device via the Portal

Log in to the EMnify Portal and go to Connected Devices, then search for the device you want to send the SMS to and click on the SMS console icon.
You can enter the messages you want to send to the device, as well as set the sender address. By the way, you will also see in the console all SMS sent by the device.

2. Automatically sending SMS with REST API

SMS are often utilized at specific device lifecycle states, such as sending an SMS during device provisioning. You can also trigger SMS from your application using the REST API. To integrate the API, you will need to use an authentication token which you can get through:

POST https://cdn.emnify.net/api/doc/swagger.html#/Authentication/Authenticate

Body:

{
  "application_token": "YOUR_APPLICATION_TOKEN"
}

 

To then send the SMS to a specific device, use:

POST https://cdn.emnify.net/api/doc/swagger.html#/Endpoint/EndpointSmsByIdGethttps://cdn.emnify.net/api/v1/endpoint/{endpointId}/sms
Required Headers:
Content-Type: application/json
Authorization: Bearer {authentication_token}
Body:


{
    "source_address": "654321",
    "payload": "setparam 2001:em"
}

3. No-code - automatically sending SMS with Zapier

Zapier automates workflows between different applications - including EMnify.  Zapier integrates multiple applications using a trigger (i.e., when a special event happens - such as an SMS is received) and action (i.e., something is executed - such as sending an SMS).

As an example, imagine that you want to send a configuration SMS to the device when the device is registered in your SQL database or your subscription platform for the first time. First, you need to set up a trigger - let's say when there is a new row in your MySQL database or eCommerce shop.

Once you have confirmed the authentication (MySQL),  you can then set up the action which is sending an SMS with EMnify. 

Then, configure to which device the SMS will be sent and the content of the message. In this example, the content is based on the input of the new SQL row.

All set! Now, every time a new row is created in your device table in MySQL, an SMS will be sent to the device. 

4. SMPP as the interface to automatically send SMS

The Short Message Peer-2-Peer protocol is an industry-standard to integrate SMS management directly with the operator The protocol is often used by telematics platforms, network operators and SMS service providers to connect directly to the SMS gateway. In this way there is no proprietary connection is required. Read our SMPP integration guide on how it is done.

Setting up your automated SMS workflows only takes 5 minutes - get started now in the EMnify IoT portal, with the Rest-API or Zapier or SMPP.

Related Posts