eSIM API - version 1.81.607 (rev AG)
eSIM API provides a programable HTTP/REST/JSON based access to all subsystems of the eSIM platform.
Authentication is done via x-esim-rest-api-key (10 or 11 digits) and x-esim-rest-api-token (50 alphanumeric) headers.
A value in the headers can be obtained via eSIM portal.
Example:
x-esim-rest-api-key: 24412001155
x-esim-rest-api-token: t1xFxZK011Y7wqaTi7NHbitKERwSBor0gaDt8qOCj2eXTXpWsO
All requests must have Accept and Content-Type headers as follows
Accept: application/json
Content-Type: application/json
All errors will output application/json type body:
{
"code": "http error code, number",
"text": "error code description, string",
"description": "error code description or note"
}
*** Common Errors: ***
| HTTP Code |
Text |
Description |
| 400 |
General unidentified error |
Error description or a note if any. |
| 403 |
Forbidden |
Key, token or IP validation failed. |
| 404 |
Not Found |
Function, URL or reference is not found. |
| 405 |
Method Not Allowed |
Other than POST method is used. |
| 415 |
Unsupported Media Type |
Expected headers missing or invalid. |
| 500 |
Server error |
General server error description. |
Terminal via curl tool execution pattern
curl -X POST https://api.globaliotdata.net/v1/<functon group>/<function name> \
-H 'x-esim-rest-api-key: your key' \
-H 'x-esim-rest-api-token: your token' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d 'A JSON structure with function's parameters, if any'
Basic APIs ¶
Activate Chip ¶
Activate Chip
POST/v1/Basic/ActivateChip
| Exchange Pattern |
Description |
| Synchronous |
Activate a chip with service identified by ID. |
Example URI
POST https://api.globaliotdata.net/v1/Basic/ActivateChip
Request with bodyHideShow
Headers
Content-Type: application/json
Body
{
"eid": "eid of the chip to activate"
"service_id": "ID of the service to use for activation."
}
Headers
Content-Type: application/json
Terminate Chip ¶
Terminate Chip
POST/v1/Basic/TerminateChip
| Exchange Pattern |
Description |
| Synchronous |
Permanently disable a chip. This operation can not be reversed! |
Example URI
POST https://api.globaliotdata.net/v1/Basic/TerminateChip
Request with bodyHideShow
Headers
Content-Type: application/json
Body
{
"eid": "eid of the chip to terminate"
}
Headers
Content-Type: application/json
Suspend Chip ¶
Suspend Chip
POST/v1/Basic/SuspendChip
| Exchange Pattern |
Description |
| Synchronous |
Suspend internet access on a chip. |
Example URI
POST https://api.globaliotdata.net/v1/Basic/SuspendChip
Request with bodyHideShow
Headers
Content-Type: application/json
Body
{
"eid": "eid of the chip to suspend"
}
Headers
Content-Type: application/json
Resume Chip ¶
Resume Chip
POST/v1/Basic/ResumeChip
| Exchange Pattern |
Description |
| Synchronous |
Resume internet access on a chip. |
Example URI
POST https://api.globaliotdata.net/v1/Basic/ResumeChip
Request with bodyHideShow
Headers
Content-Type: application/json
Body
{
"eid": "eid of the chip to resume"
}
Headers
Content-Type: application/json
Get Chip's Charging State ¶
Get Chip's Charging State
POST/v1/Basic/GetChargingState
| Exchange Pattern |
Description |
| Synchronous |
Retrieve chip’s charging state. Available States: InTransit, Inventory, Active, Suspended, Terminated |
Possible States:
| State |
Description |
| InTransit |
In this state chip can not be used |
| Inventory |
In this state, only inventory charges apply |
| Active |
In this state, all charges apply based on an activated service plan |
| Suspended |
In this state, only inventory charges apply |
| Terminated |
In this state, a one off Termination charge may apply |
| Distinctive |
In this state, charges apply based on a contract |
Example URI
POST https://api.globaliotdata.net/v1/Basic/GetChargingState
Request with bodyHideShow
Headers
Content-Type: application/json
Body
{
"eid": "eid of the chip to get state"
}
Headers
Content-Type: application/json
Body
{
"charging_state": "Current charging state of the chip, string, values: [InTransit, Inventory, Active, Suspended, Terminated]"
"available_states": [
"array of state chip can be change to by calling appropriate function"
]
}
Get Catalog of Services ¶
Get Catalog of Services
POST/v1/Basic/GetServicesCatalog
| Exchange Pattern |
Description |
| Synchronous |
Returns a list of all available services for the account of no body or for a chip if body with eid |
Example URI
POST https://api.globaliotdata.net/v1/Basic/GetServicesCatalog
Headers
Content-Type: application/json
Body
{
"catalog": [
{
"service_id": "id of the service",
"name": "name of the service",
"description": "description of the service"
}
]
}
Request with bodyHideShow
Headers
Content-Type: application/json
Body
{
"eid": "eid of the chip to get catalog item it is activate with"
}
Headers
Content-Type: application/json
Body
{
"catalog": [
{
"service_id": "id of the service",
"name": "name of the service",
"description": "description of the service"
}
]
}
Retrieve Data Usage ¶
Retrieve Data Usage
POST/v1/Basic/GetUsage
| Exchange Pattern |
Description |
| Synchronous |
Returns data usage. |
| With Body in request |
Function returns data usage per chip. |
| Without Body in request |
Function returns data usage per account. |
Example of all data usage on account
curl -X POST https://api.globaliotdata.net/v1/Basic/GetUsage \
-H 'x-esim-rest-api-key: your key' \
-H 'x-esim-rest-api-token: your token' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
Example of data usage on a chip by eid
curl -X POST https://api.globaliotdata.net/v1/Basic/GetUsage \
-H 'x-esim-rest-api-key: your key' \
-H 'x-esim-rest-api-token: your token' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{"eid":"89001570010894900000000000000015"}'
Example of data usage on a chip by default iccid
curl -X POST https://api.globaliotdata.net/v1/Basic/GetUsage \
-H 'x-esim-rest-api-key: your key' \
-H 'x-esim-rest-api-token: your token' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{"iccid":"8985231999999999999F"}'
Example URI
POST https://api.globaliotdata.net/v1/Basic/GetUsage
Request without bodyHideShow
Headers
Content-Type: application/json
Headers
Content-Type: application/json
Body
{
"total": "total octets used on this account, number",
"lastbilling": "total octet used on this account in the last billing cycle, number",
"currentbilling": "total octet used on this account in the current billing cycle, number",
"lastweek": "total octet used on this account in the last week, number",
"currentweek": "total octet used on this account in the current week, number",
"yesterday": "total octet used on this account yesterday, number",
"today": "total octet used on this account yesterday, number"
}
Request with bodyHideShow
Headers
Content-Type: application/json
Body
{
"eid": "eid of the chip (20 or 32 byte format), optional"
"iccid": "iccid of the chip's profile (18 or 20 byte format), optional"
}
Headers
Content-Type: application/json
Body
{
"total": "total octets used on this chip, number",
"lastbilling": "total octet used on this chip in the last billing cycle, number",
"currentbilling": "total octet used on this chip in the current billing cycle, number",
"lastweek": "total octet used on this chip in the last week, number",
"currentweek": "total octet used on this chip in the current week, number",
"yesterday": "total octet used on this chip yesterday, number",
"today": "total octet used on this chip yesterday, number"
}
Provisioning APIs ¶
Get List of Inventory Batches ¶
Get List of Inventory Batches
POST/v1/Prov/GetInventoryBatches
| Exchange Pattern |
Description |
| Synchronous |
Returns a list of all inventory batches on the account. |
Example
curl -X POST https://api.globaliotdata.net/v1/Prov/GetInventoryBatches \
-H 'x-esim-rest-api-key: your key' \
-H 'x-esim-rest-api-token: your token' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
Example URI
POST https://api.globaliotdata.net/v1/Prov/GetInventoryBatches
Headers
Content-Type: application/json
Body
{
"batches" : [{
"batch_id" : "id of the batch",
"is_accepted" : "true if batch is received and accepted"
"date_created" : "date and time of the batch created",
"date_accepted" : "date and time of the batch accepted",
"count" : "count of chips in the batch"
}]
}
Accept a Batch Of Chips ¶
Accept a Batch Of Chips
POST/v1/Prov/AcceptInventoryBatch
| Exchange Pattern |
Description |
| Synchronous |
Accept An Inventory Batch. |
Example URI
POST https://api.globaliotdata.net/v1/Prov/AcceptInventoryBatch
Headers
Content-Type: application/json
Body
{
"batch_id" : "id of the batch to accept",
}
Get List of Chips ¶
Get List of Chips
POST/v1/Prov/GetChips
| Exchange Pattern |
Description |
| Synchronous |
Returns a list of chips per batch. |
Example
curl -X POST https://api.globaliotdata.net/v1/Prov/GetChips \
-H 'x-esim-rest-api-key: your key' \
-H 'x-esim-rest-api-token: your token' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{"batch_id":"M999999900"}'
Example URI
POST https://api.globaliotdata.net/v1/Prov/GetChips
Headers
Content-Type: application/json
Body
{
"batch_id": "Batch ID , required"
}
Headers
Content-Type: application/json
Body
{
"chips": [
{
"eid": "eid of the chip in 20 byte format",
"eid32": "eid of the chip in 32 byte format",
"iccid": "iccid of the provisioning profile on the chip"
}
]
}
Get PIN & PUK of profile ¶
Get PIN & PUK of profile
POST/v1/Prov/GetLock
| Exchange Pattern |
Description |
| Synchronous |
Returns a PIN and PUK of profile. |
Example URI
POST https://api.globaliotdata.net/v1/Prov/GetLock
Headers
Content-Type: application/json
Body
{
"iccid": "iccid of the profile"
}
Headers
Content-Type: application/json
Body
{
"pin1": "pin of the profile",
"puk1": "puk of the profile"
}
Get Count of Chips In Charging States ¶
Get Count of Chips In Charging States
POST/v1/Prov/GetChipsCountsByStates
| Exchange Pattern |
Description |
| Synchronous |
Returns a count of chips in all charging states. |
Example URI
POST https://api.globaliotdata.net/v1/Prov/GetChipsCountsByStates
Request without bodyHideShow
Headers
Content-Type: application/json
Headers
Content-Type: application/json
Body
{
"InTransit": 'count of chips in transit to the customer',
"Inventory": 'count of chips in the inventory',
"Active": 'count of active chips',
"Suspended": 'count of suspended chips',
"Terminated": 'count of terminated chips',
}
Get List of Chips By a Charging State ¶
Get List of Chips By a Charging State
POST/v1/Prov/GetChipsByState
| Exchange Pattern |
Description |
| Synchronous |
Returns a list of chips by requested charging state. |
Example URI
POST https://api.globaliotdata.net/v1/Prov/GetChipsByState
Headers
Content-Type: application/json
Body
{
"charging_state": "Requested charging state (InTransit, Inventory, Active, Suspended, Terminated)"
}
Headers
Content-Type: application/json
Body
{
"eid32": [
"list of eids in 32 byte format of the requested charging state"
]
}
Get Chip's Quota ¶
Get Chip's Quota
POST/v1/Pol/GetChipQuotaInfo
| Exchange Pattern |
Description |
| Synchronous |
Gets chip’s quota information. |
Example URI
POST https://api.globaliotdata.net/v1/Pol/GetChipQuotaInfo
Headers
Content-Type: application/json
Body
{
"eid" : "eid of the chip to retrieve quota information, pattern ^[0-9]{32}$, required",
}
Headers
Content-Type: application/json
Body
{
"QuotaInfo": {
"eid": "eid of the chip, pattern ^[0-9]{32}$",
"QuotaTotal": "total number of quota in items, number",
"QuotaCurrent": "current number of quota in items, number",
"QuotaMetrics": "The quota item (octet, bytes, kilobytes, megabytes, etc...), string"
}
}
Network APIs ¶
Cancel Location ¶
Cancel Location
POST/v1/Net/CancelLocation
| Exchange Pattern |
Description |
| Synchronous |
Send “Cancel Location” command to Operator’s Network |
This command will force UE to reset radio network connection
Example URI
POST https://api.globaliotdata.net/v1/Net/CancelLocation
Headers
Content-Type: application/json
Body
{
"eid" : "eid of the chip to send cancel location signal quota information, pattern ^[0-9]{32}$, required",
}
Headers
Content-Type: application/json
Retrieve Chip's PDN Status ¶
Retrieve Chip's PDN Status
POST/v1/Net/GetChipPdnStatus
| Exchange Pattern |
Description |
| Synchronous |
Query chip’s PDN status from Operator’s Network |
This command will return PDN status of the chip to the caller.
The status is returned in the response body as a JSON object.
If no active PDN is found, the response body will contain pdn-status as ‘offline’.
Example URI
POST https://api.globaliotdata.net/v1/Net/GetChipPdnStatus
Headers
Content-Type: application/json
Body
{
"eid" : "eid of the chip to search active PDN status, pattern ^[0-9]{32}$, required",
}
Headers
Content-Type: application/json
Body
{
"eid": "eid of the chip with active PDN status, pattern ^[0-9]{32}$, required",
"pdn-status": "PDN status of the chip - offline / online, string",
"mccmnc": "Roaming operator's MCCMNC of the active PDN tunnel, string, present if online",
"connected": "Time when the chip was connected to the network, string, present if online",
"updated": "Time when the chip was last updated, string, present if online",
"data-total": "Total data usage in bytes, number, present if online",
"data-ingress": "Ingress data usage in bytes, number, present if online",
"data-egress": "Egress data usage in bytes, number, present if online",
"rat": "Radio Access Technology, string, present if online",
"imeisv": "IMEIsv of the chip, string, present if online"
}
SMS APIs ¶
Send SMS ¶
Send SMS
POST/v1/Sms/Send
| Exchange Pattern |
Description |
| Synchronous |
Send SMS message to a UE |
This command will send SMS message to UE with a chip identified by EID or ICCID
Example URI
POST https://api.globaliotdata.net/v1/Sms/Send
Headers
Content-Type: application/json
Body
{
"eid": "eid of the chip to send message to, pattern ^[0-9]{32}$, required if iccid is not present",
"iccid": "iccid of the chip's default or active profile (18 or 20 byte format), required if eid is not present",
"message": "SMS message content, required"
}
Headers
Content-Type: application/json
Set SMS MO Callback ¶
Set SMS MO Callback
POST/v1/Sms/SetMoCallback
| Exchange Pattern |
Description |
| Synchronous |
Set a callback URL for MO SMS messages |
This command will set SMS MO message callback URL.
The callback URL will be called by eSIM application as a POST verb when SMS message is send from UE to eSIM short code.
The format of the POST content follows:
{
"id" : "ID if the SMS message",
"eid" : "eid of the chip SMS message received from, pattern ^[0-9]{32}$",
"time" : "time stamp when SMS message arrived",
"message" : "body of the SMS message sent by UE"
}
Example URI
POST https://api.globaliotdata.net/v1/Sms/SetMoCallback
Headers
Content-Type: application/json
Body
{
"url": "URL of the call back for SMS MO messages, optional"
}
Headers
Content-Type: application/json
Sample Code ¶
Common section for all API usage
// run "composer require guzzlehttp/guzzle" ahead of time
include "vendor/autoload.php";
$base_url = 'https://api.globaliotdata.net/v1/';
// fill the following variables with appropriate information
$api_key = "";
$api_token = "";
$eid = "";
$eid32 = "";
$iccid = "";
$batch_id = "";
// initialize Http Client
$client = new \GuzzleHttp\Client(['base_uri' => $base_url,
'headers' => [
'x-esim-rest-api-key' => $api_key,
'x-esim-rest-api-token' => $api_token,
'Accept' => 'application/json',
'Content-Type' => 'application/json'
]]);
Information APIs Examples
echo $client->request('POST', 'Info/Ping', ['json' => ["ack" => "back"]])->getBody().PHP_EOL;
echo $client->request('POST', 'Info/GetEid32', ['json' => ["eid" => $eid]])->getBody().PHP_EOL;
echo $client->request('POST', 'Info/GetChipInfo', ['json' => ["eid" => $eid32]])->getBody().PHP_EOL;
echo $client->request('POST', 'Info/GetProfileInfo', ['json' => ["iccid" => $iccid]])->getBody().PHP_EOL;
echo $client->request('POST', 'Info/GetChipPaymentInfo', ['json' => ["eid" => $eid32]])->getBody().PHP_EOL;
Basic Charging State, Data Usage and Service Catalogs APIs Examples
echo $client->request('POST', 'Basic/GetChargingState', ['json' => ["eid" => $eid32]])->getBody().PHP_EOL;
echo $client->request('POST', 'Basic/ActivateChip', ['json' => ["eid" => $eid32]])->getBody().PHP_EOL;
echo $client->request('POST', 'Basic/SuspendChip', ['json' => ["eid" => $eid32]])->getBody().PHP_EOL;
echo $client->request('POST', 'Basic/ResumeChip', ['json' => ["eid" => $eid32]])->getBody().PHP_EOL;
echo $client->request('POST', 'Basic/TerminateChip', ['json' => ["eid" => $eid32]])->getBody().PHP_EOL;
echo $client->request('POST', 'Basic/GetServicesCatalog', ['json' => []])->getBody().PHP_EOL;
echo $client->request('POST', 'Basic/GetUsage', ['json' => []])->getBody().PHP_EOL;
echo $client->request('POST', 'Basic/GetUsage', ['json' => ["eid" => $eid32]])->getBody().PHP_EOL;
Provisioning APIs Examples
echo $client->request('POST', 'Prov/GetInventoryBatches', ['json' => []])->getBody().PHP_EOL;
echo $client->request('POST', 'Prov/AcceptInventoryBatch', ['json' => ["batch_id" => $batch_id]])->getBody().PHP_EOL;
echo $client->request('POST', 'Prov/GetChips', ['json' => ["batch_id" => $batch_id]])->getBody().PHP_EOL;
echo $client->request('POST', 'Prov/GetLock', ['json' => ["iccid" => $iccid]])->getBody().PHP_EOL;
Policy APIs Examples
echo $client->request('POST', 'Pol/GetChipQuotaInfo', ['json' => ["eid" => $eid32]])->getBody().PHP_EOL;
Network APIs Examples
echo $client->request('POST', 'Net/CancelLocation', ['json' => ["eid" => $eid32]])->getBody().PHP_EOL;