The SIM DataSession resource returns data session information for a SIM over a period of 30 days or less in an aggregated list.
A data session represents an individual data connectivity session between the SIM-connected device and a service that interfaces between the cellular network and the Internet. This will be a PDP context either via a PDN connection or a Packet Gateway.
You can think of a data session as a representation of your device's Internet connection, whenever such a connection exists.
Data sessions can be used to troubleshoot device issues and understand the network setup and teardown behavior of a device in the wild.
The SID of the Account that created the DataSession resource.
^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The 'mobile country code' is the unique ID of the home country where the Data Session took place. See: MCC/MNC lookup.
The 'mobile network code' is the unique ID specific to the mobile operator network where the Data Session took place.
The three letter country code representing where the device's Data Session took place. This is determined by looking up the operator_mcc
.
The friendly name of the mobile operator network that the SIM-connected device is attached to. This is determined by looking up the operator_mnc
.
The unique ID of the cellular tower that the device was attached to at the moment when the Data Session was last updated.
An object that describes the estimated location in latitude and longitude where the device's Data Session took place. The location is derived from the cell_id
when the Data Session was last updated. See Cell Location Estimate Object.
The number of packets uploaded by the device between the start
time and when the Data Session was last updated.
0
The number of packets downloaded by the device between the start
time and when the Data Session was last updated.
0
The date that the resource was last updated, given as GMT in ISO 8601 format.
The date that the Data Session started, given as GMT in ISO 8601 format.
The 'international mobile equipment identity' is the unique ID of the device using the SIM to connect. An IMEI is a 15-digit string: 14 digits for the device identifier plus a check digit calculated using the Luhn formula.
The Cell location estimate object reports the approximate location of the cellular tower that the device was connected to when the Data Session was last updated. This is based on a lookup of public cellular tower data, and is not necessarily an accurate description of the cellular tower. It is not intended to describe the location of the SIM-connected device itself.
Property | Description | Empty Value |
---|---|---|
lat Integer | Latitude. The spherical coordinate value of the estimated cellular tower location parallel to the Equator. | 0 |
lon Integer | Longitude. The spherical coordinate value of the estimated cellular tower location from the geographical North Pole to the geographical South Pole. | 0 |
GET https://wireless.twilio.com/v1/Sims/{SimSid}/DataSessions
The SID of the Sim resource with the Data Sessions to read.
How many resources to return in each list page. The default is 50, and the maximum is 1000.
1
Maximum: 1000
The page token. This is provided by the API.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function listDataSession() {11const dataSessions = await client.wireless.v112.sims("SimSid")13.dataSessions.list({ limit: 20 });1415dataSessions.forEach((d) => console.log(d.sid));16}1718listDataSession();
1{2"data_sessions": [3{4"sid": "WNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",5"sim_sid": "DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",6"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",7"radio_link": "LTE",8"operator_mcc": "",9"operator_mnc": "",10"operator_country": "",11"operator_name": "",12"cell_id": "",13"cell_location_estimate": {},14"packets_uploaded": 0,15"packets_downloaded": 0,16"last_updated": "2015-07-30T20:00:00Z",17"start": "2015-07-30T20:00:00Z",18"end": null,19"imei": null20},21{22"sid": "WNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",23"sim_sid": "DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",24"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",25"radio_link": "3G",26"operator_mcc": "",27"operator_mnc": "",28"operator_country": "",29"operator_name": "",30"cell_id": "",31"cell_location_estimate": {},32"packets_uploaded": 0,33"packets_downloaded": 0,34"last_updated": "2015-07-30T20:00:00Z",35"start": "2015-07-30T20:00:00Z",36"end": "2015-07-30T20:00:00Z",37"imei": "014931000129700"38}39],40"meta": {41"first_page_url": "https://wireless.twilio.com/v1/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/DataSessions?PageSize=50&Page=0",42"key": "data_sessions",43"next_page_url": null,44"page": 0,45"page_size": 50,46"previous_page_url": null,47"url": "https://wireless.twilio.com/v1/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/DataSessions?PageSize=50&Page=0"48}49}