GET /events

Description

The /events endpoint enables retrieval of a user's event records. This includes carbohydrate intake, insulin doses, exercise, and health events that are entered in the receiver interface or through the mobile app.

Scopes & Access

 

Resource

GET /v2/users/self/events

 

Authorization

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

 

Query Parameters

These query parameters specify the time window for the requested data; both are required. See the discussion of time in the Endpoint Overview section for more details on how they relate to device information.

Name

Type

Description

startDate

DateTime

Beginning of the time window

endDate

DateTime

End of the time window

 

Request Example

 

Response Example

{
  "events": [
    {
      "systemTime": "2018-02-29T20:59:33",
      "displayTime": "2018-02-29T12:59:33",
      "eventType": "carbs",
      "eventSubType": null,
      "value": 35,
      "unit": "grams",
      "eventId": "601620ec-8caf-4244-81ff-cd946669806e",
      "eventStatus": "created"
    },
    {
      "systemTime": "2018-02-29T20:59:04",
      "displayTime": "2018-02-29T12:59:04",
      "eventType": "insulin",
      "eventSubType": "longActing",
      "value": 17,
      "unit": "units",
      "eventId": "4b790d7c-542e-4673-b1c4-92e4d8d4550a",
      "eventStatus": "created"
    },
    {
      "systemTime": "2018-02-29T20:58:53",
      "displayTime": "2018-02-29T12:58:53",
      "eventType": "insulin",
      "eventSubType": "fastActing",
      "value": 2.5,
      "unit": "units",
      "eventId": "a46b5c18-5fbd-4bb4-bcfc-5c9582eede9c",
      "eventStatus": "created"
    }
    {
      "systemTime": "2018-02-29T20:58:37",
      "displayTime": "2018-02-29T12:58:37",
      "eventType": "insulin",
      "eventSubType": "fastActing",
      "value": 2,
      "unit": "units",
      "eventId": "8705ff4c-e0d4-46a2-ad20-0839eafdfa32",
      "eventStatus": "deleted"
    }
  ]
}

 

 

Response Fields

Name

Type

Description

events

Array

Array of events

 

The events array fields are as follows
 

Name

Type

Description

Enumeration

systemTime

DateTime

Time according to the system clock for the event; nominally UTC

 

displayTime

DateTime

Time displayed on the receiving device for the event

 

eventType

String

Name of the event

  • "carbs"
  • "insulin"
  • "exercise"
  • "health"

eventSubType

String

Additional event description corresponding to eventType field

(nullable)

  • for eventType "carbs":
    • null
  • for eventType "insulin":
    • "fastActing"
    • "longActing"
    • null
  • for eventType "exercise":
    • "light"
    • "medium"
    • "heavy"
    • null
  • for eventType "health":
    • "illness"
    • "stress"
    • "highSymptoms"
    • "lowSymptoms"
    • "cycle"
    • "alcohol"
    • null

value

Float

Value of input

(nullable)

 

unit

String

Unit of measurement for the value field

(nullable)

  • for eventType "carbs": "grams"
  • for eventType "insulin": "units"
  • for eventType "exercise": "minutes"
  • for eventType "health": null

eventId

String

Unique ID for the event record

 

eventStatus

String

Status of the event record

See the Notes section below for more details

  • "created"
  • "deleted"

 

Notes

The G6 app enabled the ability to delete events after they have been created. To accomodate this, the eventId and eventStatus fields were introduced. When an event is initially created by the user, the eventStatus is set to "created". If the user deletes the event, the eventStatus will be changed to "deleted". The eventId will remain the same.

For events generated by receiving devices that do not have the ability to delete events (such as the G4 and G5 apps), the eventStatus field will always return "created".

 

The documentation for an earlier version of this endpoint is available here.