datarange

Description

The /dataRange endpoint enables retrieval of a user's earliest and latest times for calibration, EGV, and event records. This can be used to efficiently pull historical data and determine whether new data is available.

Resource

GET /v3/users/self/dataRange

Authorization

OAuth 2.0 bearer token; see the Authentication section for details on this workflow.

Notes

For the systemTime and displayTime response fields, records sourced from mobile apps (with displayDevice of “iOS” or “android”) will have UTC offsets; records sourced from receivers (with displayDevice of “receiver”) will not have UTC offsets.

SecurityBearerAuth
Request
query Parameters
lastSyncTime
string <date-time>

A timestamp that represents the last time a consumer/client of Dexcom API pulled data.

How to use the “lastSyncTime” query parameter

SyncTime - “lastSyncTime” is a new datetime query parameter built into the DataRange endpoint. If you know the last time you did a data sync for a user, you can specify this using the “lastSyncTime” parameter.

If provided, the system will only return date ranges for new data AFTER that date time. This allows for more efficient syncing as you’ll now have date ranges for data you know is new.

A SyncTime request example would look like this:

curl --location --request GET 'https://api.dexcom.com/v3/users/self/dataRange?lastSyncTime=2022-01-01T17:00:00’ --header 'Authorization: Bearer <token>' --header 'Accept: application/json'

Responses
200

Ok

Response Schema: application/json
recordType
required
string

The type of records that will be returned in this response. Example: “dataRange”

recordVersion
required
string

The version of records that will be returned in this response. Example: “3.0”

userId
required
string

This ID is unique on a per-Dexcom account, per-client basis, and will thus not be the same for a user across clients (even if the clients are owned by the same developer).

object (com.dexcom.partner.api.models.proto.v3.data_range.DataRangeStartAndEnd)
required
object (com.dexcom.partner.api.models.proto.v3.data_range.DataRangeMoment)
systemTime
required
string <date-time>

Time according to the system clock; nominally UTC.

displayTime
required
string <date-time>

Time displayed on the receiving device.

required
object (com.dexcom.partner.api.models.proto.v3.data_range.DataRangeMoment)
systemTime
required
string <date-time>

Time according to the system clock; nominally UTC.

displayTime
required
string <date-time>

Time displayed on the receiving device.

object (com.dexcom.partner.api.models.proto.v3.data_range.DataRangeStartAndEnd)
required
object (com.dexcom.partner.api.models.proto.v3.data_range.DataRangeMoment)
systemTime
required
string <date-time>

Time according to the system clock; nominally UTC.

displayTime
required
string <date-time>

Time displayed on the receiving device.

required
object (com.dexcom.partner.api.models.proto.v3.data_range.DataRangeMoment)
systemTime
required
string <date-time>

Time according to the system clock; nominally UTC.

displayTime
required
string <date-time>

Time displayed on the receiving device.

object (com.dexcom.partner.api.models.proto.v3.data_range.DataRangeStartAndEnd)
required
object (com.dexcom.partner.api.models.proto.v3.data_range.DataRangeMoment)
systemTime
required
string <date-time>

Time according to the system clock; nominally UTC.

displayTime
required
string <date-time>

Time displayed on the receiving device.

required
object (com.dexcom.partner.api.models.proto.v3.data_range.DataRangeMoment)
systemTime
required
string <date-time>

Time according to the system clock; nominally UTC.

displayTime
required
string <date-time>

Time displayed on the receiving device.

get/v3/users/self/dataRange
Request samples
curl -i -X GET \
  'https://api.dexcom.com/v3/users/self/dataRange?lastSyncTime=2019-08-24T14%3A15%3A22Z' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'
Response samples
application/json
{
  • "recordType": "dataRange",
  • "recordVersion": "3.0",
  • "userId": "5b329ebcfbf2f0ba7e49d4c5eb57775468f5ee657ac16fcde07e1fd08197b4c7",
  • "calibrations": {
    • "start": {
      • "systemTime": "2021-06-01T01:10:08",
      • "displayTime": "2021-06-01T01:10:08"
      },
    • "end": {
      • "systemTime": "2021-06-01T01:10:08",
      • "displayTime": "2021-06-01T01:10:08"
      }
    },
  • "egvs": {
    • "start": {
      • "systemTime": "2021-06-01T01:10:08",
      • "displayTime": "2021-06-01T01:10:08"
      },
    • "end": {
      • "systemTime": "2021-06-01T01:10:08",
      • "displayTime": "2021-06-01T01:10:08"
      }
    },
  • "events": {
    • "start": {
      • "systemTime": "2021-06-01T01:10:08",
      • "displayTime": "2021-06-01T01:10:08"
      },
    • "end": {
      • "systemTime": "2021-06-01T01:10:08",
      • "displayTime": "2021-06-01T01:10:08"
      }
    }
}