# Measurements Context This document describes the API endpoint for uploading time series data and the structure of the various measurement types. ### Time Series Data Upload Endpoint This endpoint is used to upload time series data to the backend. The request is a `multipart/form-data` request with two parts: 1. `file`: The zipped CSV file containing the time-series data. 2. `type`: The name of the table the data belongs to. ## HEART_BEAT * **Columns:** * `datetime`: Unix timestamp (integer) * `value`: Heart beat value (hex string) * `quality_indicator`: Always "4" * **Example:** | datetime | value | quality_indicator | | --- | --- | --- | | 1672531200 | 800 | 4 | | 1672531201 | 810 | 4 | ## HEART_RATE * **Columns:** * `datetime`: Unix timestamp (integer) * `value`: Heart rate in beats per minute (integer) * `quality_indicator`: Quality of the measurement (integer) * **Example:** | datetime | value | quality_indicator | | --- | --- | --- | | 1672531200 | 75 | 4 | | 1672531201 | 76 | 4 | ## HEART_RATE_GRAPH * **Columns:** * `datetime`: Unix timestamp (integer) * `value`: Heart rate in beats per minute (integer) * **Example:** | datetime | value | | --- | --- | | 1672531200 | 75 | | 1672531260 | 76 | ## RESPIRATION_RATE * **Columns:** * `datetime`: Unix timestamp (integer) * `value`: Respiration rate in breaths per minute (double) * `quality_indicator`: Quality of the measurement (integer) * **Example:** | datetime | value | quality_indicator | | --- | --- | --- | | 1672531200 | 16.5 | 4 | | 1672531201 | 16.7 | 4 | ## RESTING_HEART_RATE * **Columns:** * `datetime`: Unix timestamp (integer) * `value`: Resting heart rate in beats per minute (integer) * `quality_indicator`: Quality of the measurement (integer) * **Example:** | datetime | value | quality_indicator | | --- | --- | --- | | 1672531200 | 55 | 4 | | 1672531201 | 56 | 4 | ## TEMPERATURE * **Columns:** * `datetime`: Unix timestamp (integer) * `value`: Temperature in Celsius (double) * `quality_indicator`: Quality of the measurement (integer) * **Example:** | datetime | value | quality_indicator | | --- | --- | --- | | 1672531200 | 36.5 | 4 | | 1672531201 | 36.6 | 4 | ## ACTIVITY_COUNT * **Columns:** * `datetime`: Unix timestamp (integer) * `value`: Activity count (integer) * `bodyPosition`: Body position identifier (integer) - *not important* * `quality_indicator`: Quality of the measurement (integer) - *not important* * **Example:** | datetime | value | bodyPosition | quality_indicator | | --- | --- | --- | --- | | 1672531200 | 100 | 1 | 4 | | 1672531201 | 105 | 1 | 4 | ## ACTIVITY_TYPE * **Columns:** * `datetime`: Unix timestamp (integer) * `value`: Activity type identifier (integer) * `quality_indicator`: Quality of the measurement (integer) * **Value Mapping:** | Value | Type | | --- | --- | | 0 | unspecified | | 1 | other | | 2 | walk | | 4 | run | | 6 | cycle | | 7 | rest | * **Example:** | datetime | value | quality_indicator | | --- | --- | --- | | 1672531200 | 1 | 4 | | 1672531201 | 2 | 4 | ## ACTIVITY_CADENCE * **Columns:** * `datetime`: Unix timestamp (integer) * `value`: Activity cadence (integer) * `quality_indicator`: Quality of the measurement (integer) * **Example:** | datetime | value | quality_indicator | | --- | --- | --- | | 1672531200 | 90 | 4 | | 1672531201 | 92 | 4 | ## MOTION_GRAPH * **Columns:** * `datetime`: Unix timestamp (integer) * `value`: Heart rate in beats per minute (integer) * **Example:** | datetime | value | | --- | --- | | 1672531200 | 1075 | | 1672531260 | 1076 | ## STRESS_LEVEL ❗**DEPRECATED** * **Columns:** * `datetime`: Unix timestamp (integer) * `value`: Stress level (integer) * `quality_indicator`: Quality of the measurement (integer) * **Example:** | datetime | value | quality_indicator | | --- | --- | --- | | 1672531200 | 30 | 4 | | 1672531201 | 32 | 4 | ## REACTIVITY_GRAPH * **Columns:** * `datetime`: Unix timestamp (integer) * `value`: Reactivity Value (no unit) varies between `-50` and `50` * `label`: Reactivity Label (integer) * **Value Mapping:** | Value | Type | | --- | --- | | 0 | deep relaxation | | 1 | calm | | 2 | physical activity | | 3 | stress | | 4 | physical recovery | * **Example:** | datetime | value | label | | --- | --- | --- | | 1672531200 | 15 | 1 | | 1672531260 | 26 | 1 | ## SLEEP_SESSION ❗**DEPRECATED** - moved to dedicated sleep endpoint * **Columns:** * `start_datetime`: Unix timestamp for the start of the sleep session (integer) * `end_datetime`: Unix timestamp for the end of the sleep session (integer) * `stages`: String of sleep stage identifiers * `quality_indicators`: String of quality indicators for each stage * **Example:** | start_datetime | end_datetime | stages | quality_indicators | | --- | --- | --- | --- | | 1672531200 | 1672560000 | 12321 | 44444 | ## BOSCH_STEP_COUNT * **Columns:** * `datetime`: Unix timestamp (integer) * `value`: Number of steps (integer) * `quality_indicator`: Always "4" * **Example:** | datetime | value | quality_indicator | | --- | --- | --- | | 1672531200 | 10 | 4 | | 1672531201 | 12 | 4 | ## STEPS_GRAPH * **Columns:** * `datetime`: Unix timestamp (integer) * `value`: Number of steps (integer) * **Example:** | datetime | value | | --- | --- | | 1672531200 | 10 | | 1672531201 | 12 | ## BOSCH_ACTIVITY_TYPE * **Columns:** * `datetime`: Unix timestamp (integer) * `value`: Bosch activity type identifier (integer) * `quality_indicator`: Always "4" * **Value Mapping:** | Value | Type | | --- | --- | | 0 | still | | 1 | walking | | 2 | running | | 3 | unknown | * **Example:** | datetime | value | quality_indicator | | --- | --- | --- | | 1672531200 | 1 | 4 | | 1672531201 | 2 | 4 | ## SYSTEM_EVENTS * **Columns:** * `datetime`: Unix timestamp (integer) * `type`: System event type identifier (integer) * `value`: Value associated with the event (integer) * **Event Code Mapping:** | Event Code | Event Type | | --- | --- | | 1 | skinContact | | 2 | crownPress | | 3 | charger | | 4 | battery | | 5 | doubleCrownPress | | *App-generated* | | | 100 | timezone | | 101 | connectionState | | 102 | batteryLevel | | 103 | chargerState | | 104 | sensorsState | | 105 | rawDataState | | 106 | syncingState | | 107 | firmwareUpdate | | 108 | connectedWatchIdentifier | * **Example:** | datetime | type | value | | --- | --- | --- | | 1672531200 | 101 | 1 | | 1672531201 | 102 | 0 | ## SKIN_CONDUCTANCE * **Columns:** * `datetime`: Unix timestamp (integer) * `value`: Skin conductance value (integer) * `quality_indicator`: Quality of the measurement (integer) * **Example:** | datetime | value | quality_indicator | | --- | --- | --- | | 1672531200 | 5 | 4 | | 1672531201 | 6 | 4 | ## RAW_ACCEL * **Columns:** * `datetime`: Unix timestamp (integer) * `value`: Hexadecimal string representing the raw accelerometer data * **Example:** | datetime | value | | --- | --- | | 1672531200 | 00AABBCCDDEEFF | | 1672531201 | 11223344556677 | ## RAW_ADC * **Columns:** * `datetime`: Unix timestamp (integer) * `value`: Hexadecimal string representing the raw ADC data * **Example:** | datetime | value | | --- | --- | | 1672531200 | 00AABBCCDDEEFF | | 1672531201 | 11223344556677 | ## RAW_PPG_GREEN * **Columns:** * `datetime`: Unix timestamp (integer) * `value`: Hexadecimal string representing the raw PPG green light data * **Example:** | datetime | value | | --- | --- | | 1672531200 | 00AABBCCDDEEFF | | 1672531201 | 11223344556677 | ## RAW_PPG_AMBIENT * **Columns:** * `datetime`: Unix timestamp (integer) * `value`: Hexadecimal string representing the raw PPG ambient light data * **Example:** | datetime | value | | --- | --- | | 1672531200 | 00AABBCCDDEEFF | | 1672531201 | 11223344556677 | ## RAW_PPG_SINGLE_GREEN * **Columns:** * `datetime`: Unix timestamp (integer) * `value`: Hexadecimal string representing the raw PPG single green light data * **Example:** | datetime | value | | --- | --- | | 1672531200 | 00AABBCCDDEEFF | | 1672531201 | 11223344556677 | ## RAW_PPG_SINGLE_AMBIENT * **Columns:** * `datetime`: Unix timestamp (integer) * `value`: Hexadecimal string representing the raw PPG single ambient light data * **Example:** | datetime | value | | --- | --- | | 1672531200 | 00AABBCCDDEEFF | | 1672531201 | 11223344556677 | ## RAW_SKIN_CONDUCTANCE * **Columns:** * `datetime`: Unix timestamp (integer) * `value`: Hexadecimal string representing the raw skin conductance data * **Example:** | datetime | value | | --- | --- | | 1672531200 | 00AABBCCDDEEFF | | 1672531201 | 11223344556677 | ## NOWATCH_ACTIVITY_TYPE * **Columns:** * `datetime`: Unix timestamp (integer) * `value`: Nowatch activity type identifier (integer) * `quality_indicator`: Quality of the measurement (integer) * `probility`: Probability of the activity type (float, formatted to 2 decimal places) * `activity_count`: Activity count (float, formatted to 4 decimal places) * **Example:** | datetime | value | quality_indicator | probility | activity_count | | --- | --- | --- | --- | --- | | 1672531200 | 1 | 4 | 0.95 | 123.4567 | | 1672531201 | 2 | 4 | 0.88 | 130.1234 | ## REACTIVITY_PEAKS * **Columns:** * `datetime`: Unix timestamp (integer) * `left_base`: Unix timestamp of the left base time (integer) * `peak`: Unix timestamp of the peak time (integer) * `right_base`: Unix timestamp of the right base time (integer) * `label`: Reactivity label for that peak (integer) * **Example:** | datetime | left_base | peak | right_base | label | | --- | --- | --- | --- | --- | | 1717977900 | 1717978200 | 1717978500 | 1717978550 | 1 | | 1717980900 | 1717981200 | 1717981500 | 1717981550 | 2 |