Skip to contentSkip to navigationSkip to topbar
Rate this Page:

DataSession Resource


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(link takes you to an external page) 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.


DataSession Properties

datasession-properties page anchor
Resource properties
sidtype: stringNot PII

The unique string that we created to identify the DataSession resource.


sim_sidtype: stringNot PII

The SID of the Sim resource(link takes you to an external page) that the Data Session is for.


account_sidtype: SID<AC>Not PII

The SID of the Account(link takes you to an external page) that created the DataSession resource.


radio_linktype: stringNot PII

The generation of wireless technology that the device was using.


operator_mcctype: stringNot PII

The 'mobile country code' is the unique ID of the home country where the Data Session took place. See: MCC/MNC lookup(link takes you to an external page).


operator_mnctype: stringNot PII

The 'mobile network code' is the unique ID specific to the mobile operator network where the Data Session took place.


operator_countrytype: stringNot PII

The three letter country code representing where the device's Data Session took place. This is determined by looking up the operator_mcc.


operator_nametype: stringNot PII

The friendly name of the mobile operator network that the SIM(link takes you to an external page)-connected device is attached to. This is determined by looking up the operator_mnc.


cell_idtype: stringNot PII

The unique ID of the cellular tower that the device was attached to at the moment when the Data Session was last updated.


cell_location_estimatetype: objectNot PII

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(link takes you to an external page).


packets_uploadedtype: integerNot PII

The number of packets uploaded by the device between the start time and when the Data Session was last updated.


packets_downloadedtype: integerNot PII

The number of packets downloaded by the device between the start time and when the Data Session was last updated.


last_updatedtype: string<DATE TIME>Not PII

The date that the resource was last updated, given as GMT in ISO 8601(link takes you to an external page) format.


starttype: string<DATE TIME>Not PII

The date that the Data Session started, given as GMT in ISO 8601(link takes you to an external page) format.


endtype: string<DATE TIME>Not PII

The date that the record ended, given as GMT in ISO 8601(link takes you to an external page) format.


imeitype: stringNot PII

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.


Cell Location Estimate Object

cell-location-estimate-object page anchor

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.

PropertyDescriptionEmpty Value
latIntegerLatitude. The spherical coordinate value of the estimated cellular tower location parallel to the Equator.0
lon IntegerLongitude. The spherical coordinate value of the estimated cellular tower location from the geographical North Pole to the geographical South Pole.0

Read multiple DataSession resources

read-multiple-datasession-resources page anchor
GET https://wireless.twilio.com/v1/Sims/{SimSid}/DataSessions

Parameters

list-parameters page anchor
URI parameters
SimSidtype: stringNot PII
Path Parameter

The SID of the Sim resource(link takes you to an external page) with the Data Sessions to read.


PageSizetype: integerNot PII
Query Parameter

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


Pagetype: integerNot PII
Query Parameter

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


PageTokentype: stringNot PII
Query Parameter

The page token. This is provided by the API.

Read multiple DataSession resources

read-multiple-datasession-resources-1 page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_11
// Download the helper library from https://www.twilio.com/docs/node/install
_11
// Find your Account SID and Auth Token at twilio.com/console
_11
// and set the environment variables. See http://twil.io/secure
_11
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_11
const authToken = process.env.TWILIO_AUTH_TOKEN;
_11
const client = require('twilio')(accountSid, authToken);
_11
_11
client.wireless.v1.sims('DEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11
.dataSessions
_11
.list({limit: 20})
_11
.then(dataSessions => dataSessions.forEach(d => console.log(d.sid)));

Output

_49
{
_49
"data_sessions": [
_49
{
_49
"sid": "WNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_49
"sim_sid": "DEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_49
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_49
"radio_link": "LTE",
_49
"operator_mcc": "",
_49
"operator_mnc": "",
_49
"operator_country": "",
_49
"operator_name": "",
_49
"cell_id": "",
_49
"cell_location_estimate": {},
_49
"packets_uploaded": 0,
_49
"packets_downloaded": 0,
_49
"last_updated": "2015-07-30T20:00:00Z",
_49
"start": "2015-07-30T20:00:00Z",
_49
"end": null,
_49
"imei": null
_49
},
_49
{
_49
"sid": "WNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_49
"sim_sid": "DEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_49
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_49
"radio_link": "3G",
_49
"operator_mcc": "",
_49
"operator_mnc": "",
_49
"operator_country": "",
_49
"operator_name": "",
_49
"cell_id": "",
_49
"cell_location_estimate": {},
_49
"packets_uploaded": 0,
_49
"packets_downloaded": 0,
_49
"last_updated": "2015-07-30T20:00:00Z",
_49
"start": "2015-07-30T20:00:00Z",
_49
"end": "2015-07-30T20:00:00Z",
_49
"imei": "014931000129700"
_49
}
_49
],
_49
"meta": {
_49
"first_page_url": "https://wireless.twilio.com/v1/Sims/DEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/DataSessions?PageSize=50&Page=0",
_49
"key": "data_sessions",
_49
"next_page_url": "https://wireless.twilio.com/v1/Sims/DEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/DataSessions?PageSize=50&Page=1",
_49
"page": 0,
_49
"page_size": 50,
_49
"previous_page_url": "https://wireless.twilio.com/v1/Sims/DEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/DataSessions?PageSize=50&Page=0",
_49
"url": "https://wireless.twilio.com/v1/Sims/DEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/DataSessions?PageSize=50&Page=0"
_49
}
_49
}


Rate this Page: