SMS Functionality

Documentation

Customer Portal vs. API

General Information

The 1NCE Lifetime Fee includes 250 SMS. The SMS can be sent both as so-called Mobile Terminated (MT) or Mobile Originated (MO) SMS. SMS messages sent from one terminal device to another terminal device are not supported. This is also set out in the following illustrations:

 

However, text messages are relevant for wake-up messages from the IoT application (application-oriented SMS) to the endpoint (mobile terminated). Therefore, sending and receiving text messages between SIM card devices and server is supported.

Unused SMS messages expire at the end of the Activation Period, unless the Activation Period has been extended.

 

Customer Portal

Overview

The Customer Portal offers an overview of all ordered SIM Cards in two ways: A general overview of all cards being used via the Dashboard and a dedicated view per SIM card. The Dashboard view displays and allows for:

 

  • The number of SIM Cards with sufficient SMS volume,
  • The number of SIM Cards with a SMS volume below 20%
  • All SIM Cards with no SMS volume left
  • Within the display of low or no SMS volume the customer can directly top up the volume with a new package of 250 SMS.
  • The all over SMS usage of the last six month

 

The “My SIMs” view gives a detailed overview of all SIM Cards. This overview can also be entered with the displayed SIM Cards already filtered according to the volume used by hitting one of the “VIEW”-buttons on the Dashboard.

For each SIM Card, details of activation status, IMSI, ICCID and MSISDN number as well as label and data consumption status can be seen.

 

 

Administration

By clicking on one of the shown SIM cards a detailed view opens with information of

  • ICCID / IMSI / MSISDN / Name of the SIM Card (editable)
  • Lifetime / Time passed / Time left / End date
  • IP-Address / IMEI / Session status / Location / Network

An event list of the SIM Card is shown as well as a chronological view on the events of that specific SIM Card.

From an administrative perpective you can deactivate/activate every single SIM Card. For the purpose of checking the functionality of your SIM Card you can rest the connection to force your device to redial in to the mobile network.

 

 

Sending SMS

On the “SMS” view of this administration option you can send a SMS (MT) directly out from the 1NCE Customer Portal to the application device. You also have a detailed overview of all SMS sent from a specific SIM Card directly underneath this function.

 

 

Forwarding

When clicking on the “Configuration” tab in the 1NCE Customer Portal the function SMS Forwarding Configuration can be found. The SMS Forwarding function allows for sending MO SMS. Therefore, the user needs to insert the URL of the server which shall receive the SMS.

 

E.g.:

https://myserver.de/sms

or

https://<public_ip>:5000/smsapp

 

Note: The above-mentioned URL, IP, port, and path are just examples and depend on your own setup.

 

Monthly SMS Limits

For better control of the SMS volume usage you can set a limit of 10 SMS per month. This limit can be activated and deactivated at any time on the “Configuration” tab in the Customer Portal and will be applied to all SIM Cards.

 

 

Top Up

In case you are in the need of additional SMS volume the 1NCE Customer Portal allows to easily recharge the volume of included SMS for every single SIM Card. This can be done either directly from the Dashboard for all SIM Cards with low volume or via the “My SIMs” tab.

 

 

API

Customized API usage

Using the Application Programming Interface (hereinafter referred to as “API”) SIM Cards can also be administered directly via web services. The 1NCE API allows users to automatically receive information about the customer’s SIM Cards without using the Customer Portal since it enables the integration of all relevant SMS functions into the customer’s own software environment.

You can get started with the 1NCE API with the following GUI.

https://api.1nce.com

First you have to „Authorize“ by entering the credentials from the 1NCE Customer Portal (as an “Owner” these are e-mail address and password).

 

 

Afterwards, you can try the different SMS requests our API offers:

/sims Manage your SIMs

GET/v1/sims/{iccid}/sms

Get the list of SMS sent and received by a dedicated SIM Card

 

With executing this request, you get a response with a list of all sent and received SMS of this SIM Card

 

POST/v1/sims/{iccid}/sms

Submit SMS to specified SIM Card with a message you require

Currently only the “Payload” is a required field and needs to be filled.

All other parameters are not required and should not be needed for sending a basic SMS. In case you want to use the full flexibility, you are able to change the Data Coding Schema and User Data Header encoded as hex-String. The source_address_type type can be used to Specify the type of source address like national or international.

With executing you send the SMS to your device carrying the dedicated SIM Card. The response incudes the CURL, the request URL as well as the code of the response header.

 

GET/v1/sims/{iccid}/sms/{id}

Get details about specific SMS like status, message, time of delivery, etc.

With executing the request, you get the detailed response with all details of this SMS

 

DELETE/v1/sims/{iccid}/sms/{id}

Cancel SMS that is buffered for Chip Card and not yet delivered

With executing you will delete a SMS which is buffered and not delivered yet with a detailed response code

 

Authentication

The usage of 1NCE REST API via the customer’s external system demands for an authentication first. Therefore, the authentication via OAuth2 with the same credentials being used as for the 1NCE Customer Portal (e-mail address and password) is required. As an “API User” the authentication method with client_id and client_secret is required.

The OAuth2 authentication is necessary to get a token with credentials of the 1NCE Customer Portal with the following workflow:

  • Send your credentials base64 encoded to the authentication server.
  • Get a response including an UUID for authentication.
  • Use the UUID to authenticate REST requests.

The UUID for authentication has a validity period of 240 minutes.

Send the authentication request via POST to

“`

https://api.1nce.com/management-api/oauth/token

“`

1. Request

**Header**

“`json

{

‘Content-Type’: ‘application/x-www-form-urlencoded’,

‘authorization’: ‘Basic <base64 encoded username:password>’

}

“`

**Body**

“`json

{

‘grant_type’: ‘client_credentials’

}

“`

2. Response

“`json

{

“access_token”:”6ba7b810-9dad-11d1-80b4-00c04fd43XXX”, // this is the

UUID token you want to use for authentication

“token_type”:”bearer”,

“expires_in”:3599,

“scope”:”all”,

“appToken”:”<application_token>”, // not relevant in this context

“userId”:<id>,

“orgId”:4321 // example

}

“`

Once you are authenticated you can send requests and evaluate the responses.

Snding SMS from an external environment using API

SMS from application to SIM (aka MT SMS)

To send a SMS out of your environment using the API, create a SMS in JSON format including a possible source address (ICCID of your SIM Card) and the message text itself.

Send the SMS via POST to the 1NCE API with the ICCID of the destination device as a parameter

“`

https://api.1nce.com/management-api/v1/sims/<destination ICCID>/sms

“`

Use the authentication UUID to authenticate the application.

1. Request

**Header**

“`json

{

‘Content-Type’: ‘application/json’,

‘authorization’: ‘Bearer 6ba7b810-9dad-11d1-80b4-00c04fd43XXX’, // example; the UUID token gotten from authorization via OAuth2

‘accept’: ‘application/json’

}

“`

**Body**

“`json

{

“payload”: “message text”,

“source_address”: “882285100000xxx” // your ICCID

}

“`

If successful, the server responds with “201 CREATED”.

2. Delivery report

The SMS gateway server sends an unsolicited delivery report message after forwarding the SMS to the device.

Provide a REST interface in your application enabling PATCH requests.

**Request**

“`json

{

‘status’: {

‘status’: ‘DELIVERED’,

‘id’: ‘4’

},

‘endpoint’: {

‘id’: ‘8765432’,

‘name’: ‘8988280666000000xxx’

},

‘submit_date’: ‘2018-08-17 16:46:48’,

‘organisation’: {

‘id’: ‘4321’

},

‘final_date’: ‘2018-08-17 16:46:52’,

‘id’: ‘6206’

}

“`

Sending SMS from SIM to application (aka MO SMS)

MO SMS can be forwarded by an SMS gateway via HTTP to the customer’s application server. SMS to another mobile device is not supported.

Client (Sender)

Write a script to send SMS with a device (e.g. Quectel BG96) employing the SIM Card.

The SMSC address is 882 285 00001 6868.

You can find it also in the 1NCE Customer Portal (Configuration -> Network settings) but it is also written on the SIM Card and can be read by an AT-command.

The number to send (destination address) is not relevant since the SMS is forwarded to an

application. You can choose e.g. 12345 as the b-party address, but other numbers are also

allowed.

Server

Provide a REST interface in your application enabling POST requests.

The SMS is forwarded as a JSON via POST

**Headers**

“`

Content-Type: application/json

“`

**Body**

“`json

{

‘multi_part_info’: {

‘partno’: 1,

‘total’: 1,

‘identifier’: ‘6202’

},

‘payload’: ‘message text’,

‘submit_date’: ‘2018-08-17 16:31:51’, // GMT+0

‘dest_address’: ‘12345’, // example

‘organisation’: {

‘id’: ‘4567’

},

‘pid’: ‘0’,

‘id’: ‘6202’,

‘endpoint’: {

‘id’: ‘8765432’,

‘name’: ‘8988280666000000xxx’ // from the sending SIM

},

‘source_address’: ‘882285100000xxx’, // from the sending SIM

‘dcs’: ‘0’

}

“`

With the dcs (data coding scheme) parameters you can change the encoding of the SMS. The value ‘0’ represents the default GSM 7 bit encoding, the value ‘4’ enables an 8 bit data encoding.

The forwarding server expects a 2xx response after a successful forwarding. Otherwise the SMS will be buffered and re-transmitted.