Package nudgestream.schema.tower
Message
NudgeQueryByParticipantRequest
Message
PhysicalActivitySession
Enum
BloodGlucoseMeasurementUnit
Services
service NudgeQueryService
NudgeQueryService is the service that is used to fetch nudge messages. This includes two APIs:
FetchNudges: Fetches Nudge Messages based on the Nudge Delivery Channel and Target date
FetchNudgesByParticipant: Fetches Nudge Messages based on the Nudge Delivery Channel, Target date and Participant Id
rpc FetchNudges
Request: nudgestream.schema.tower.NudgeQueryRequest
Response:
nudgestream.schema.tower.NudgeQueryResponse
Fetches Nudge Messages as stream based on the Nudge Delivery Channel and Target date
rpc FetchNudgesByParticipant
Request: nudgestream.schema.tower.NudgeQueryByParticipantRequest
Response:
nudgestream.schema.tower.NudgeQueryResponse
Fetches Nudge Messages for Participant Id on a Nudge Delivery Channel & Target date
service NudgeTelemetryService
NudgeTelemetryService is the service that is used to add nudge feedback and tracking information. This includes two APIs:
AddNudgeTracking: Add Nudge Tracking Information for a Nudge Message
AddNudgeFeedback: Add Nudge Feedback Information for a Nudge Message
rpc AddNudgeTracking
Request: nudgestream.schema.tower.NudgeTrackingEvents
Response:
google.protobuf.EmptyAdd Nudge Tracking Information for a Nudge Message
rpc AddNudgeFeedback
Request: nudgestream.schema.tower.NudgeFeedbackEvents
Response:
google.protobuf.EmptyAdd Nudge Feedback Information for a Nudge Message
service DeviceDataService
* Send device data for processing. This data can include data for different tracking activities like Steps, Sleep or Observations like HeartBeat, BMI etc
rpc LogDeviceData
Request: nudgestream.schema.tower.DeviceDataRequest
Response:
google.protobuf.EmptyMessages
message ParticipantInfo
* Participant meta information
| Field | Type | Description | |
|---|---|---|---|
| 1 | participant_id |
string
|
Participant identifier. This can be any unique id like email, uuid etc. All the downstream systems require this information for data aggregation and cue generation & delivery |
message ProfileInfo
* Participant profile information
| Field | Type | Description | |
|---|---|---|---|
| 1 | id |
string
|
Unique message id |
| 2 | event_info |
nudgestream.schema.tower.DiscreteEventInfo
|
Timestamp when this discrete event was recorded |
| 3 | participant_info |
nudgestream.schema.tower.ParticipantInfo
|
Participant meta information |
| 9 | gender |
string
|
Gender |
message SourceInfo
* Source system meta information. Messages sent for ingestion from devices/other sources can use this to send information about the origin like client information
TODO : Need to add additional details for SourceInfo
| Field | Type | Description | |
|---|---|---|---|
| 1 | message_id |
string
|
Unique id for each message |
| 2 | source_id |
string
|
Unique id for different source systems. If the message is sent by SDK or a Client API, then this will be the client information |
message CumulativeEventInfo
* Event data occurrence in a period of time (cumulative)
| Field | Type | Description | |
|---|---|---|---|
| 1 | started_at |
google.protobuf.Timestamp
|
Timestamp when this cumulative fact started |
| 2 | ended_at |
google.protobuf.Timestamp
|
Timestamp when this cumulative fact ended |
message DiscreteEventInfo
* Event data occurrence at a specific time (discrete)
| Field | Type | Description | |
|---|---|---|---|
| 1 | recorded_at |
google.protobuf.Timestamp
|
Timestamp when this discrete fact occurred |
message BloodGlucose
* Blood glucose concentration for the participant
| Field | Type | Description | |
|---|---|---|---|
| 1 | id |
string
|
Unique message id |
| 2 | event_info |
nudgestream.schema.tower.DiscreteEventInfo
|
Timestamp when this discrete event was recorded |
| 3 | participant_info |
nudgestream.schema.tower.ParticipantInfo
|
Participant meta information |
| 9 | value |
double
|
Blood glucose concentration value |
| 10 | unit |
nudgestream.schema.tower.BloodGlucoseMeasurementUnit
|
Blood glucose measurement unit |
message DeviceInfo
* Participants can use different devices to track fitness information. The devices could be bluetooth enabled fitness trackers like fitbit, garmin/ digital scales/glucose monitor etc.
The data from these devices are typically collected and synced with an app like Apple Health, Google Fit etc.
The data collected by these apps is then pushed to the API for ingestion
| Field | Type | Description | |
|---|---|---|---|
| 1 | id |
string
|
Unique message id |
| 2 | participant_info |
nudgestream.schema.tower.ParticipantInfo
|
Participant meta information |
| 3 | event_info |
nudgestream.schema.tower.DiscreteEventInfo
|
Timestamp when this discrete event was recorded |
| 9 | device_type |
nudgestream.schema.tower.DeviceType
|
The type of the device, e.g. 'Watch', 'Ring', 'Smartphone' |
| 10 | device_id |
string
|
Identifier of the device which is sending data for ingestion. The fitness data is collected by different apps like Apple Health/Google Fit etc. These apps are generally installed on the participants mobile device. Any device sending data for ingestion will need to send the unique device_id. In a potential scenario where participant chooses to to sync data from multiple devices and there is an overlap in the information sent, device_id can be used to resolve conflicts |
| 11 | manufacturer |
string
|
The manufacturer of the device, e.g. Apple, Fitbit, Xiaomi |
| 12 | model |
string
|
The model number of the device, e.g. Watch6,4, Charge HR |
| 13 | os_name |
string
|
The operating system of the device, e.g. 'iOS', 'Android' |
| 14 | os_version |
string
|
The operating system version of the device, e.g. '14.0.1', '10.0.0' |
| 15 | last_synced_at |
google.protobuf.Timestamp
|
The last time the device was synced with the app |
| 16 | custom_tags |
map<string, string>
|
Custom tags for the device |
| 17 | is_active |
bool
|
Status of the device |
message ParticipantProfile
* Participant Profile information
| Field | Type | Description | |
|---|---|---|---|
| 1 | id |
string
|
Unique message id |
| 2 | event_info |
nudgestream.schema.tower.DiscreteEventInfo
|
Timestamp when this discrete event was recorded |
| 3 | participant_info |
nudgestream.schema.tower.ParticipantInfo
|
Participant meta information |
| 9 | first_name |
string
|
Participant first name |
| 10 | last_name |
string
|
Participant last name |
| 11 |
string
|
Participant email |
|
| 12 | mobile |
string
|
Participant mobile |
| 13 | year_of_birth |
int32
|
Participant year of birth |
| 14 | month_of_birth |
int32
|
Participant month of birth |
| 15 | day_of_birth |
int32
|
Participant day of birth |
| 16 | sex |
string
|
Participant sex |
message Bmi
* Participant Body mass index(BMI) information on a specified timestamp
| Field | Type | Description | |
|---|---|---|---|
| 1 | id |
string
|
Unique message id |
| 2 | event_info |
nudgestream.schema.tower.DiscreteEventInfo
|
required: Timestamp when this discrete event was recorded |
| 3 | participant_info |
nudgestream.schema.tower.ParticipantInfo
|
required: Participant meta information |
| 9 | value |
double
|
BMI value |
| 10 | unit |
nudgestream.schema.tower.BMIMeasurementUnit
|
Unit for measuring BMI |
message Weight
* Participant Weight information on a specified timestamp
| Field | Type | Description | |
|---|---|---|---|
| 1 | id |
string
|
Unique message id |
| 2 | event_info |
nudgestream.schema.tower.DiscreteEventInfo
|
Timestamp when this discrete event was recorded |
| 3 | participant_info |
nudgestream.schema.tower.ParticipantInfo
|
Participant meta information |
| 9 | value |
double
|
Weight value in kilograms |
message Height
* Participant Height information on a specified timestamp
| Field | Type | Description | |
|---|---|---|---|
| 1 | id |
string
|
Unique message id |
| 2 | event_info |
nudgestream.schema.tower.DiscreteEventInfo
|
Timestamp when this discrete event was recorded |
| 3 | participant_info |
nudgestream.schema.tower.ParticipantInfo
|
Participant meta information |
| 9 | value |
double
|
Measured height in cms |
message BodyFat
* Participant BodyFat percentage on a specified timestamp
| Field | Type | Description | |
|---|---|---|---|
| 1 | id |
string
|
Unique message id |
| 2 | event_info |
nudgestream.schema.tower.DiscreteEventInfo
|
Timestamp when this discrete event was recorded |
| 3 | participant_info |
nudgestream.schema.tower.ParticipantInfo
|
Participant meta information |
| 9 | value |
double
|
BodyFat Value |
| 10 | unit |
string
|
Unit for measuring BodyFat |
message BloodPressure
* Blood pressure readings for participants
| Field | Type | Description | |
|---|---|---|---|
| 1 | id |
string
|
Unique message id |
| 2 | event_info |
nudgestream.schema.tower.CumulativeEventInfo
|
Timestamp when this cumulative event started & ended |
| 3 | participant_info |
nudgestream.schema.tower.ParticipantInfo
|
Participant meta information |
| 9 | systolic_value |
int32
|
Systolic blood pressure value |
| 10 | diastolic_value |
int32
|
Diastolic blood pressure value |
| 11 | unit |
nudgestream.schema.tower.BloodPressureMeasurementUnit
|
Blood Pressure measurement unit |
message HeartRate
* Instantaneous heart rates, which may be measured at various times by heart rate sensors throughout the day
| Field | Type | Description | |
|---|---|---|---|
| 1 | id |
string
|
Unique message id |
| 2 | event_info |
nudgestream.schema.tower.DiscreteEventInfo
|
Timestamp when this discrete event was recorded |
| 3 | participant_info |
nudgestream.schema.tower.ParticipantInfo
|
Participant meta information |
| 9 | value |
int32
|
Heartbeat value |
| 10 | unit |
nudgestream.schema.tower.HeartBeatMeasurementUnit
|
Heart beat measurement unit |
message NudgeMessage
This message represents a nudge sent to a participant through various channels.
| Field | Type | Description | |
|---|---|---|---|
| 1 | id |
string
|
Unique Identifier for the Nudge |
| 2 | participant_id |
string
|
The participant id |
| 3 | channel |
nudgestream.schema.tower.NudgeDeliveryChannel
|
Channel through which the nudge is sent (e.g. PUSH, SMS, EMAIL) |
| 4 | title |
string
|
Heading or Subject of the nudge |
| 5 | content |
string
|
Actual content of the nudge message(limited to 300 characters) |
| 6 | notification |
string
|
Push notification text or preview text for other channels |
| 7 | rank |
int32
|
Rank associated with the nudge. This is used to prioritize the nudge delivery |
| 8 | recommended_send_date |
google.protobuf.Timestamp
|
The date and time when the nudge should be sent |
| 9 | feedback_type |
nudgestream.schema.tower.NudgeFeedbackType
|
Feedback type associated with the message |
| 10 | goal |
string
|
The goal associated with the nudge. Every cue generated as a single goal |
message NudgeQueryResponse
| Field | Type | Description | |
|---|---|---|---|
| 1 | nudge_messages |
repeated
nudgestream.schema.tower.NudgeMessage
|
message NudgeQueryRequest
NudgeQueryRequest is the request message for fetching the nudges. This includes the channel and the target date for which the nudges are fetched
| Field | Type | Description | |
|---|---|---|---|
| 1 | channel |
nudgestream.schema.tower.NudgeDeliveryChannel
|
Channel through which the nudge is sent (e.g. PUSH, SMS, EMAIL) |
| 2 | target_date |
string
|
The target date in yyyy-mm-dd format for which the nudges are fetched |
| 3 | limit |
int32
|
The limit of the number of nudges to be fetched |
message NudgeQueryByParticipantRequest
NudgeQueryByParticipantRequest is the request message for fetching the nudges by participant. This includes the channel, the date range and the participant id
| Field | Type | Description | |
|---|---|---|---|
| 1 | query_request |
nudgestream.schema.tower.NudgeQueryRequest
|
NugetQueryRequest message, includes the channel and the date range |
| 2 | participant_id |
string
|
the participant id |
message NudgeTracking
NudgeTracking represents a discrete tracking event that was recorded for a nudge. This includes information about the event, the participant, and the nudge itself.
| Field | Type | Description | |
|---|---|---|---|
| 1 | id |
string
|
Unique message id |
| 2 | participant_info |
nudgestream.schema.tower.ParticipantInfo
|
Participant meta information |
| 3 | event_info |
nudgestream.schema.tower.DiscreteEventInfo
|
Timestamp when this discrete event was recorded |
| 4 | nudge_id |
string
|
The unique id of the nudge that was sent |
| 5 | event_type |
nudgestream.schema.tower.NudgeTrackingType
|
The type of event that was recorded |
message NudgeFeedback
NudgeFeedback represents a discrete feedback event that was recorded for a nudge. This includes information about the event, the participant, and the nudge itself.
| Field | Type | Description | |
|---|---|---|---|
| 1 | id |
string
|
Unique message id |
| 2 | participant_info |
nudgestream.schema.tower.ParticipantInfo
|
Participant meta information |
| 3 | event_info |
nudgestream.schema.tower.DiscreteEventInfo
|
Timestamp when this discrete event was recorded |
| 4 | nudge_id |
string
|
The unique id of the nudge that was sent |
| 5 | feedback_type |
nudgestream.schema.tower.NudgeFeedbackType
|
The type of feedback that was recorded. This can be [THUMBS, YES_NO, etc.] |
| 6 | feedback_value |
string
|
The feedback value that was recorded. This can be YES, NO, THUMBS_UP, THUMBS_DOWN, etc. |
message NudgeTrackingEvents
NudgeTrackingEvents represents a collection of nudge tracking events that were recorded.
| Field | Type | Description | |
|---|---|---|---|
| 1 | id |
string
|
Unique message id |
| 2 | tracking |
repeated
nudgestream.schema.tower.NudgeTracking
|
List of nudge tracking events |
message NudgeFeedbackEvents
NudgeFeedbackEvents represents a collection of nudge feedback events that were recorded.
| Field | Type | Description | |
|---|---|---|---|
| 1 | id |
string
|
Unique message id |
| 2 | feedback |
repeated
nudgestream.schema.tower.NudgeFeedback
|
List of nudge feedback events |
message Sleep
* Sleep taken during the observation period for a specific participant. Time in bed includes the time taken to fall asleep, the actual time in various stages of sleep, and the time spent in bed after waking.
The following relationships should hold: inbed_start ≤ sleep_start < sleep_end ≤ inbed_end time_to_fall_asleep = sleep_start - inbed_start time_after_wakeup = inbed_end - sleep_end
The period from sleep_start to sleep_end can include times awake and in various stages of sleep (which are recorded in sleep.sleep_stages).
Data sources may provide different data elements. For example, some data sources do not report time to fall asleep and time to wake up; the inbed_start and inbed_end should be set to NULL to indicate that they are unknown.
Data producers should record values as they are reported by the data sources only, and not compute them. For example, if a data source reports inbed_start and sleep_start but not time_to_fall_asleep, the time_to_fall_asleep value should be set to NULL. This reflects a true picture of what data is available, and allows data consumers to decide whether to use the available values or to compute them (in case of data source issues).
| Field | Type | Description | |
|---|---|---|---|
| 1 | id |
string
|
Unique message id |
| 2 | event_info |
nudgestream.schema.tower.CumulativeEventInfo
|
Timestamp when this cumulative event started & ended |
| 3 | participant_info |
nudgestream.schema.tower.ParticipantInfo
|
Participant meta information |
| 8 | in_bed_start |
google.protobuf.Timestamp
|
In bed start time |
| 9 | in_bed_end |
google.protobuf.Timestamp
|
In bed end time |
| 10 | time_after_wakeup |
int32
|
Number of minutes in bed after waking up |
| 11 | time_to_fall_asleep |
int32
|
Number of minutes to fall asleep |
| 12 | total_in_bed_time |
int32
|
Total minutes spent in bed |
| 13 | total_sleep_time |
int32
|
Total minutes spent sleeping |
| 14 | total_awake_time |
int32
|
Total minutes awake in bed |
| 15 | total_deep_time |
int32
|
Total minutes in deep sleep |
| 16 | total_light_time |
int32
|
Total minutes in light sleep |
| 17 | total_rem_time |
int32
|
Total minutes in rem sleep |
| 18 | sleep_score |
int32
|
Sleep score (0-100). Higher is better sleep quality. |
message StressSummary
Stress message is used to capture the stress summary of a participant in a given time period.
| Field | Type | Description | |
|---|---|---|---|
| 1 | id |
string
|
Unique message id |
| 2 | event_info |
nudgestream.schema.tower.CumulativeEventInfo
|
Timestamp when this cumulative event started & ended |
| 3 | participant_info |
nudgestream.schema.tower.ParticipantInfo
|
Participant meta information |
| 9 | min_stress_value |
int32
|
Minimum stress value in the given time period (in the range of 0-100) |
| 10 | max_stress_value |
int32
|
Maximum stress value in the given time period (in the range of 0-100) |
| 11 | avg_stress_value |
int32
|
Average stress value in the given time period (in the range of 0-100) |
message Steps
* Number of steps taken during the observation period for a specific participant
| Field | Type | Description | |
|---|---|---|---|
| 1 | id |
string
|
Unique message id |
| 2 | event_info |
nudgestream.schema.tower.CumulativeEventInfo
|
Timestamp when this cumulative event started & ended |
| 3 | participant_info |
nudgestream.schema.tower.ParticipantInfo
|
Participant meta information |
| 9 | value |
int32
|
Number of steps taken during the observation period |
message PhysicalActivitySession
PhysicalActivity sessions, during which a participant engages in a type of sport, exercise, or workout.
| Field | Type | Description | |
|---|---|---|---|
| 1 | id |
string
|
Unique message id |
| 2 | event_info |
nudgestream.schema.tower.CumulativeEventInfo
|
Timestamp when this cumulative event started & ended |
| 3 | participant_info |
nudgestream.schema.tower.ParticipantInfo
|
Participant meta information |
| 9 | workout_type |
string
|
The type of workout, e.g. run, soccer, yoga. |
| 10 | total_calories_burnt |
int32
|
Calories burnt during the workout in kcal |
| 11 | basal_calories_burnt |
int32
|
Basal calories burnt during the workout in kcal |
| 12 | active_calories_burnt |
int32
|
Active calories burnt during the workout in kcal |
| 13 | distance |
int32
|
Distance covered during workout in meters |
| 14 | avg_speed |
int32
|
Average speed during work in m/s |
| 15 | steps |
int32
|
Steps taken during the workout |
| 16 | sedentary_intensity_duration |
int32
|
Minutes spent being sedentary |
| 17 | light_intensity_duration |
int32
|
Minutes spend in light intensity workout |
| 18 | moderate_intensity_duration |
int32
|
Minutes spent in moderate intensity workout |
| 19 | vigorous_intensity_duration |
int32
|
Minutes spend in vigorous intensity workout |
| 20 | avg_heart_rate |
int32
|
Average heart rate during workout |
| 21 | vo2Max_value |
int32
|
VO2max, the maximal oxygen consumption during the workout. |
message DeviceDataRequest
| Field | Type | Description | |
|---|---|---|---|
| 1 | device_info |
repeated
nudgestream.schema.tower.DeviceInfo
|
|
| 2 | participant_info |
nudgestream.schema.tower.ParticipantInfo
|
|
| 3 | source_info |
nudgestream.schema.tower.SourceInfo
|
|
| 4 | profile_info |
nudgestream.schema.tower.ProfileInfo
|
|
| 9 | bmi |
repeated
nudgestream.schema.tower.Bmi
|
|
| 10 | body_fat |
repeated
nudgestream.schema.tower.BodyFat
|
|
| 11 | height |
repeated
nudgestream.schema.tower.Height
|
|
| 12 | weight |
repeated
nudgestream.schema.tower.Weight
|
|
| 13 | steps |
repeated
nudgestream.schema.tower.Steps
|
|
| 14 | sleep |
repeated
nudgestream.schema.tower.Sleep
|
|
| 15 | blood_pressure |
repeated
nudgestream.schema.tower.BloodPressure
|
|
| 16 | heart_rate |
repeated
nudgestream.schema.tower.HeartRate
|
|
| 17 | physical_activity_session |
repeated
nudgestream.schema.tower.PhysicalActivitySession
|
|
| 18 | participant_profile |
repeated
nudgestream.schema.tower.ParticipantProfile
|
|
| 19 | stress_summary |
repeated
nudgestream.schema.tower.StressSummary
|
Enums
enum BloodGlucoseMeasurementUnit
* Measurement unit for Blood Glucose
| Name | Number | Description |
|---|---|---|
MMOL_PER_LITRE |
0 |
enum BloodPressureMeasurementUnit
* Measurement unit for Blood Pressure
| Name | Number | Description |
|---|---|---|
mmHg |
0 |
enum NudgeTrackingType
Nudge Tracking Event Types. These are the different types of events that can be recorded for a nudge.
| Name | Number | Description |
|---|---|---|
NUDGE_SENT |
0 | Nudge was sent to the participant |
NUDGE_DELIVERED |
1 | Nudge was delivered to the participant |
NUDGE_DELIVERY_FAILED |
2 | Nudge delivery failed |
NUDGE_OPENED |
3 | Nudge was opened by the participant |
NUDGE_VIEWED |
4 | Nudge was viewed by the participant |
NUDGE_CLICKED |
5 | Nudge was clicked by the participant |
NUDGE_RESPONDED |
6 | Nudge was responded to by the participant |
NUDGE_DISMISSED |
7 | Nudge was dismissed by the participant |
enum NudgeFeedbackType
Nudge Feedback type is an enumeration which provides a way on how feedback needs to be collected for a specific nudge.
| Name | Number | Description |
|---|---|---|
THUMBS |
0 | The feedback is either a thumbs up or thumbs down |
YES_NO |
1 | The feedback is a simple yes or no |
enum DeviceType
* The type of the device used by the participant to track fitness information.
| Name | Number | Description |
|---|---|---|
WATCH |
0 | The device is a watch |
SMARTPHONE |
1 | The device is a smartphone |
RING |
2 | The device is a ring |
SCALE |
3 | The device is a scale |
GLUCOSE_MONITOR |
4 | The device is a glucose monitor |
BLOOD_PRESSURE_MONITOR |
5 | The device is a blood pressure monitor |
THERMOMETER |
6 | The device is a thermometer |
PULSE_OXIMETER |
7 | The device is a pulse oximeter |
OTHER |
8 | Other |