LogoLogo
ProductsDevelopersAPI ReferenceContact Us
API Reference
API Reference
  • Overview
  • Products
    • Super SIM
      • Sim Resource
        • Sim BillingPeriod subresource
      • ESimProfile Resource
      • Fleet Resource
      • NetworkAccessProfile Resource
        • NetworkAccessProfile Network Subresource
      • Network Resource
      • SettingsUpdates Resource
      • Usage Record Resource
      • SMSCommand Resource
      • IPCommand Resource
    • Programmable Wireless
      • Account UsageRecord Resource
      • Command Resource
      • DataSession Resource
      • RatePlan Resource
      • Wireless Sim Resource
      • Sim UsageRecord Resource
  • Global Resources
    • API Clients
      • Ping
      • Clients
    • Identity and Access Management
      • Account
    • Webhook
On this page

Was this helpful?

  1. Products
  2. Super SIM

SMSCommand Resource

Exchange machine-to-machine (M2M) messages via SMS

PreviousUsage Record ResourceNextIPCommand Resource

Last updated 1 month ago

Was this helpful?

To avoid ambiguity throughout this page, Sim (initial cap) refers to the Sim API resource. SIM (all caps) refers to the physical Subscriber Identity Module (that is, a SIM card) represented by a Sim resource.

SMS Commands enable you to exchange machine-to-machine (M2M) messages with devices over SMS. In order to use SMS Commands, devices must be capable of receiving and sending SMS messages. The SIM does not require an addressable phone number to send or receive a SMS Command. SMS Commands have a maximum length of 160 single-byte characters.

If you'd like to try SMS Commands out straight away, check out our guide. Or read on for the full API documentation.

SMS Commands to SIM (Mobile Terminated)

SMS Commands sent to your device, also known as Mobile Terminated (MT) SMS Commands, are initiated by making a POST request to the SMS Commands API endpoint:

https://supersim.api.korewireless.com/v1/SmsCommands

The SMS will be sent to your SIM asynchronously. When the SMS Command API is invoked to send an SMS Command to your device, a SMS Command resource will be created with status queued. Learn more about the SMS Command states in the below.

The SMS received by your device will always come from the number 000. There is no publicly addressable phone number for your Super SIM meaning that you cannot send an SMS to it from another device. The only way to reach it via SMS is by using the SMS Commands API.

The SMS Commands API will continue to attempt to send an SMS to your Super SIM-connected device for up to 24 hours. This is to account for cases where your device has not yet come online when your request to send an SMS Command was submitted. The status of the SMS Command resource will remain as queued until the first attempt to send it, after which its status will become sent. The command's status will change to delivered once there its delivery has been confirmed. If there is no delivery confirmation within the 24-hour period, the status will stay sent.

You can receive status change notifications by providing a callback URL and method in your POST request. You will receive an HTTP request to that callback URL each time the command's status changes.


SMS Commands from SIM (Mobile Originated)

All SMS sent from your device to 000 will be treated as SMS Commands. The status for all Mobile Originated (MO) SMS Commands will always be received.

You can be automatically notified when an SMS is received from your Super SIM connected device by configuring the sms_commands_url and sms_commands_method properties of the to which the Sim resource has been assigned. When your Super SIM-connected device sends an SMS message to the reserved number 000, an SMS Command resource will be created and your Fleet resource's sms_commands_url will be sent a notification. The request made to your URL will include the same parameters as the .

Currently all SMS, regardless of the number to which they were sent, are treated as SMS Commands, not just those sent to 000. This may change in the future. To ensure that there is no interruption to your services if this changes, all SMS you wish to be treated as Commands should be sent to 000.


Asynchronous resource



Create an SmsCommand Resource


Fetch an SmsCommand Resource


Read multiple SmsCommand Resources


Status Values

When the API is used to send an SMS to your device, the SMS Command resource status will be set to the statues queued. The Status property will be updated to sent when an SMS is sent from KORE to the cellular network to which your device is connected (the 'visited' network). If a delivery receipt (DLR) is received from your device, the status will be updated to delivered. If at any point this process fails and the Command is no longer deliverable, the status will be updated to failed and an error code will be indicated on the resource.

queued

The SMS Command is queued in our network waiting to be sent.

sent

The SMS Command has been sent to the SIM.

delivered

The SMS Command has been delivered to the SIM and there was a delivery confirmation from the device.

received

The SMS Command has been received from the SIM.

failed

The SMS Command could not be sent.

SMS Command resource status callbacks

You can provide a callback method and callback URL to receive updates each time a SMS Command to your device's status changes. The request should look similar to the following using curl:

curl -L -X POST "https://supersim.api.korewireless.com/v1/SmsCommands" \
--header "Authorization: Bearer <YOUR_AUTH_TOKEN>" \
--data-urlencode "Payload={\"enable\":\"True\", \"reset\":\"False\",\"when\":\"Immediate\"}" \
--data-urlencode "Sim=HSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
--data-urlencode "CallbackUrl=<YOUR_CALLBACK_URL>" \
--data-urlencode "CallbackMethod=GET"
{
"account_sid":"ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"sid":"HCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"payload":"{\"enable\":\"True\", \"reset\":\"False\",\"when\":\"Immediate\"}",
"sim_sid":"HSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"direction":"to_sim",
"status":"queued",
"date_created":"2024-10-24T20:12:17Z",
"date_updated":"2024-10-24T20:12:17Z",
"url":"https://supersim.api.korewireless.com/v1/SmsCommands/HCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}
Status sent
ApiVersion v1
Payload {"enable":"True", "reset":"False","when":"Immediate"}
SimUniqueName Parking-Meter-Lot-Area-001
SimSid HSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
CommandSid HCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
Direction to_sim
AccountSid ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
PayloadType text

The request sent to the callback URL contains the following properties:

AccountSid

CommandSid

The unique string that we created to identify the SMS Command resource. For example: HCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

SimSid

The receiving Super SIM's SID. For example: HSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

SimUniqueName

The receiving Super SIM's UniqueName. For example: Parking-Meter-Lot-Area-001

Payload

The body of the SMS Command message. This value can be up to 160 characters of text. Binary mode is not supported. For example: {"enable":"True", "reset":"False","When":"Immediate"}

PayloadType

text mode by default. Binary mode is not supported.

Direction

Indicates whether the Command is MT or MO. It has two possible values: to_sim or from_sim.

Status

ErrorCode

The error code (if any) associated with a failed SMS Command. Unless the status is failed, ErrorCode will not be present.

ErrorMessage

A description of the error (if any) associated with a failed SMS Command. Unless the status is failed, ErrorMessage will not be present.

Retention Period

SMS Commands are retained for 30 days from the time they are created. SMS Commands older than 30 days will no longer be readable from this resource.

The SMS Command resource performs . To receive an asynchronous notification when a SMS Command resource has finished updating, provide a callback URL, and optionally a callback method parameter, when you create the SMS Command.

The SID of the Account that the SMS Command resource belongs to. For example: ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa See:

The delivery status of the SMS Command. See:

asynchronous operations
Get Started
Fleet resource
Status section
SMS Commands Status Callback
What are SIDs and their prefixes?
Status Values
  • SMS Commands to SIM (Mobile Terminated)
  • SMS Commands from SIM (Mobile Originated)
  • Asynchronous resource
  • Create an SmsCommand Resource
  • POST/v1/SmsCommands
  • Fetch an SmsCommand Resource
  • GET/v1/SmsCommands/{Sid}
  • Read multiple SmsCommand Resources
  • GET/v1/SmsCommands
  • Status Values
  • SMS Command resource status callbacks
  • Retention Period
post

Send SMS Command to a Sim.

Authorizations
Body
SimstringRequired

The sid or unique_name of the SIM to send the SMS Command to.

PayloadstringRequired

The message body of the SMS Command.

CallbackMethodstring · enumOptional

The HTTP method we should use to call callback_url. Can be: GET or POST and the default is POST.

Possible values:
CallbackUrlstring · uriOptional

The URL we should call using the callback_method after we have sent the command.

Responses
201
Created
application/json
post
201

Created

get

Fetch SMS Command instance from your account.

Authorizations
Path parameters
Sidstring · min: 34 · max: 34Required

The SID of the SMS Command resource to fetch.

Pattern: ^HC[0-9a-fA-F]{32}$
Responses
200
OK
application/json
get
200

OK

get

Retrieve a list of SMS Commands from your account.

Authorizations
Query parameters
SimstringOptional

The SID or unique name of the Sim resource that SMS Command was sent to or from.

Example: {"value":"HSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}
Statusstring · enum | nullableOptional

The status of the SMS Command. Can be: queued, sent, delivered, received or failed. See the SMS Command Status Values for a description of each.

Example: {"value":"received"}Possible values:
Directionstring · enum | nullableOptional

The direction of the SMS Command. Can be to_sim or from_sim. The value of to_sim is synonymous with the term mobile terminated, and from_sim is synonymous with the term mobile originated.

Possible values:
PageSizeinteger · min: 1 · max: 1000Optional

How many resources to return in each list page. The default is 50, and the maximum is 1000.

PageintegerOptional

The page index. This value is simply for client state.

PageTokenstringOptional

The page token. This is provided by the API.

Responses
200
OK
application/json
get
200

OK

curl -X POST "https://supersim.api.korewireless.com/v1/SmsCommands" -H "Content-Type: application/x-www-form-urlencoded" -H "Authorization: Bearer <YOUR_AUTH_TOKEN>" --data-urlencode "Sim=<Sid>" --data-urlencode "Payload=<SMS_PAYLOAD>"
{
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "payload": "checkin: firmware update",
  "date_created": "2015-07-30T20:00:00Z",
  "date_updated": "2015-07-30T20:00:00Z",
  "sim_sid": "HSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "sid": "HCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "status": "queued",
  "direction": "to_sim",
  "url": "https://supersim.api.korewireless.com/v1/SmsCommands/HCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}
curl -L "https://supersim.api.korewireless.com/v1/SmsCommands/<SMS_COMMAND_SID>" -H "Content-Type: application/x-www-form-urlencoded" -H "Authorization: Bearer <YOUR_AUTH_TOKEN>"
{
  "sid": "HCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "payload": "content of the command",
  "sim_sid": "HSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "status": "queued",
  "direction": "to_sim",
  "date_created": "2015-07-30T20:00:00Z",
  "date_updated": "2015-07-30T20:00:00Z",
  "url": "https://supersim.api.korewireless.com/v1/SmsCommands/HCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}
curl -L "https://supersim.api.korewireless.com/v1/SmsCommands?Sim=<Sid>&Page=1&PageSize=10" -H "Content-Type: application/x-www-form-urlencoded" -H "Authorization: Bearer <YOUR_AUTH_TOKEN>"
{
  "sms_commands": [],
  "meta": {
    "first_page_url": "https://supersim.api.korewireless.com/v1/SmsCommands?Status=received&Sim=HSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0",
    "key": "sms_commands",
    "next_page_url": null,
    "page": 0,
    "page_size": 50,
    "previous_page_url": null,
    "url": "https://supersim.api.korewireless.com/v1/SmsCommands?Status=received&Sim=HSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0"
  }
}

API Authorization

Before you can make requests to this resource, you must have a valid bearer token. Review our API to learn how to generate a token. Here's a curl example on how to define your access token in a header:

curl -L "https://supersim.api.korewireless.com/v1/Sims" -H "Authorization: Bearer <YOUR_ACCESS_TOKEN>" 

The examples below do not show the required Authorization header due to a bug. We're working on fixing that. In the meantime, be sure to include that in all of your requests.

authorization guide