FAQ & Common questions

What is the PIN of my SIM card?

Our SIM cards are provided without PIN-code

Are the SIM cards sent with logos?

Our SIM cards are sent in white label format, without any type of art-work, logo or brand.

Is it possible to have a Public Static IP?

It is possible. You must change the SIM plan in the platform with a Public Static IP plan, they are identified with “IP” at the end of the plan name. For example “500MB” is a dynamic IP plan, while “500MBIP” is a Public Static IP plan.
The Public Static IP allows you to receive all input traffic without limits on TCP/UDP ports.

What are the differences between a Public Static IP and a Dynamic IP?

Dynamic IP is more secure because the input TCP/IP ports are locked and the IP changes for each session.
Static IP instead is useful if you need to communicate with a hosted service which is using the SIM connection, for example a server, because its IP will never change.

What is the APN to configure for Pay as you use and Prepaid plans?

The APN is resiot.m2m and it is unique for all covered countries. This APN is not valid for Public Static IP plans.

What is the APN to configure for Public Static IP plans?

The APN to use only for Public Static IP plans is fixedip.m2m and it is unique for all covered countries

Advanced APN configuration with PLMN code

Some devices may need an advanced APN configuration complete with PLMN code (Public Land Mobile Network) composed by Mobile Country Code (MCC) and Mobile Network Code (MNC). Our PLMN code is 20408, while the APN is always resiot.m2m for pay-as-you-use and prepaid plans, and fixedip.m2m for static IP plans

Can I change a SIM plan?

You can change a SIM plan whenever you want without costs and at any time. If you change it to a plan which costs more, then you will pay only the difference between the two plans during the month of the change.

What is the sim.resiot.io coverage?

We connect more than 180 countries! Check coverage now!

What SIM formats are available?

  • Business Grade SIM Cards are available in 2FF, 3FF, 4FF (Mini, Micro, Nano SIM) formats
  • Industrial Grade SIM Cards available in 2FF, 3FF (Mini, Micro SIM) formats
  • ChipSIMs are available in MFF2 format

Check more about our SIM formats!

What are the sizes of the 2FF, 3FF, 4FF formats?

  • 2FF (Mini SIM) : 25mm x 15mm x 0.76mm
  • 3FF (Micro SIM) : 15mm x 12mm x 0.76mm
  • 4FF (Nano SIM) : 12,3 mm × 8,8 mm × 0,67 mm

What is a ChipSIM MFF2?

A ChipSIM is a little SIM module that can be directly soldered on the device Printed Circuit Board. This SIM format is only 5x6mm. Read more!

Do I need a sim.resiot.io card to activate one of your plans?

Yes, you need a sim.resiot.io card in order to activate one of our special IoT / M2M plan.

What are the possible states of my SIM card?

The possible SIM card states are:

ACTIVATION_READY:
This is the default state for delivered SIMs, unless otherwise agreed in the contract (such as for customers with post paid contracts). The Activation Ready state does not allow a device to establish data connections. Devices in the Activation Ready state are generally not considered billable unless a commitment applies. To be able to use your Activation Ready SIM card you need to put it in Activated state (manually from the platform or via API).

ACTIVATED:
An Activated device can establish data connections and is considered billable.

DEACTIVATED:
The Deactivated state does not allow a device to establish data connections. Devices in the Deactivated state are generally not considered billable unless a commitment applies. Typically, Deactivated devices have been deployed, but they are temporarily inactive.

RETIRED:
The Retired state does not allow a device to establish data connections. A device in this state is generally not considered billable unless a commitment applies. Typically, a Retired device is permanently inactive and ready to be moved to a purged state for removal from the network.

TEST_READY:
It can be the initial state in which the SIMs are shipped for post paid contracts, useful if you want to test the devices together with the SIMs before marketing. If you want to request this initial status upon delivery of the sim please contact us.
The Test Ready state allows a device to establish a data connection and use other services free of charge. SIMs in this state are not considered billable. By default, the Test Ready state provides each device with the following services, although the operator may configure these amounts differently:
– Data: 20KB
– SMS: 2 messages
– Voice: 2 minutes
As soon as the device reaches the configured limit for any service (data, SMS, voice, or other), the device will transition to the target state and no more free test traffic will be available for any service. Typically, the target state for SIMs exceeding their Test Ready threshold is either Activated.

How can I request technical / commercial support?

If you are already registered on our platform, open a ticket here!

If you don’t have any credentials, send us an email via our form. We will contact you as soon as possible! Contact us

SMS Send MO (from modem to platform) SMS

To send MO (mobile originated) SMS from your SIM card to the platform  you don’t need a dedicated API. Just send a standard SMS with your device/modem which your SIM card is in, to the number 5277 (which is the platform SMS number).

If the SMS was sent correctly you can find its smsMsgId with the Search SMS API and get its details (message text, date, …) with the Get SMS details API.

API List

API get user API token

Your API token is required to run most of the api available on sim.resiot.io

In order to get it, log into your sim console and press the “Get your API Token” blue button like in the image below

API get Global Stats

Allows you to get global statistics about all your SIM cards

Example

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Grpc-Metadata-Authorization: YOUR_API_TOKEN' \
-d '{"Tag": "stats", "Input": "{}"}' \
'https://console.sim.resiot.io/api/scene/runwithcallback'

Input Parameters:
– YOUR_API_TOKEN: is the token you got as explained in the first API FAQ above (“API get user API Token”)

Output Parameters:
– totalsim: the number of all your SIM cards
– activated: the number of your activated SIM cards
– activation_ready: the number of your activation ready SIM cards
– deactivated: the number of your deactivated SIM cards
– retired: the number of your retired SIM cards
– test_ready: the number of your testready SIM cards
– traffic: volume of total data usage in MB
– sms: total SMS sent and received
– voice: total voice minutes used
– availablecredit: the balance of your credit
– monthlycharge: your total monthly charge
– err: description of the error, if occurred

Success output response

{
"Output":"{\"totalsim\":10,\"activated\":8,\"activation_ready\":0,\"deactivated\":0,\"retired\":0,\"test_ready\":2,\"traffic\":\"352MB\",\"sms\":0,\"voice\":0,\"availablecredit\":\"€15.00\",\"monthlycharge\":\"€8.75\"}"
}

Complete PHP example

<?php
$api_token = "YOUR_API_TOKEN";
$service_url = 'https://console.sim.resiot.io/api/scene/runwithcallback';
$curl = curl_init($service_url);
$header = array();
$header[] = 'Accept: application/json';
$header[] = 'Grpc-Metadata-Authorization: ' . $api_token;
curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
$curl_post_data = array(
"Tag"=> "stats",
"Input"=> "{}"
);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($curl_post_data));
$curl_response = curl_exec($curl);
curl_close($curl);
echo "raw response: <br>" . $curl_response;
$APIOutputObject = json_decode($curl_response, true);
$Output_Value = json_decode($APIOutputObject["Output"], true);
if(array_key_exists("err", $Output_Value)){
echo "Error: " . $Output_Value["err"];
}else{
$totalsim = $Output_Value["totalsim"];
$activated = $Output_Value["activated"];
$activation_ready = $Output_Value["activation_ready"];
$deactivated = $Output_Value["deactivated"];
$retired = $Output_Value["retired"];
$test_ready = $Output_Value["test_ready"];
$traffic = $Output_Value["traffic"];
$sms = $Output_Value["sms"];
$voice = $Output_Value["voice"];
$availablecredit = $Output_Value["availablecredit"];
$monthlycharge = $Output_Value["monthlycharge"];
echo "<br><br><b>PARSED VALUES</b>";
echo "<br>Total SIM Cards: " . $totalsim;
echo "<br>- Activated: " . $activated;
echo "<br>- Activation Ready: " . $activation_ready;
echo "<br>- Deactivated: " . $deactivated;
echo "<br>- Retired: " . $retired;
echo "<br>- Test Ready: " . $test_ready;
echo "<br>Traffic: " . $traffic;
echo "<br>SMS: " . $sms;
echo "<br>Voice Minutes: " . $voice;
echo "<br>Available Credit: " . $availablecredit;
echo "<br>Monthly Charge: " . $monthlycharge;
}
?>

API get Devices

Allows you to get a list of SIMs of your SIM cards

Example

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Grpc-Metadata-Authorization: YOUR_API_TOKEN' \
-d '{"Tag": "getdevices", "Input": "{\"limit\":50, \"offset\":0}"}' \
'https://console.sim.resiot.io/api/scene/runwithcallback'

Input Parameters:
– YOUR_API_TOKEN: is the token you got as explained in the first API FAQ above (“API get user API Token”)
– limit: is the max number of SIMs to obtain, the max value available is 50
– offset: is the offset to apply to the SIMs list, useful when you cannot obtain all your SIMs in a single API call, default value is 0

Output Parameters:
– totalCount: the number of all your SIM cards
– devices: a list of SIMs, each SIM has an iccid and a status
– err: description of the error, if occurred

Success output response

{
"Output":"{\"totalCount\":2,\"devices\":[{\"iccid\":\"0000000000000000\", \"status\":\"ACTIVATED\"},{\"iccid\":\"0000000000000001\", \"status\":\"TEST_READY\"}]}"
}

Complete PHP example

<?php
$api_token = "YOUR_API_TOKEN";
$service_url = 'https://console.sim.resiot.io/api/scene/runwithcallback';
$curl = curl_init($service_url);
$header = array();
$header[] = 'Accept: application/json';
$header[] = 'Grpc-Metadata-Authorization: ' . $api_token;
curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
$curl_post_data = array(
"Tag"=> "getdevices",
"Input"=> "{\"limit\":50, \"offset\":0}"
);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($curl_post_data));
$curl_response = curl_exec($curl);
curl_close($curl);
echo "raw response: <br>" . $curl_response;
$APIOutputObject = json_decode($curl_response, true);
$Output_Value = json_decode($APIOutputObject["Output"], true);
if(array_key_exists("err", $Output_Value)){
echo "Error: " . $Output_Value["err"];
}else{
$totalCount = $Output_Value["totalCount"];
$devices = $Output_Value["devices"];
echo "<br><br><b>PARSED VALUES</b>";
echo "<br>Total SIM Cards: " . $totalCount;
foreach($devices as $sim){
echo "<br>ICCID: " . $sim["iccid"] . ", Status: " . $sim["status"];
}
}
?>

API get Sim details

Returns SIM card status, current data plan and data usage

Example

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Grpc-Metadata-Authorization: YOUR_API_TOKEN' \
-d '{"Tag": "get_sim_details", "Input": "{\"iccid\":\"YOUR_ICCID\"}"}' \
'https://console.sim.resiot.io/api/scene/runwithcallback'

Input Parameters:
– YOUR_API_TOKEN: is the token you got as explained in the API FAQ just above
– iccid: is the SIM card ICCID

Output Parameters:
– status: the current status of the SIM card
– plan: the current data plan of the SIM card
– datausage: the current total data usage (MB)
– err: if the action ends in error it contains the description of the error

Success output response

{
"Output":"{\"plan\":\"Pay as you use 1\",\"status\":\"ACTIVATED\",\"datausage\":\"0 MB\"}"
}

Complete PHP example

<?php
$api_token = "YOUR_API_TOKEN";
$service_url = 'https://console.sim.resiot.io/api/scene/runwithcallback';
$curl = curl_init($service_url);
$header = array();
$header[] = 'Accept: application/json';
$header[] = 'Grpc-Metadata-Authorization: ' . $api_token;
curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
$curl_post_data = array(
"Tag"=> "get_sim_details",
"Input"=> "{\"iccid\":\"YOUR_ICCID\"}"
);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($curl_post_data));
$curl_response = curl_exec($curl);
curl_close($curl);
echo "raw response: <br>" . $curl_response;
$APIOutputObject = json_decode($curl_response, true);
$Output_Value = json_decode($APIOutputObject["Output"], true);
if(array_key_exists("err", $Output_Value)){
echo "Error: " . $Output_Value["err"];
}else{
$plan = $Output_Value["plan"];
$status = $Output_Value["status"];
$datausage = $Output_Value["datausage"];
echo "<br><br><b>PARSED VALUES</b>";
echo "<br>Plan: " . $plan;
echo "<br>Status: " . $status;
echo "<br>Data Usage: " . $datausage;
}
?>

API Sim Activation/Deactivation

Allows you to activate or deactivate a SIM card

Example for ACTIVATION

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Grpc-Metadata-Authorization: YOUR_API_TOKEN' \
-d '{"Tag": "edit_sim", "Input": "{\"iccid\":\"YOUR_ICCID\", \"status\":\"activate\"}"}' \
'https://console.sim.resiot.io/api/scene/runwithcallback'

Example for DEACTIVATION

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Grpc-Metadata-Authorization: YOUR_API_TOKEN' \
-d '{ \"Tag": "edit_sim", "Input": "{\"iccid\":\"YOUR_ICCID\", \"status\":\"deactivate\"}"}' \
'https://console.sim.resiot.io/api/scene/runwithcallback'

Input Parameters:
– YOUR_API_TOKEN: is the token you got as explained in the API FAQ just above
– iccid: is the SIM card ICCID to activate/deactivate
– status: “activate” or “deactivate”

Output Parameters:
– result: indicates if the action is started correctly or if an error has occurred, possible values: “success”, “error”
– description: if the action ends in error it contains the description of the error, otherwise it indicates which action is in progress

Success output response

{
"Output":"{\"result\":\"success\",\"description\":\"SIM 0000000000000000 in activation, check the SIM status on console.sim.resiot.io\"}"
}

Complete PHP example

<?php
$api_token = "YOUR_API_TOKEN";
$service_url = 'https://console.sim.resiot.io/api/scene/runwithcallback';
$curl = curl_init($service_url);
$header = array();
$header[] = 'Accept: application/json';
$header[] = 'Grpc-Metadata-Authorization: ' . $api_token;
curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
$curl_post_data = array(
"Tag"=> "edit_sim",
"Input"=> "{\"iccid\":\"YOUR_ICCID\", \"status\":\"activate\"}"
);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($curl_post_data));
$curl_response = curl_exec($curl);
curl_close($curl);
echo "raw response: <br>" . $curl_response;
$APIOutputObject = json_decode($curl_response, true);
$Output_Value = json_decode($APIOutputObject["Output"], true);
if(array_key_exists("err", $Output_Value)){
echo "Error: " . $Output_Value["err"];
}else{
$result = $Output_Value["result"];
$description = $Output_Value["description"];
echo "<br><br><b>PARSED VALUES</b>";
echo "<br>Result: " . $result;
echo "<br>Description: " . $description;
}
?>

API change Sim data plan

Allows you to change the data plan of a SIM card

Example, set the 100MB data plan

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Grpc-Metadata-Authorization: YOUR_API_TOKEN' \
-d '{"Tag": "edit_sim", "Input": "{\"iccid\":\"YOUR_ICCID\", \"plan\":\"100MB\"}"}' \
'https://console.sim.resiot.io/api/scene/runwithcallback'

Input Parameters:
– YOUR_API_TOKEN: is the token you got as explained in the first API FAQ above (“API get user API Token”)
– iccid: is the SIM card ICCID
– plan: one of the available data plan codes (“Pay as you use 1”, “Pay as you use 2”, “10MB”, “25MB”, “50MB”, “100MB”, “150MB”, “200MB”, “250MB”, “500MB”, “1GB”, “2GB”, “3GB”, “5GB”, “10GB”, “20GB”)

Output Parameters:
– result: indicates if the action is started correctly or if an error has occurred, possible values: “success”, “error”
– description: if the action ends in error it contains the description of the error, otherwise it indicates which action is in progress

Success output response

{
"Output":"{\"result\":\"success\",\"description\":\"Changing SIM 0000000000000000 plan into 100MB, check the SIM plan on console.sim.resiot.io\"}"
}

Complete PHP example

<?php
$api_token = "YOUR_API_TOKEN";
$service_url = 'https://console.sim.resiot.io/api/scene/runwithcallback';
$curl = curl_init($service_url);
$header = array();
$header[] = 'Accept: application/json';
$header[] = 'Grpc-Metadata-Authorization: ' . $api_token;
curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
$curl_post_data = array(
"Tag"=> "edit_sim",
"Input"=> "{\"iccid\":\"YOUR_ICCID\", \"plan\":\"100MB\"}"
);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($curl_post_data));
$curl_response = curl_exec($curl);
curl_close($curl);
echo "raw response: <br>" . $curl_response;
$APIOutputObject = json_decode($curl_response, true);
$Output_Value = json_decode($APIOutputObject["Output"], true);
if(array_key_exists("err", $Output_Value)){
echo "Error: " . $Output_Value["err"];
}else{
$result = $Output_Value["result"];
$description = $Output_Value["description"];
echo "<br><br><b>PARSED VALUES</b>";
echo "<br>Result: " . $result;
echo "<br>Description: " . $description;
}
?>

API Sim Activation/Deactivation + change Sim data plan

Allows you to activate or deactivate a SIM card and simultaneously set a new data plan

Example, ACTIVATION of a SIM card and change the current plan to the 100MB data plan

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Grpc-Metadata-Authorization: YOUR_API_TOKEN' \
-d '{"Tag": "edit_sim", "Input": "{\"iccid\":\"YOUR_ICCID\", \"status\":\"activate\", \"plan\":\"100MB\"}"}' \
'https://console.sim.resiot.io/api/scene/runwithcallback'

Input Parameters:
– YOUR_API_TOKEN: is the token you got as explained in the first API FAQ above (“API get user API Token”)
– iccid: is the SIM card ICCID
– status: “activate” or “deactivate”
– plan: one of the available data plan codes (“Pay as you use 1”, “Pay as you use 2”, “10MB”, “25MB”, “50MB”, “100MB”, “150MB”, “200MB”, “250MB”, “500MB”, “1GB”, “2GB”, “3GB”, “5GB”, “10GB”, “20GB”)

Output Parameters:
– result: indicates if the action is started correctly or if an error has occurred, possible values: “success”, “error”
– description: if the action ends in error it contains the description of the error, otherwise it indicates which action is in progress

Success output response

{
"Output":"{\"result\":\"success\",\"description\":\"Changing SIM 0000000000000000 plan into 100MB, check the SIM plan on console.sim.resiot.io . SIM 0000000000000000 in activation, check the SIM status on console.sim.resiot.io\"}"
}

Complete PHP example

<?php
$api_token = "YOUR_API_TOKEN";
$service_url = 'https://console.sim.resiot.io/api/scene/runwithcallback';
$curl = curl_init($service_url);
$header = array();
$header[] = 'Accept: application/json';
$header[] = 'Grpc-Metadata-Authorization: ' . $api_token;
curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
$curl_post_data = array(
"Tag"=> "edit_sim",
"Input"=> "{\"iccid\":\"YOUR_ICCID\", \"status\":\"activate\", \"plan\":\"100MB\"}"
);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($curl_post_data));
$curl_response = curl_exec($curl);
curl_close($curl);
echo "raw response: <br>" . $curl_response;
$APIOutputObject = json_decode($curl_response, true);
$Output_Value = json_decode($APIOutputObject["Output"], true);
if(array_key_exists("err", $Output_Value)){
echo "Error: " . $Output_Value["err"];
}else{
$result = $Output_Value["result"];
$description = $Output_Value["description"];
echo "<br><br><b>PARSED VALUES</b>";
echo "<br>Result: " . $result;
echo "<br>Description: " . $description;
}
?>

SMS API send MT (from platform to modem) SMS

Allows you to send MT (mobile terminated) SMS from the platform to your SIM card identified by its ICCID

Example send SMS

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Grpc-Metadata-Authorization: YOUR_API_TOKEN' \
-d '{"Tag": "send_sms", "Input": "{\"iccid\":\"YOUR_ICCID\", \"messagetext\":\"YOUR_MESSAGE\"}"}' \
'https://console.sim.resiot.io/api/scene/runwithcallback'

Example send SMS with validity period

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Grpc-Metadata-Authorization: YOUR_API_TOKEN' \
-d '{"Tag": "send_sms", "Input": "{\"iccid\":\"YOUR_ICCID\", \"messagetext\":\"YOUR_MESSAGE\", \"tpvp\":167}"}' \
'https://console.sim.resiot.io/api/scene/runwithcallback'

Input Parameters:
– YOUR_API_TOKEN: is the token you got as explained in the first API FAQ above (“API get user API Token”)
– iccid: is the SIM card ICCID to receive the SMS
– messagetext: the text of the SMS (max length 160)
– tpvp (optional): is the maximum interval for the system to try to send the SMS to the chosen SIM. If at the end of the interval the SMS has not reached the SIM, then the SMS will be discarded. If this value is not specified, the default interval is 3 days. Possible values ​​from 0 to 255. Operation is based on the TP-VP format defined by the “GSM 03.40” standard. Example values below:

TPVP Value Validity Period Possible Validity Periods
0-143 (TP-VP + 1) x 5 minutes 5, 10, 15 minutes … 11:55, 12:00 hours
144-167 (12 + (TP-VP – 143) / 2) hours 12:30, 13:00, … 23:30, 24:00 hours
168-196 (TP-VP – 166) days 2, 3, 4, … 30 days
197-255 (TP-VP – 192) weeks 5, 6, 7, … 63 weeks

Output Parameters:
– smsMsgId: if everything is correct, it’s the ID of the message sent, it can be used from the get_sms_details API to get the details of the message
– err: description of the error, if occurred

Success output response

{
"Output":"{\"result\":\"success\",\"smsMsgId\":123}"
}

Complete PHP example

<?php
$api_token = "YOUR_API_TOKEN";
$service_url = 'https://console.sim.resiot.io/api/scene/runwithcallback';
$curl = curl_init($service_url);
$header = array();
$header[] = 'Accept: application/json';
$header[] = 'Grpc-Metadata-Authorization: ' . $api_token;
curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
$curl_post_data = array(
"Tag"=> "send_sms",
"Input"=> "{\"iccid\":\"YOUR_ICCID\", \"messagetext\":\"YOUR_MESSAGE\"}"
);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($curl_post_data));
$curl_response = curl_exec($curl);
curl_close($curl);
echo "raw response: <br>" . $curl_response;
$APIOutputObject = json_decode($curl_response, true);
$Output_Value = json_decode($APIOutputObject["Output"], true);
if(array_key_exists("err", $Output_Value)){
echo "Error: " . $Output_Value["err"];
}else{
$result = $Output_Value["result"];
$smsMsgId = $Output_Value["smsMsgId"];
echo "<br><br><b>PARSED VALUES</b>";
echo "<br>Result: " . $result;
echo "<br>SMS Message Id: " . $smsMsgId;
}
?>

SMS API search SMS

Allows you to get a SIM card messageIDs

Minimal example

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Grpc-Metadata-Authorization: YOUR_API_TOKEN' \
-d '{"Tag": "search_sms", "Input": "{\"iccid\":\"YOUR_ICCID\", \"fromdate\":\"yyyy-MM-ddTHH:mm:ssZ\"}"}' \
'https://console.sim.resiot.io/api/scene/runwithcallback'

Complete example

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Grpc-Metadata-Authorization: YOUR_API_TOKEN' \
-d '{"Tag": "search_sms", "Input": "{\"iccid\":\"YOUR_ICCID\", \"fromdate\":\"yyyy-MM-ddTHH:mm:ssZ\", \"todate\":\"yyyy-MM-ddTHH:mm:ssZ\", \"msgtype\":\"MT\"}"}' \
'https://console.sim.resiot.io/api/scene/runwithcallback'

Input Parameters:
– YOUR_API_TOKEN: is the token you got as explained in the first API FAQ above (“API get user API Token”)
– iccid: is the SIM card ICCID
– fromdate: date to start the search, format yyyy-MM-ddTHH:mm:ssZ (example 2016-04-18T17:31:34+00:00)
– todate: date to end the search, format yyyy-MM-ddTHH:mm:ssZ
– msgtype: indicates the origin of the message, possible values: “MO” (mobile-originated), “MT” (mobile-terminated)

Output Parameters:
– smsMsgIds: if everything is correct, it’s an array containing all the smsId found
– err: description of the error, if occurred

Success output response

{
"Output":"{\"result\":\"success\",\"smsMsgIds\":[123, 124, 125]}"
}

Complete PHP example

<?php
$api_token = "YOUR_API_TOKEN";
$service_url = 'https://console.sim.resiot.io/api/scene/runwithcallback';
$curl = curl_init($service_url);
$header = array();
$header[] = 'Accept: application/json';
$header[] = 'Grpc-Metadata-Authorization: ' . $api_token;
curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
$curl_post_data = array(
"Tag"=> "search_sms",
"Input"=> "{\"iccid\":\"YOUR_ICCID\", \"fromdate\":\"2021-09-20T07:35:22Z\"}"
);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($curl_post_data));
$curl_response = curl_exec($curl);
curl_close($curl);
echo "raw response: <br>" . $curl_response;
$APIOutputObject = json_decode($curl_response, true);
$Output_Value = json_decode($APIOutputObject["Output"], true);
if(array_key_exists("err", $Output_Value)){
echo "Error: " . $Output_Value["err"];
}else{
$result = $Output_Value["result"];
$smsMsgIds = $Output_Value["smsMsgIds"];
echo "<br><br><b>PARSED VALUES</b>";
echo "<br>Result: " . $totalsim;
foreach($smsMsgIds as $smsId){
echo "<br>Message Id: " . $smsId;
}
}
?>

SMS API get SMS details

Allows you to get details of a SMS by its ID

Example

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Grpc-Metadata-Authorization: YOUR_API_TOKEN' \
-d '{"Tag": "get_sms_details", "Input": "{\"iccid\":\"YOUR_ICCID\", \"smsid\":\"123\"}"}' \
'https://console.sim.resiot.io/api/scene/runwithcallback'

Input Parameters:
– YOUR_API_TOKEN: is the token you got as explained in the first API FAQ above (“API get user API Token”)
– iccid: is the SIM card ICCID
smsid: is the ID of the SMS (you can get it with the Search SMS API)

Output Parameters:
– err: description of the error, if occurred
– smsMsgId: the SMS id
– status: the SMS status
– messageText: the message of the SMS
– senderLogin: the SMS sender
– iccid: the ICCID of the sender
– sentTo: the recipient of the message
– sentFrom: the sender device
– msgType: MO (mobile-originated) or MT (mobile-terminated)
– dateSent: the date the message was sent
– dateReceived: the date the message was received by the server
– dateModified: the date when the submission status changed

Success output response

{
"Output":"{\"smsMsgId\":123,\"status\":\"Pending\",\"messageText\":\"Hello world\",\"senderLogin\":\"DemoUser\",\"iccid\":\"898***********04784\",\"sentTo\":\"8**********5421\",\"sentFrom\":\"Server\",\"msgType\":\"MT\",\"dateSent\":\"2016-07-11 16:05:16.280-0700\",\"dateModified\":\"2016-07-11 16:05:16.522-0700\"}"
}

Complete PHP example

<?php
$api_token = "YOUR_API_TOKEN";
$service_url = 'https://console.sim.resiot.io/api/scene/runwithcallback';
$curl = curl_init($service_url);
$header = array();
$header[] = 'Accept: application/json';
$header[] = 'Grpc-Metadata-Authorization: ' . $api_token;
curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
$curl_post_data = array(
"Tag"=> "get_sms_details",
"Input"=> "{\"iccid\":\"YOUR_ICCID\", \"smsid\":\"123\"}"
);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($curl_post_data));
$curl_response = curl_exec($curl);
curl_close($curl);
echo "raw response: <br>" . $curl_response;
$APIOutputObject = json_decode($curl_response, true);
$Output_Value = json_decode($APIOutputObject["Output"], true);
if(array_key_exists("err", $Output_Value)){
echo "Error: " . $Output_Value["err"];
}else{
$smsMsgId = $Output_Value["smsMsgId"];
$status = $Output_Value["status"];
$messageText = $Output_Value["messageText"];
$senderLogin = $Output_Value["senderLogin"];
$iccid = $Output_Value["iccid"];
$sentTo = $Output_Value["sentTo"];
$sentFrom = $Output_Value["sentFrom"];
$msgType = $Output_Value["msgType"];
$dateSent = $Output_Value["dateSent"];
$dateModified = $Output_Value["dateModified"];
echo "<br><br><b>PARSED VALUES</b>";
echo "<br>Message Id: " . $smsMsgId;
echo "<br>Status: " . $status;
echo "<br>Message text: " . $messageText;
echo "<br>Sender Login: " . $senderLogin;
echo "<br>ICCID: " . $iccid;
echo "<br>Sent to: " . $sentTo;
echo "<br>Sent from: " . $sentFrom;
echo "<br>Message type: " . $msgType;
echo "<br>Date sent: " . $dateSent;
echo "<br>Date modified: " . $dateModified;
}
?>

SMS API set Sim Usage Limit

Sets the SIM card Usage Limit expressed in MB. If you set this value to 0 then the SIM Usage Limit is disabled.
If in the current month this SIM uses more MB of data than the Usage Limit MB then the SIM will be disabled. It will be reactivated at the beginning of the next month.
You can manually reactivate the SIM before the next month, in this case the limit will be ignored for the rest of the month.

Example

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Grpc-Metadata-Authorization: YOUR_API_TOKEN' \
-d '{"Tag": "set_sim_usage_limit", "Input": "{\"iccid\":\"YOUR_ICCID\", \"usagelimit\":25.5}"}' \
'https://console.sim.resiot.io/api/scene/runwithcallback'

Input Parameters:
– YOUR_API_TOKEN: is the token you got as explained in the API FAQ just above
– iccid: is the SIM card ICCID
– usagelimit: the usage limit in MB. If usagelimit is 0 then the SIM Usage Limit is disabled

Output Parameters:
– result: indicates if the action is started correctly or if an error has occurred, possible values: “success”, “error”
– description: if the action ends in error it contains the description of the error, otherwise it indicates the usage limit you have set

Success output response

{
"Output":"{\"result\":\"success\",\"description\":\"Usage Limit set to 25.5MB\"}"
}

Complete PHP example

<?php
$api_token = "YOUR_API_TOKEN";
$service_url = 'https://console.sim.resiot.io/api/scene/runwithcallback';
$curl = curl_init($service_url);
$header = array();
$header[] = 'Accept: application/json';
$header[] = 'Grpc-Metadata-Authorization: ' . $api_token;
curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
$curl_post_data = array(
"Tag"=> "set_sim_usage_limit",
"Input"=> "{\"iccid\":\"YOUR_ICCID\", \"usagelimit\":25.5}"
);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($curl_post_data));
$curl_response = curl_exec($curl);
curl_close($curl);
echo "raw response: <br>" . $curl_response;
$APIOutputObject = json_decode($curl_response, true);
$Output_Value = json_decode($APIOutputObject["Output"], true);
if(array_key_exists("err", $Output_Value)){
echo "Error: " . $Output_Value["err"];
}else{
$result = $Output_Value["result"];
$description = $Output_Value["description"];
echo "<br><br><b>PARSED VALUES</b>";
echo "<br>Result: " . $result;
echo "<br>Description: " . $description;
}
?>