# DataSession Resource

The SIM **DataSession** resource returns data session information for a [SIM](https://docs.korewireless.com/en-us/api/products/programmable-wireless/wireless-sim-resource) 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](https://en.wikipedia.org/wiki/GPRS_core_network#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.

***

## DataSession Properties <a href="#datasession-properties" id="datasession-properties"></a>

**sid** string

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

***

**sim\_sid** string

The SID of the [Sim resource](https://docs.korewireless.com/en-us/api/products/programmable-wireless/wireless-sim-resource) that the Data Session is for.

***

**account\_sid** SID\<AC>

The SID of the Account that created the DataSession resource.

Pattern:`^AC[0-9a-fA-F]{32}$`

Min length:`34`

Max length:`34`

***

**radio\_link** string

The generation of wireless technology that the device was using.

***

**operator\_mcc** string

The 'mobile country code' is the unique ID of the home country where the Data Session took place. See: [MCC/MNC lookup](http://mcc-mnc.com/).

***

**operator\_mnc** string

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

***

**operator\_country** string

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

***

**operator\_name** string

The friendly name of the mobile operator network that the [SIM](https://docs.korewireless.com/en-us/api/products/programmable-wireless/wireless-sim-resource)-connected device is attached to. This is determined by looking up the `operator_mnc`.

***

**cell\_id** string

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\_estimate** object

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](#cell-location-estimate-object).

***

**packets\_uploaded** integer

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

Default:`0`

***

**packets\_downloaded** integer

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

Default:`0`

***

**last\_updated** string\<date-time>

The date that the resource was last updated, given as GMT in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.

***

**start** string\<date-time>

The date that the Data Session started, given as GMT in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.

***

**end** string\<date-time>

The date that the record ended, given as GMT in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.

***

**imei** string

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 <a href="#cell-location-estimate-object" id="cell-location-estimate-object"></a>

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           |

## Read multiple DataSession resources <a href="#read-multiple-datasession-resources" id="read-multiple-datasession-resources"></a>

{% openapi src="<https://3487028960-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJknMM6SZJYk9EbbitKp5%2Fuploads%2F4alsAWeuMtriesOfOixr%2Fopenapi3_0%20(alf).yaml?alt=media&token=8a6481d4-a087-4460-b7cd-9e4a4d0e6341>" path="/v1/Sims/{Sid}/DataSessions" method="get" %}
[openapi3\_0 (alf).yaml](https://3487028960-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJknMM6SZJYk9EbbitKp5%2Fuploads%2F4alsAWeuMtriesOfOixr%2Fopenapi3_0%20\(alf\).yaml?alt=media\&token=8a6481d4-a087-4460-b7cd-9e4a4d0e6341)
{% endopenapi %}
