shell (cURL) Android (Java) Kotlin iOS (Swift) Python JavaScript (jQuery) Dart

Introduction

The Wearable API allows you to access harmonized data from data sources like Apple Health, Fitbit, Garmin, Google Fit, Samsung Health, Withings and more with a single request based on REST (JSON).

Once your users have authorized data access to their health data from wearables and connected sensors via our SDK, we start retrieving the data in the background so you can access it using this API.

The following chapters explain the Wearable API’s mechanisms and structures.

Get access to Thryve's API and integrate 500+ wearables with your appGet started

Notification webhooks

If you wish, we will proactively inform you about new or updated user data through our notification/event-trigger webhooks. Information will be sent as POST-requests to a URL (HTTPS, Port: 443) of your choice. The webhook is sent whenever

  • a new data source was connected by a user,
  • new data was added or updated, or
  • a user disconnected a data source.
  • EventTrigger Example JSON-Request

    // EventTrigger for data updates
    {
      "sourceUpdate": {
        "authenticationToken": "de3d1e068537dd927b48988cb6969abe",
        "partnerUserID": "FVMW6fp9wnUxKnfekrQduZ96Xt6gemVk",
        "dataSource": 1,
        "createdAt": "2020-02-26T16:54:30Z",
        "/v5/dailyDynamicValues": {
          "startDay": "2020-02-26",
          "endDay": "2020-02-26",
          "dailyDynamicValueTypes":[
              2000,
                2001,
                2002,
                2003
             ],
          "startTimestampUnix": 1582675200000,
          "endTimestampUnix": 1582675200000
        },
        "/v5/dynamicEpochValues": {
          "startTimestamp": "2020-02-26T12:38:00Z",
          "endTimestamp": "2020-02-26T16:55:00Z",
          "dynamicValueTypes":[
                1012,
                3000,
                3100
             ],
          "startTimestampUnix": 1582717080000,
          "endTimestampUnix": 1582736100000
        }
      }
    }
    
    // EventTrigger for connectionStatus
    {
       "sourceUpdate":{
          "authenticationToken":"de3d1e068537dd927b48988cb6969abe",
          "partnerUserID":"FVMW6fp9wnUxKnfekrQduZ96Xt6gemVk",
          "dataSource":1,
          "connectionStatus":"NEW"
       }
    }
    
    // EventTrigger for disconnectionStatus
    {
       "sourceUpdate":{
          "authenticationToken":"de3d1e068537dd927b48988cb6969abe",
          "partnerUserID":"FVMW6fp9wnUxKnfekrQduZ96Xt6gemVk",
          "dataSource":1,
          "connectionStatus":"DELETED"
       }
    }
    

    The POST-data of the EventTrigger will be sent as a JSON-String. You can find an example in the code section on the right side of our documentation.

    Webhooks can contain the following information:

    Webhook Parameter
    authenticationToken The Thryve acces token for which new data is available. Example structure: de3d1e068537dd927b48988cb6969abe
    partnerUserID The Thryve token that is connected to the accessToken. Only filled, if this was provided upon registering the accessToken.
    dataSource The data source, for which new data (or connection) is available. Example structure: 1 (e.g. Fitbit)
    createdAt String-Timestamp at which the EventTrigger message is created. Format: YYYY-MM-ddTHH:mm:ssZ (e.g. 2018-01-02T00:00:00Z)
    dailyDynamicValueTypes The ID(s) (e.g. 1000 for Steps) of daily data types which has been stored or updated. Please refer to Biomarker for a list of all available IDs.
    dynamicValueTypes The ID(s) (e.g. 1000 for Steps) of intraday data types which has been stored or updated. Please refer to Biomarker for a list of all available IDs.
    connectionStatus
    optional
    Only filled, if a data source is (dis-)connected. Possible values: NEW / DELETED
    {interface} JSON-object with the interface name that indicates which kind of data has been updated. Example structure: /v5/dailyDynamicValue
    startDay
    Daily Data Only
    Day-String for the begin of the period containing new data. Format: YYYY-MM-dd (e.g. 2018-01-01)
    endDay
    Daily Data Only
    Day-String for the end of the period containing new data. Format: YYYY-MM-dd (e.g. 2018-01-02)
    startTimestamp
    Intraday data only
    String-Timestamp for the begin of the period containing new data. Format: YYYY-MM-ddTHH:mm:ssZ (e.g. 2018-01-01T00:00:00Z)
    endTimestamp
    Intraday data only
    String-Timestamp for the end of the period containing new data. Format: YYYY-MM-ddTHH:mm:ssZ (e.g. 2018-01-01T00:00:00Z)
    startTimestampUnix Unix-Timestamp in seconds for the begin of the period containing new data. (e.g. 1514761200000)
    endTimestampUnix Unix-Timestamp in seconds for the end of the period containing new data. (e.g. 1514847600000)
    updateType
    optional
    Indicator for what type of data the update happened. Possible values: DAILY / MINUTE / BOTH

    Health Data API

    All health data API requests are structured around a modular concept of Dynamic Values. These constitute the harmonized data generated from various sources.

    DynamicEpochValues

    DynamicEpochValues represent a period that is composed through a start and end timestamp. This data type is available up to second precision. Typically, the data represent individual measurements, e.g., the heart rate measured passively by a wearable.

    The DynamicEpochValue REST-API allows for data retrieval of one user. For security reasons, the appID is placed inside the header, while other parameters are provided as POST-data.

    curl --location --request POST -u'healthapp:A7qmaxf9a' \
    --header'AppAuthorization: Basic RkVoOUhRTmFhODdjd2RiQjpOTDduVGVnUG01REt0OExyQlpQNjJIUXo2Vk5aYUd1TQ==' \
    --data-urlencode'authenticationToken=de3d1e068537dd927b48988cb6969abe' \
    --data-urlencode'startTimestampUnix=1581033600000' --data-urlencode'endTimestampUnix=1581034080000' \
    --data-urlencode'valueTypes=1000,3000' --data-urlencode'dataSources=1,8' --data-urlencode'detailed=true' \
    --data-urlencode'displayTypeName=true' --data-urlencode'displayPartnerUserID=true'\
    'https://api.und-gesund.de/v5/dynamicEpochValues'
    
    String data = "authenticationToken=de3d1e068537dd927b48988cb6969abe&"
      + "startTimestampUnix=1581033600000&endTimestampUnix=1581034080000&valueTypes=1000,3000&dataSources=1,8&detailed=true&displayTypeName=true&displayPartnerUserID=true";
    
    HttpURLConnection connection = null;
    try {
      URL url = new URL("https://api.und-gesund.de/v5/dynamicEpochValues");
      connection = (HttpURLConnection) url.openConnection();
      connection.setDoInput(true);
      connection.setDoOutput(true);
    
      connection.setRequestMethod("POST");
      connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
    
      String authorization = new String(Base64.getEncoder().encode("healthapp:A7qmaxf9a".getBytes()));
      connection.setRequestProperty("Authorization", String.format("Basic %s", authorization));
    
      String appAuthorization = new String(Base64.getEncoder().encode("FEh9HQNaa87cwdbB:NL7nTegPm5DKt8LrBZP62HQz6VNZaGuM".getBytes()));
      connection.setRequestProperty("AppAuthorization", String.format("Basic %s", appAuthorization));
    
      connection.connect();
    
      OutputStream outputStream = connection.getOutputStream();
      OutputStreamWriter outputStreamWriter = new OutputStreamWriter(outputStream, StandardCharsets.UTF_8);
      BufferedWriter bufferedWriter = new BufferedWriter(outputStreamWriter);
      bufferedWriter.write(data);
      bufferedWriter.flush(); bufferedWriter.close(); outputStream.close();
    
      if(connection.getResponseCode() == 200) {
        StringBuilder response = new StringBuilder();
        Reader inputStreamReader = new InputStreamReader(connection.getInputStream(), StandardCharsets.UTF_8);
        BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
        for(String line = bufferedReader.readLine(); line != null; line = bufferedReader.readLine()) {
          response.append(line);
        }
        System.out.println(response.toString());
      }
    } catch(IOException e) {
      e.printStackTrace();
    } finally {
      if(connection != null) {
        connection.disconnect();
      }
    }
    
    let url = URL(string: "https://api.und-gesund.de/v5/dynamicEpochValues")!
    
    var request = URLRequest(url: url)
    request.httpMethod = "POST"
    request.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
    
    let authCredentials = String("healthapp:A7qmaxf9a").data(using: String.Encoding.utf8)!.base64EncodedString()
    request.setValue("Basic \(authCredentials)", forHTTPHeaderField: "Authorization")
    
    let appAuthCredentials = String("FEh9HQNaa87cwdbB:NL7nTegPm5DKt8LrBZP62HQz6VNZaGuM").data(using: String.Encoding.utf8)!.base64EncodedString()
    request.setValue("Basic \(appAuthCredentials)", forHTTPHeaderField: "AppAuthorization")
    
    let data =
        "authenticationToken=de3d1e068537dd927b48988cb6969abe" +
        "&startTimestampUnix=1581033600000" +
        "&endTimestampUnix=1581034080000" +
        "&valueTypes=1000,3000&dataSources=1,8&detailed=true&displayTypeName=true&displayPartnerUserID=true"
    request.httpBody = NSMutableData(data: String(data).data(using: String.Encoding.utf8)!) as Data
    
    let task = URLSession(configuration: URLSessionConfiguration.default).dataTask(with: request) {(data, response, error) in
        if let httpResponse = response as? HTTPURLResponse {
            if httpResponse.statusCode == 200 {
                print(String(data: data!, encoding: .utf8)!)
            }
        }
    }
    task.resume()
    
    import json, requests, base64
    
    headers = {
        'content-type': 'application/x-www-form-urlencoded',
        'Authorization': 'Basic %s' % b64encode('healthapp:A7qmaxf9a').decode('utf-8'),
        'AppAuthorization': 'Basic %s' % b64encode('FEh9HQNaa87cwdbB:NL7nTegPm5DKt8LrBZP62HQz6VNZaGuM').decode('utf-8'),
        'appID': 'FEh9HQNaa87cwdbB'
    }
    params = {
        'authenticationToken': 'de3d1e068537dd927b48988cb6969abe'
        'startTimestampUnix': '1581033600000',
        'endTimestampUnix': '1581034080000',
        'valueTypes': '1000,3000',
        'dataSources': '1,8',
        'detailed': 'true',
        'displayTypeName':'true',
        'displayPartnerUserID':'true'
    }
    
    r = requests.post(
        'https://api.und-gesund.de/v5/dynamicEpochValues',
        params = params,
        headers = headers
    )
    
    if r.status_code == 200:
        print(r.text)
    
    $(function() {
        var formData = {
            authenticationToken: 'de3d1e068537dd927b48988cb6969abe',
            startTimestampUnix: '1581033600000',
            endTimestampUnix: '1581034080000',
            valueTypes: '1000,3000',
            dataSources: '1,8',
            detailed: 'true',
            displayTypeName:'true',
            displayPartnerUserID='true'
        };
    
        $.ajax({
            url : 'https://api.und-gesund.de/v5/dynamicEpochValues',
            type: 'POST',
            headers: {
                'Content-Type': 'application/x-www-form-urlencoded',
                'Authorization': 'Basic ' + btoa('healthapp:A7qmaxf9a'),
                'AppAuthorization': 'Basic ' + btoa('FEh9HQNaa87cwdbB:NL7nTegPm5DKt8LrBZP62HQz6VNZaGuM'),
                'appID': 'FEh9HQNaa87cwdbB'
            },
            data : formData,
            statusCode: {
                200: function (data, textStatus, xhr) {
                    console.log(xhr.responseText);
                }
            }
        });
    });
    
    post
    https://api.und-gesund.de/v5/dynamicEpochValues
    Header Parameter
    Authorization
    required
    (Basic Auth) username:password
    AppAuthorization
    required
    (Basic Auth) appID:appSecret
    Query Parameter
    authenticationToken
    required
    The Thryve access token generated for the respective user. Example structure: de3d1e068537dd927b48988cb6969abe
    createdAfterUnix The data set to be retrieved ranging from the current time (now) back to createdAfter timestamp in Unix-timestamp format. The value can be a maximum of 30 days prior to the current time (now).
    startTimestamp The start time for the data period to be retrieved. Structure: YYYY-MM-ddTHH:mm:ss+XX:XX (e.g., 2020-02-04T00:00:00+01:00)
    endTimestamp The end time for the data period to be retrieved. Structure: YYYY-MM-ddTHH:mm:ss+XX:XX (e.g., 2020-02-04T00:00:00+01:00)
    startTimestampUnix The start time in Unix-timestamp format for the data period to be retrieved. (e.g., 1580808640000)
    endTimestampUnix The end time in Unix-timestamp format for the data period to be retrieved. (e.g., 1580808640000)
    dataSources
    optional
    Restricts response to specific data sources when providing Thryve data source ID, combinable with ',' (comma separated). Example structure: 1 (for, e.g., Fitbit)
    valueTypes
    optional
    Restricts the values in response to single valueTypes when providing Thryve DataTypeID, combinable with ',' (comma separated)
    Example structure: 1000 (for, e.g., Steps)
    detailed
    optional
    If set to true, additional recording information will be added to the response, if available.
    displayPartnerUserID
    optional
    If set to true, the specific PartnerUserID will be displayed in the response.
    displayTypeName
    optional
    If set to true, the specific data type name (STRING) will be displayed in the response.

    Response

    Response Codes Description
    200 Request successful
    4xx error code


    Example JSON-Response

    [
      {
        "authenticationToken": "de3d1e068537dd927b48988cb6969abe",
        "partnerUserID": "thryveuser001",
        "dataSources": [
          {
            "dataSource": 8,
            "data": [
              {
                "startTimestampUnix": 1581033600000,
                "endTimestampUnix": 1581033660000,
                "createdAtUnix": 1583226072452,
                "dynamicValueType": 3000,
                "dynamicValueTypeName": "HeartRate",
                "details": {
                  "medicalGrade": "true"
                },
                "value": "53",
                "valueType": "LONG"
              },
              {
                "startTimestampUnix": 1581034020000,
                "endTimestampUnix": 1581034080000,
                "createdAtUnix": 1583226472452,
                "dynamicValueType": 3000,
                "dynamicValueTypeName": "HeartRate",
                "details": {
                  "medicalGrade": "true"
                },
                "value": "67",
                "valueType": "LONG"
              }
            ]
          }
        ]
      }
    ]
    
    Response Parameter
    authenticationToken The access token (e.g. de3d1e068537dd927b48988cb6969abe) of the requested user
    dataSource The ID (e.g. 1 for Fitbit) of the respective value source
    createdAtUnix Date & time information on when the data point is created or updated in the Thryve data warehouse
    startTimestamp Start date & time
    endTimestamp End date & time
    startTimestampUnix Start date & time information in Unix-timestamp format
    endTimestampUnix End date & time information in Unix-timestamp format
    dynamicValueType The DataTypeID (e.g. 1000 for Steps)
    details Optional JSON-object containing additional recording information, if available and requested
    value Contained information
    valueType
    optional
    The type of value provided (Long, Double, String, Date, Boolean)

    DailyDynamicValues

    DailyDynamicValues represent a direct relation of one day as one value. Due to the nature of this data type, only one data point can exist per Thryve Biomarker per day. DailyDynamicValues can be, e.g., the sum of all steps a person took in a day. The value (e.g. the daily steps) of DailyDynamicValues are updated throughout a day.

    The DailyDynamicValue REST-API allows for data retrieval of one user. For security reasons, the appID is placed inside the header, while other parameters are provided as POST-data.

    curl --location --request POST -u'healthapp:A7qmaxf9a' \
    --header'AppAuthorization: Basic RkVoOUhRTmFhODdjd2RiQjpOTDduVGVnUG01REt0OExyQlpQNjJIUXo2Vk5aYUd1TQ==' \
    --data-urlencode'authenticationToken=de3d1e068537dd927b48988cb6969abe' \
    --data-urlencode'startTimestampUnix=1580774400000' --data-urlencode'endTimestampUnix=1580860800000' \
    --data-urlencode'valueTypes=1000' --data-urlencode'dataSources=1' --data-urlencode'detailed=true' \
    --data-urlencode'displayPartnerUserID=true' --data-urlencode'displayTypeName=true'
    'https://api.und-gesund.de/v5/dailyDynamicValues'
    
    String data = "authenticationToken=de3d1e068537dd927b48988cb6969abe&"
      + "startTimestampUnix=1580774400000&endTimestampUnix=1580860800000&valueTypes=1000&dataSources=1&detailed=true&displayTypeName=true&displayPartnerUserID=true";
    
    HttpURLConnection connection = null;
    try {
      URL url = new URL("https://api.und-gesund.de/v5/dailyDynamicValues");
      connection = (HttpURLConnection) url.openConnection();
      connection.setDoInput(true);
      connection.setDoOutput(true);
    
      connection.setRequestMethod("POST");
      connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
    
      String authorization = new String(Base64.getEncoder().encode("healthapp:A7qmaxf9a".getBytes()));
      connection.setRequestProperty("Authorization", String.format("Basic %s", authorization));
    
      String appAuthorization = new String(Base64.getEncoder().encode("FEh9HQNaa87cwdbB:NL7nTegPm5DKt8LrBZP62HQz6VNZaGuM".getBytes()));
      connection.setRequestProperty("AppAuthorization", String.format("Basic %s", appAuthorization));
    
      connection.connect();
    
      OutputStream outputStream = connection.getOutputStream();
      OutputStreamWriter outputStreamWriter = new OutputStreamWriter(outputStream, StandardCharsets.UTF_8);
      BufferedWriter bufferedWriter = new BufferedWriter(outputStreamWriter);
      bufferedWriter.write(data);
      bufferedWriter.flush(); bufferedWriter.close(); outputStream.close();
    
      if(connection.getResponseCode() == 200) {
        StringBuilder response = new StringBuilder();
        Reader inputStreamReader = new InputStreamReader(connection.getInputStream(), StandardCharsets.UTF_8);
        BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
        for(String line = bufferedReader.readLine(); line != null; line = bufferedReader.readLine()) {
          response.append(line);
        }
        System.out.println(response.toString());
      }
    } catch(IOException e) {
      e.printStackTrace();
    } finally {
      if(connection != null) {
        connection.disconnect();
      }
    }
    
    let url = URL(string: "https://api.und-gesund.de/v5/dailyDynamicValues")!
    
    var request = URLRequest(url: url)
    request.httpMethod = "POST"
    request.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
    
    let authCredentials = String("healthapp:A7qmaxf9a").data(using: String.Encoding.utf8)!.base64EncodedString()
    request.setValue("Basic \(authCredentials)", forHTTPHeaderField: "Authorization")
    
    let appAuthCredentials = String("FEh9HQNaa87cwdbB:NL7nTegPm5DKt8LrBZP62HQz6VNZaGuM").data(using: String.Encoding.utf8)!.base64EncodedString()
    request.setValue("Basic \(appAuthCredentials)", forHTTPHeaderField: "AppAuthorization")
    
    let data =
        "authenticationToken=de3d1e068537dd927b48988cb6969abe" +
        "&startTimestampUnix=1580774400000" +
        "&endTimestampUnix=1580860800000" +
        "&valueTypes=1000&dataSources=1&detailed=true&displayTypeName=true&displayPartnerUserID=true"
    request.httpBody = NSMutableData(data: String(data).data(using: String.Encoding.utf8)!) as Data
    
    let task = URLSession(configuration: URLSessionConfiguration.default).dataTask(with: request) {(data, response, error) in
        if let httpResponse = response as? HTTPURLResponse {
            if httpResponse.statusCode == 200 {
                print(String(data: data!, encoding: .utf8)!)
            }
        }
    }
    task.resume()
    
    import json, requests, base64
    
    headers = {
        'content-type': 'application/x-www-form-urlencoded',
        'Authorization': 'Basic %s' % b64encode('healthapp:A7qmaxf9a').decode('utf-8'),
        'AppAuthorization': 'Basic %s' % b64encode('FEh9HQNaa87cwdbB:NL7nTegPm5DKt8LrBZP62HQz6VNZaGuM').decode('utf-8'),
        'appID': 'FEh9HQNaa87cwdbB'
    }
    params = {
        'authenticationToken': 'de3d1e068537dd927b48988cb6969abe'
        'startTimestampUnix': '1580774400000',
        'endTimestampUnix': '1580860800000',
        'valueTypes': 1000,
        'dataSources': 1,
        'detailed': 'true',
        'displayTypeName':'true',
        'displayPartnerUserID':'true'
    }
    
    r = requests.post(
        'https://api.und-gesund.de/v5/dailyDynamicValues',
        params = params,
        headers = headers
    )
    
    if r.status_code == 200:
        print(r.text)
    
    $(function() {
        var formData = {
            authenticationToken: 'de3d1e068537dd927b48988cb6969abe',
            startTimestamp: '1580774400000',
            endTimestamp: '1580860800000',
            valueTypes: '1000',
            dataSources: '1',
            detailed: 'true',
            displayTypeName:'true',
            displayPartnerUserID='true'
        };
    
        $.ajax({
            url : 'https://api.und-gesund.de/v5/dailyDynamicValues',
            type: 'POST',
            headers: {
                'Content-Type': 'application/x-www-form-urlencoded',
                'Authorization': 'Basic ' + btoa('healthapp:A7qmaxf9a'),
                'AppAuthorization': 'Basic ' + btoa('FEh9HQNaa87cwdbB:NL7nTegPm5DKt8LrBZP62HQz6VNZaGuM'),
                'appID': 'FEh9HQNaa87cwdbB'
            },
            data : formData,
            statusCode: {
                200: function (data, textStatus, xhr) {
                    console.log(xhr.responseText);
                }
            }
        });
    });
    
    post
    https://api.und-gesund.de/v5/dailyDynamicValues
    Header Parameter
    Authorization
    required
    (Basic Auth) username:password
    AppAuthorization
    required
    (Basic Auth) appID:appSecret
    Query Parameter
    authenticationToken
    required
    The Thryve access token generated for the respective user. Example structure: de3d1e068537dd927b48988cb6969abe
    createdAfterUnix The data set to be retrieved ranging from the current time (now) back to createdAfter timestamp in Unix-timestamp format. The value can be a maximum of 364 days prior to the current time (now).
    startDay The start time for the data set to be retrieved. Structure YYYY-MM-dd (e.g. 2020-02-04)
    endDay The end time for the data set to be retrieved. Structure: YYYY-MM-dd (e.g. 2020-02-05
    startTimestampUnix The start time in Unix-timestamp format for the data period to be retrieved. (e.g., 1580774400000)
    endTimestampUnix The end time in Unix-timestamp format for the data period to be retrieved. (e.g., 1580808640000)
    dataSources
    optional
    Restricts response to specific data sources when providing Thryve data source ID, combinable with ',' (comma separated). Example structure: 1 (for, e.g., Fitbit)
    valueTypes
    optional
    Restricts the values in response to single valueTypes when providing Thryve DataTypeID, combinable with ',' (comma separated)
    Example structure: 1000 (for, e.g., Steps)
    detailed
    optional
    If set to true, additional recording information will be added to the response, if available.
    displayPartnerUserID
    optional
    If set to true, the specific PartnerUserID will be displayed in the response.
    displayTypeName
    optional
    If set to true, the specific data type name (STRING) will be displayed in the response.

    Response

    Response Codes Description
    200 Request successful
    4xx error code


    Example JSON-Response

    [
      {
        "authenticationToken": "de3d1e068537dd927b48988cb6969abe",
        "partnerUserID": "thryveuser001",
        "dataSources": [
          {
            "dataSource": 1,
            "data": [
              {
                "createdAt": 1581774400000,
                "details": {
                  "timezoneOffset": 60
                },
                "timestampUnix": 1580774400000,
                "dailyDynamicValueType": 1000,
                "dailyDynamicValueTypeName": "Steps",
                "value": "9840",
                "valueType": "LONG"
              },
              {
                "createdAt": 1582774400000,
                "details": {
                  "timezoneOffset": 60
                },
                "timestampUnix": 1580874400000,
                "dailyDynamicValueType": 1000,
                "dailyDynamicValueTypeName": "Steps",
                "value": "12195",
                "valueType": "LONG"
              }
            ]
          }
        ]
      }
    ]
    
    Response Parameter
    authenticationToken The access token (e.g. de3d1e068537dd927b48988cb6969abe) of the requested user
    dataSource The ID (e.g. 1 for Fitbit) of the respective value source
    createdAtUnix Date & time information on when the data point is created or updated in the Thryve data warehouse
    day Day information in YYYY-MM-DD
    timestampUnix Day information in Unix-timestamp format
    dailyDynamicValueType The DataTypeID (e.g. 1000 for Steps)
    details Optional JSON-object containing additional recording information, if available and requested
    value Contained information
    valueType The type of value provided (Long, Double, String, Date, Boolean)

    UserInformation

    Retrieval

    With the retrieval of UserInformation, you can get to know basic time-independent information about your connected users. The information can include biological data, as well as information of connected data source(s) and its associated device(s). Access to the UserInformation-interface can be achieved for single or multiple users.

    curl --location --request POST -u'healthapp:A7qmaxf9a' \
    --header'AppAuthorization: Basic RkVoOUhRTmFhODdjd2RiQjpOTDduVGVnUG01REt0OExyQlpQNjJIUXo2Vk5aYUd1TQ==' \
    --data-urlencode'authenticationToken=de3d1e068537dd927b48988cb6969abe,4b52uhm7uhdaesenbrwg6xbdr4mm4t8c' \
    'https://api.und-gesund.de/v5/userInformation'
    
    HttpURLConnection connection = null;
    try {
        URL url = new URL("https://api.und-gesund.de/v5/userInformation");
        connection = (HttpURLConnection) url.openConnection();
        connection.setDoInput(true);
        connection.setDoOutput(true);
    
        connection.setRequestMethod("POST");
        connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
    
        String authorization = new String(Base64.getEncoder().encode("healthapp:A7qmaxf9a".getBytes()));
        connection.setRequestProperty("Authorization", "Basic " + authorization);
    
        String appAuthorization = new String(Base64.getEncoder().encode("FEh9HQNaa87cwdbB:NL7nTegPm5DKt8LrBZP62HQz6VNZaGuM".getBytes()));
        connection.setRequestProperty("AppAuthorization", String.format("Basic %s", appAuthorization));
    
        connection.connect();
    
        OutputStream outputStream = connection.getOutputStream();
        OutputStreamWriter outputStreamWriter = new OutputStreamWriter(outputStream, StandardCharsets.UTF_8);
        BufferedWriter bufferedWriter = new BufferedWriter(outputStreamWriter);
        bufferedWriter.write("authenticationToken=de3d1e068537dd927b48988cb6969abe,4b52uhm7uhdaesenbrwg6xbdr4mm4t8c");
        bufferedWriter.flush(); bufferedWriter.close(); outputStream.close();
    
        if(connection.getResponseCode() == 200) {
            StringBuilder response = new StringBuilder();
            Reader inputStreamReader = new InputStreamReader(connection.getInputStream(), StandardCharsets.UTF_8);
            BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
            for(String line = bufferedReader.readLine(); line != null; line = bufferedReader.readLine()) {
                response.append(line);
            }
            System.out.println(response.toString());
        }
    } catch(IOException e) {
        e.printStackTrace();
    } finally {
        if(connection != null) {
            connection.disconnect();
        }
    }
    
    import UIKit
    
    let url = URL(string: "https://api.und-gesund.de/v5/userInformation")!
    
    var request = URLRequest(url: url)
    request.httpMethod = "POST"
    request.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
    
    let authCredentials = String("healthapp:A7qmaxf9a").data(using: String.Encoding.utf8)!.base64EncodedString()
    request.setValue("Basic \(authCredentials)", forHTTPHeaderField: "Authorization")
    
    let appAuthCredentials = String("FEh9HQNaa87cwdbB:NL7nTegPm5DKt8LrBZP62HQz6VNZaGuM").data(using: String.Encoding.utf8)!.base64EncodedString()
    request.setValue("Basic \(appAuthCredentials)", forHTTPHeaderField: "AppAuthorization")
    
    let data = "authenticationToken=de3d1e068537dd927b48988cb6969abe,4b52uhm7uhdaesenbrwg6xbdr4mm4t8c"
    request.httpBody = NSMutableData(data: String(data).data(using: String.Encoding.utf8)!) as Data
    
    let task = URLSession(configuration: URLSessionConfiguration.default).dataTask(with: request) {(data, response, error) in
        if let httpResponse = response as? HTTPURLResponse {
            if httpResponse.statusCode == 200 {
                print(String(data: data!, encoding: .utf8)!)
            }
        }
    }
    task.resume()
    
    
    import json, requests, base64
    
    headers = {
        'content-type': 'application/x-www-form-urlencoded',
        'Authorization': 'Basic %s' % base64.b64encode('healthapp:A7qmaxf9a'),
        'AppAuthorization': 'Basic %s' % base64.b64encode('FEh9HQNaa87cwdbB:NL7nTegPm5DKt8LrBZP62HQz6VNZaGuM'),
        'appID': 'FEh9HQNaa87cwdbB'
    }
    params = { 'authenticationToken': 'de3d1e068537dd927b48988cb6969abe,4b52uhm7uhdaesenbrwg6xbdr4mm4t8c' }
    
    r = requests.post(
        'https://api.und-gesund.de/v5/userInformation',
        params = params,
        headers = headers
    )
    
    if r.status_code == 200:
        print r.text
    
    $(function () {
      var formData = {
        authenticationToken:
          "de3d1e068537dd927b48988cb6969abe,4b52uhm7uhdaesenbrwg6xbdr4mm4t8c",
      };
    
      $.ajax({
        url: "https://api.und-gesund.de/v5/userInformation",
        type: "POST",
        headers: {
          "Content-Type": "application/x-www-form-urlencoded",
          Authorization: "Basic " + btoa("healthapp:A7qmaxf9a"),
          AppAuthorization:
            "Basic " + btoa("FEh9HQNaa87cwdbB:NL7nTegPm5DKt8LrBZP62HQz6VNZaGuM"),
          appID: "FEh9HQNaa87cwdbB",
        },
        data: formData,
        statusCode: {
          200: function (data) {
            console.log(data.responseText);
          },
        },
      });
    });
    
    post
    https://api.und-gesund.de/v5/userInformation
    Header Parameter
    Authorization
    required
    (Basic Auth) username:password
    AppAuthorization
    required
    (Basic Auth) appID:appSecret
    Query Parameter
    authenticationToken
    required
    The access token of the requested user (e.g. de3d1e068537dd927b48988cb6969abe). The tokens requested can be combined with ',' (comma separated).

    Response

    Response Codes Description
    200 Request successful
    4xx error code

    Example JSON-Response

    [
      {
        "authenticationToken": "de3d1e068537dd927b48988cb6969abe",
        "partnerUserID": "FVMW6fp9wnUxKnfekrQduZ96Xt6gemVk",
        "height": 180,
        "weight": 80.0,
        "birthdate": "1990-01-01",
        "gender": "male",
        "connectedSources": [
          {
            "dataSource": 1,
            "connectedAt": "2020-02-21T10:27:07+01:00"
          },
          {
            "dataSource": 8,
            "connectedAt": "2020-01-21T10:27:07+01:00"
          }
        ],
        "devices": [
          {
            "datasource": 1,
            "deviceName": "Versa 3",
            "connectedAt": "2022-03-18T21:41:02+01:00",
            "configuration": {
              "battery": "Medium",
              "deviceVersion": "Versa 3",
              "id": "2016125859",
              "lastSyncTime": "2022-03-18T21:41:02",
              "type": "TRACKER"
            }
          },
          {
            "datasource": 8,
            "deviceName": "ScanWatch",
            "connectedAt": "2020-01-21T10:27:07+01:00",
            "configuration": {
              "type": "Activity Tracker",
              "model": "ScanWatch",
              "model_id": "93",
              "battery": "high",
              "deviceid": "cea01c1f4fb14e69b007ac2dadf77e3efa3db40f",
              "timezone": "Europe/Berlin",
              "last_session_date": 1656157718
            }
          }
        ]
      },
      {
        "authenticationToken": "4b52uhm7uhdaesenbrwg6xbdr4mm4t8c",
        "partnerUserID": "FVMW6fp9wnUxKnfekrQduZ96Xt6gemVk",
        "height": 160,
        "weight": 44.0,
        "birthdate": "1992-02-02",
        "gender": "female",
        "connectedSources": [
          {
            "dataSource": 1,
            "connectedAt": "2021-12-23T13:41:53Z"
          }
        ],
        "devices": [
          {
            "datasource": 1,
            "deviceName": "Versa 3",
            "connectedAt": "2020-01-21T10:27:07+01:00",
            "configuration": {
              "battery": "Medium",
              "deviceVersion": "Versa 3",
              "id": "2016125859",
              "lastSyncTime": "2022-03-18T21:41:02",
              "type": "TRACKER"
            }
          }
        ]
      }
    ]
    
    Response Parameter
    authenticationToken The access token (e.g. de3d1e068537dd927b48988cb6969abe) of the requested user(s)
    partnerUserID The Thryve user token of the requested user (e.g. FVMW6fp9wnUxKnfekrQduZ96Xt6gemVk), null if not set
    height Height in cm (Integer), null if no value stored
    weight Weight in kg (Double), null if no value stored
    birthdate Birthdate in YYYY-MM-dd format as String (e.g., 1990-01-01), null if no value stored
    gender Biological gender information (i.e. male, female, or genderless), null if no value stored
    connectedSources JSON-Array of the IDs of the connected Thryve data sources as well as the connection time
    dataSource The ID (e.g. 1 for Fitbit) of the respective value source
    connectedAt Date and time when the user connected the respective source
    devices information on the connected device model(s) of the respective data source
    dataSource The ID (e.g. 1 for Fitbit) of the respective value source
    deviceName The name of device model of the respective data source
    connectedAt Date and time when the user connected the respective source
    configuration The device configuration of the respective model

    Deletion

    You can delete your users via the UserInformation-interface. The interface allows you to delete entire end-user accounts with their generated access tokens and other data, i.e. UserInformation, DailyDynamicValues and DynamicEpochValues.

    By addressing the UserInformation-interface with the DELETE method, single or multiple users are added to a deletion queue that will be processed asynchronously by the Thryve backend. The access values are as followed:

    curl --location --request DELETE -u'healthapp:A7qmaxf9a' \
    --header'AppAuthorization: Basic RkVoOUhRTmFhODdjd2RiQjpOTDduVGVnUG01REt0OExyQlpQNjJIUXo2Vk5aYUd1TQ==' \
    --data-urlencode'authenticationToken=de3d1e068537dd927b48988cb6969abe,4b52uhm7uhdaesenbrwg6xbdr4mm4t8c' --data-urlencode'deletionDate=2020-09-09T00:00:00Z' \
    'https://api.und-gesund.de/v5/userInformation'
    
    HttpURLConnection connection = null;
    try {
        URL url = new URL("https://api.und-gesund.de/v5/userInformation");
        connection = (HttpURLConnection) url.openConnection();
        connection.setDoInput(true);
        connection.setDoOutput(true);
    
        connection.setRequestMethod("DELETE");
        connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
    
        String authorization = new String(Base64.getEncoder().encode("healthapp:A7qmaxf9a".getBytes()));
        connection.setRequestProperty("Authorization", "Basic " + authorization);
    
        String appAuthorization = new String(Base64.getEncoder().encode("FEh9HQNaa87cwdbB:NL7nTegPm5DKt8LrBZP62HQz6VNZaGuM".getBytes()));
        connection.setRequestProperty("AppAuthorization", String.format("Basic %s", appAuthorization));
    
        connection.connect();
    
        OutputStream outputStream = connection.getOutputStream();
        OutputStreamWriter outputStreamWriter = new OutputStreamWriter(outputStream, StandardCharsets.UTF_8);
        BufferedWriter bufferedWriter = new BufferedWriter(outputStreamWriter);
        bufferedWriter.write("authenticationToken=de3d1e068537dd927b48988cb6969abe,4b52uhm7uhdaesenbrwg6xbdr4mm4t8c");
        bufferedWriter.write("deletionDate=2020-09-09T00:00:00Z");
        bufferedWriter.flush(); bufferedWriter.close(); outputStream.close();
    
        if(connection.getResponseCode() == 204) {
            StringBuilder response = new StringBuilder();
            Reader inputStreamReader = new InputStreamReader(connection.getInputStream(), StandardCharsets.UTF_8);
            BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
            for(String line = bufferedReader.readLine(); line != null; line = bufferedReader.readLine()) {
                response.append(line);
            }
            System.out.println(response.toString());
        }
    } catch(IOException e) {
        e.printStackTrace();
    } finally {
        if(connection != null) {
            connection.disconnect();
        }
    }
    
    import UIKit
    
    let url = URL(string: "https://api.und-gesund.de/v5/userInformation")!
    
    var request = URLRequest(url: url)
    request.httpMethod = "DELETE"
    request.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
    
    let authCredentials = String("healthapp:A7qmaxf9a").data(using: String.Encoding.utf8)!.base64EncodedString()
    request.setValue("Basic \(authCredentials)", forHTTPHeaderField: "Authorization")
    
    let appAuthCredentials = String("FEh9HQNaa87cwdbB:NL7nTegPm5DKt8LrBZP62HQz6VNZaGuM").data(using: String.Encoding.utf8)!.base64EncodedString()
    request.setValue("Basic \(appAuthCredentials)", forHTTPHeaderField: "AppAuthorization")
    
    let data = "authenticationToken=de3d1e068537dd927b48988cb6969abe,4b52uhm7uhdaesenbrwg6xbdr4mm4t8c"
    request.httpBody = NSMutableData(data: String(data).data(using: String.Encoding.utf8)!) as Data
    
    let data = "deletionDate=2020-09-09T00:00:00Z"
    request.httpBody = NSMutableData(data: String(data).data(using: String.Encoding.utf8)!) as Data
    
    let task = URLSession(configuration: URLSessionConfiguration.default).dataTask(with: request) {(data, response, error) in
        if let httpResponse = response as? HTTPURLResponse {
            if httpResponse.statusCode == 204 {
                print(String(data: data!, encoding: .utf8)!)
            }
        }
    }
    task.resume()
    
    
    import json, requests, base64
    
    headers = {
        'content-type': 'application/x-www-form-urlencoded',
        'Authorization': 'Basic %s' % base64.b64encode('healthapp:A7qmaxf9a'),
        'AppAuthorization': 'Basic %s' % base64.b64encode('FEh9HQNaa87cwdbB:NL7nTegPm5DKt8LrBZP62HQz6VNZaGuM')
    }
    params = {
        'authenticationToken': 'de3d1e068537dd927b48988cb6969abe,4b52uhm7uhdaesenbrwg6xbdr4mm4t8c'
        'deletionDate': '2020-09-09T00:00:00Z'
    }
    
    r = requests.delete(
        'https://api.und-gesund.de/v5/userInformation',
        params = params,
        headers = headers
    )
    
    if r.status_code == 204:
        print r.text
    
    $(function() {
        var formData = {
            authenticationToken: 'de3d1e068537dd927b48988cb6969abe,4b52uhm7uhdaesenbrwg6xbdr4mm4t8c'
            deletionDate: '2020-09-09T00:00:00Z'
        };
    
        $.ajax({
            url : 'https://api.und-gesund.de/v5/userInformation',
            type: 'DELETE',
            headers: {
                'Content-Type': 'application/x-www-form-urlencoded',
                'Authorization': 'Basic ' + btoa('healthapp:A7qmaxf9a'),
                'AppAuthorization': 'Basic ' + btoa('FEh9HQNaa87cwdbB:NL7nTegPm5DKt8LrBZP62HQz6VNZaGuM')
            },
            data : formData,
            statusCode: {
                204: function (data) {
                    console.log(data.responseText);
                }
            }
        });
    });
    
    delete
    https://api.und-gesund.de/v5/userInformation
    Header Parameter
    Authorization
    required
    (Basic Auth) username:password
    AppAuthorization
    required
    (Basic Auth) appID:appSecret
    Query Parameter
    authenticationToken
    required
    The access token of the requested user (e.g. de3d1e068537dd927b48988cb6969abe). The tokens requested can be combined with ',' (comma separated).
    deletionDate
    optional
    Desired deletion date in YYYY-MM-ddTHH:mm:ssZ format as String (e.g. 2020-09-09T00:00:00Z). Users will not be deleted before this date. If not available, the deletionDate will be set to seven days in the future from the interface execution time.

    Response

    Response Codes Description
    204 Successfully added to deletion list
    4xx error code

    API extensions

    DataAvailability (deprecated)

    The DataAvailability interface allows you to retrieve overarching/high-level information on data generated by your connected users. This can include information like how many DynamicEpochValues are stored for a specific user. You can access the DataAvailability-interface for individual users.

    curl --location --request POST -u'healthapp:A7qmaxf9a' \
    --header'AppAuthorization: Basic RkVoOUhRTmFhODdjd2RiQjpOTDduVGVnUG01REt0OExyQlpQNjJIUXo2Vk5aYUd1TQ==' \
    --data-urlencode'authenticationToken=de3d1e068537dd927b48988cb6969abe,4b52uhm7uhdaesenbrwg6xbdr4mm4t8c' \
    'https://api.und-gesund.de/v5/dataAvailability'
    
    HttpURLConnection connection = null;
    try {
        URL url = new URL("https://api.und-gesund.de/v5/dataAvailability");
        connection = (HttpURLConnection) url.openConnection();
        connection.setDoInput(true);
        connection.setDoOutput(true);
    
        connection.setRequestMethod("POST");
        connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
    
        String authorization = new String(Base64.getEncoder().encode("healthapp:A7qmaxf9a".getBytes()));
        connection.setRequestProperty("Authorization", "Basic " + authorization);
    
        String appAuthorization = new String(Base64.getEncoder().encode("FEh9HQNaa87cwdbB:NL7nTegPm5DKt8LrBZP62HQz6VNZaGuM".getBytes()));
        connection.setRequestProperty("AppAuthorization", String.format("Basic %s", appAuthorization));
    
        connection.connect();
    
        OutputStream outputStream = connection.getOutputStream();
        OutputStreamWriter outputStreamWriter = new OutputStreamWriter(outputStream, StandardCharsets.UTF_8);
        BufferedWriter bufferedWriter = new BufferedWriter(outputStreamWriter);
        bufferedWriter.write("authenticationToken=de3d1e068537dd927b48988cb6969abe,4b52uhm7uhdaesenbrwg6xbdr4mm4t8c");
        bufferedWriter.flush(); bufferedWriter.close(); outputStream.close();
    
        if(connection.getResponseCode() == 200) {
            StringBuilder response = new StringBuilder();
            Reader inputStreamReader = new InputStreamReader(connection.getInputStream(), StandardCharsets.UTF_8);
            BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
            for(String line = bufferedReader.readLine(); line != null; line = bufferedReader.readLine()) {
                response.append(line);
            }
            System.out.println(response.toString());
        }
    } catch(IOException e) {
        e.printStackTrace();
    } finally {
        if(connection != null) {
            connection.disconnect();
        }
    }
    
    import UIKit
    
    let url = URL(string: "https://api.und-gesund.de/v5/dataAvailability")!
    
    var request = URLRequest(url: url)
    request.httpMethod = "POST"
    request.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
    
    let authCredentials = String("healthapp:A7qmaxf9a").data(using: String.Encoding.utf8)!.base64EncodedString()
    request.setValue("Basic \(authCredentials)", forHTTPHeaderField: "Authorization")
    
    let appAuthCredentials = String("FEh9HQNaa87cwdbB:NL7nTegPm5DKt8LrBZP62HQz6VNZaGuM").data(using: String.Encoding.utf8)!.base64EncodedString()
    request.setValue("Basic \(appAuthCredentials)", forHTTPHeaderField: "AppAuthorization")
    
    let data = "authenticationToken=de3d1e068537dd927b48988cb6969abe,4b52uhm7uhdaesenbrwg6xbdr4mm4t8c"
    request.httpBody = NSMutableData(data: String(data).data(using: String.Encoding.utf8)!) as Data
    
    let task = URLSession(configuration: URLSessionConfiguration.default).dataTask(with: request) {(data, response, error) in
        if let httpResponse = response as? HTTPURLResponse {
            if httpResponse.statusCode == 200 {
                print(String(data: data!, encoding: .utf8)!)
            }
        }
    }
    task.resume()
    
    
    import json, requests, base64
    
    headers = {
        'content-type': 'application/x-www-form-urlencoded',
        'Authorization': 'Basic %s' % base64.b64encode('healthapp:A7qmaxf9a'),
        'AppAuthorization': 'Basic %s' % base64.b64encode('FEh9HQNaa87cwdbB:NL7nTegPm5DKt8LrBZP62HQz6VNZaGuM'),
        'appID': 'FEh9HQNaa87cwdbB'
    }
    params = { 'authenticationToken': 'de3d1e068537dd927b48988cb6969abe,4b52uhm7uhdaesenbrwg6xbdr4mm4t8c' }
    
    r = requests.post(
        'https://api.und-gesund.de/v5/dataAvailability',
        params = params,
        headers = headers
    )
    
    if r.status_code == 200:
        print r.text
    
    $(function () {
      var formData = {
        authenticationToken:
          "de3d1e068537dd927b48988cb6969abe,4b52uhm7uhdaesenbrwg6xbdr4mm4t8c",
      };
    
      $.ajax({
        url: "https://api.und-gesund.de/v5/dataAvailability",
        type: "POST",
        headers: {
          "Content-Type": "application/x-www-form-urlencoded",
          Authorization: "Basic " + btoa("healthapp:A7qmaxf9a"),
          AppAuthorization:
            "Basic " + btoa("FEh9HQNaa87cwdbB:NL7nTegPm5DKt8LrBZP62HQz6VNZaGuM"),
          appID: "FEh9HQNaa87cwdbB",
        },
        data: formData,
        statusCode: {
          200: function (data) {
            console.log(data.responseText);
          },
        },
      });
    });
    
    post
    https://api.und-gesund.de/v5/dataAvailability
    Header Parameter
    Authorization
    required
    (Basic Auth) username:password
    AppAuthorization
    required
    (Basic Auth) appID:appSecret
    Query Parameter
    authenticationToken
    required
    The access token of the requested user (e.g. de3d1e068537dd927b48988cb6969abe). The tokens requested can be combined with ',' (comma separated).

    Response

    Response Codes Description
    200 Request successful
    4xx error code

    Example JSON-Response

    [
      {
        "authenticationToken": "de3d1e068537dd927b48988cb6969abe",
        "dataAvailability": [
          {
            "dataSource": 8,
            "dynamicEpochValues": {
              "total": 0,
              "earliestTimestamp": "2018-09-23T10:20:00Z",
              "latestTimestamp": "2019-03-29T16:44:00Z"
            },
            "dailyDynamicValues": {
              "total": 2777,
              "earliestTimestamp": "2018-11-24T00:00:00Z",
              "latestTimestamp": "2018-12-14T00:00:00Z"
            }
          }
        ]
      },
      {
        "authenticationToken": "4b52uhm7uhdaesenbrwg6xbdr4mm4t8c",
        "dataAvailability": [
          {
            "dataSource": 1,
            "dynamicEpochValues": {
              "total": 1779,
              "earliestTimestamp": "2021-01-23T10:20:00Z",
              "latestTimestamp": "2021-02-14T16:44:00Z"
            },
            "dailyDynamicValues": {
              "total": 2777,
              "earliestTimestamp": "2018-11-24T00:00:00Z",
              "latestTimestamp": "2018-12-14T00:00:00Z"
            }
          },
          {
            "dataSource": 8,
            "dynamicEpochValues": {
              "total": 50,
              "earliestTimestamp": "2019-02-23T10:20:00Z",
              "latestTimestamp": "2019-03-29T16:44:00Z"
            },
            "dailyDynamicValues": {
              "total": 2777,
              "earliestTimestamp": "2019-01-24T00:00:00Z",
              "latestTimestamp": "2019-03-29T00:00:00Z"
            }
          }
        ]
      }
    ]
    
    Response Parameter
    authenticationToken The access token (e.g. de3d1e068537dd927b48988cb6969abe) of the requested user(s)
    dataSource The ID (e.g. 1 for Fitbit) of the respective value source
    dynamicEpochValues Data availability information for DynamicEpochValues
    dailyDynamicValues Data availability information for dailyDynamicValues
    total Total amount of data entries generated by the connected user (e.g. 100000)
    earliestTimestamp Earliest date & time information (in UTC timezone format) of specific data values which are stored on Thryve database
    latestTimestamp Latest date & time information (in UTC timezone format) of specific data values stored which are stored on Thryve database

    InitiateDataRetrieval

    InitiateDataRetrieval-interface provides the possibility to immediately retrieve the data from sources with the bulk-request retrieval mechanism such as GoogleFit, OmronConnect, and Oura. Please refer to the supported data source section for information on which data sources use bulk-requests.

    By calling the InitiateDataRetrieval-interface, the data request(s) to source(s) of the specific user will be immediately initiated.

    curl --location --request POST -u'healthapp:A7qmaxf9a' \
    --header'AppAuthorization: Basic RkVoOUhRTmFhODdjd2RiQjpOTDduVGVnUG01REt0OExyQlpQNjJIUXo2Vk5aYUd1TQ==' \
    --data-urlencode'authenticationToken=de3d1e068537dd927b48988cb6969abe' \
    --data-urlencode'dataSources=12,18' \
    --header'authenticationToken=de3d1e068537dd927b48988cb6969abe' \
    'https://api.und-gesund.de/v5/initiateDataRetrieval'
    
    HttpURLConnection connection = null;
    try {
        URL url = new URL("https://api.und-gesund.de/v5/initiateDataRetrieval");
        connection = (HttpURLConnection) url.openConnection();
        connection.setDoInput(true);
        connection.setDoOutput(true);
    
        connection.setRequestMethod("POST");
        connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
    
        String authorization = new String(Base64.getEncoder().encode("healthapp:A7qmaxf9a".getBytes()));
        connection.setRequestProperty("Authorization", "Basic " + authorization);
    
        String appAuthorization = new String(Base64.getEncoder().encode("FEh9HQNaa87cwdbB:NL7nTegPm5DKt8LrBZP62HQz6VNZaGuM".getBytes()));
        connection.setRequestProperty("AppAuthorization", String.format("Basic %s", appAuthorization));
    
        connection.connect();
    
        OutputStream outputStream = connection.getOutputStream();
        OutputStreamWriter outputStreamWriter = new OutputStreamWriter(outputStream, StandardCharsets.UTF_8);
        BufferedWriter bufferedWriter = new BufferedWriter(outputStreamWriter);
        bufferedWriter.write("authenticationToken=de3d1e068537dd927b48988cb6969abe");
        bufferedWriter.write("dataSources=12,18");
        bufferedWriter.flush(); bufferedWriter.close(); outputStream.close();
    
        if(connection.getResponseCode() == 204) {
            StringBuilder response = new StringBuilder();
            Reader inputStreamReader = new InputStreamReader(connection.getInputStream(), StandardCharsets.UTF_8);
            BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
            for(String line = bufferedReader.readLine(); line != null; line = bufferedReader.readLine()) {
                response.append(line);
            }
            System.out.println(response.toString());
        }
    } catch(IOException e) {
        e.printStackTrace();
    } finally {
        if(connection != null) {
            connection.disconnect();
        }
    }
    
    import UIKit
    
    let url = URL(string: "https://api.und-gesund.de/v5/initiateDataRetrieval")!
    
    var request = URLRequest(url: url)
    request.httpMethod = "POST"
    request.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
    
    let authCredentials = String("healthapp:A7qmaxf9a").data(using: String.Encoding.utf8)!.base64EncodedString()
    request.setValue("Basic \(authCredentials)", forHTTPHeaderField: "Authorization")
    
    let appAuthCredentials = String("FEh9HQNaa87cwdbB:NL7nTegPm5DKt8LrBZP62HQz6VNZaGuM").data(using: String.Encoding.utf8)!.base64EncodedString()
    request.setValue("Basic \(appAuthCredentials)", forHTTPHeaderField: "AppAuthorization")
    
    let data = "authenticationToken=de3d1e068537dd927b48988cb6969abe"
    request.httpBody = NSMutableData(data: String(data).data(using: String.Encoding.utf8)!) as Data
    
    let data = "dataSources=12,18"
    request.httpBody = NSMutableData(data: String(data).data(using: String.Encoding.utf8)!) as Data
    
    let task = URLSession(configuration: URLSessionConfiguration.default).dataTask(with: request) {(data, response, error) in
        if let httpResponse = response as? HTTPURLResponse {
            if httpResponse.statusCode == 204 {
                print(String(data: data!, encoding: .utf8)!)
            }
        }
    }
    task.resume()
    
    
    import json, requests, base64
    
    headers = {
        'content-type': 'application/x-www-form-urlencoded',
        'Authorization': 'Basic %s' % base64.b64encode('healthapp:A7qmaxf9a'),
        'AppAuthorization': 'Basic %s' % base64.b64encode('FEh9HQNaa87cwdbB:NL7nTegPm5DKt8LrBZP62HQz6VNZaGuM')
    }
    params = {
        'authenticationToken': 'de3d1e068537dd927b48988cb6969abe'
        'dataSources': '12,18'
    }
    
    r = requests.post(
        'https://api.und-gesund.de/v5/initiateDataRetrieval',
        params = params,
        headers = headers
    )
    
    if r.status_code == 204:
        print r.text
    
    $(function() {
        var formData = {
            authenticationToken: 'de3d1e068537dd927b48988cb6969abe'
            dataSources: '12,18'
        };
    
        $.ajax({
            url : 'https://api.und-gesund.de/v5/initiateDataRetrieval',
            type: 'POST',
            headers: {
                'Content-Type': 'application/x-www-form-urlencoded',
                'Authorization': 'Basic ' + btoa('healthapp:A7qmaxf9a'),
                'AppAuthorization': 'Basic ' + btoa('FEh9HQNaa87cwdbB:NL7nTegPm5DKt8LrBZP62HQz6VNZaGuM')
            },
            data : formData,
            statusCode: {
                204: function (data) {
                    console.log(data.responseText);
                }
            }
        });
    });
    
    post
    https://api.und-gesund.de/v5/initiateDataRetrieval
    Header Parameter
    Authorization
    required
    (Basic Auth) username:password
    AppAuthorization
    required
    (Basic Auth) appID:appSecret
    Query Parameter
    authenticationToken
    required
    The Thryve access token of the user who's data shall be instantly retrieved. Example structure: de3d1e068537dd927b48988cb6969abe
    dataSources
    required
    The ID of the data source supporting bulk-request retrieval where data shall be instantly retrieved. For a user with multiple data sources, please pass the data source ID combinable with ',' (comma separated). Example structure: 12,18

    Response

    Response Codes Description
    204 Request successful
    4xx error code

    Data Sources

    Active data sources

    Background data sync for native data sources
    Due to energy saving routines that differ among devices and manufacturers as well as operating system versions, background synchronizations might vary and might be executed less often as defined. To ensure that the background sync can be performed, please advise your end users to not force-close your app as this might lead to blockage of internal background routines by the operating system.

    Information on "restricted" data sources
    To gain access to user data for specific data sources, a developer account must be registered with a data source provider. For further information, please reach out to our partnership team.

    ID Name Integration Data retrieval frequency
    1 Fitbit  oAuth Ping/Subscription-based*
    2 Garmin  oAuth Ping/Subscription-based*
    3 Polar  oAuth Pull based (check every 5 minutes)
    5 Apple  HealthKit (via Thryve SDK) Upon availability in Apple Health and 1h schedule-based push via SDK
    6 Samsung
    (restricted)
    SHealth SDK (via Thryve SDK) Upon availability in Samsung Health and 1h schedule-based push via SDK
    8 Withings  oAuth Ping/Subscription-based*
    11 Strava  oAuth Ping/Subscription-based*
    12 GoogleFit REST  oAuth Bulk request (every 15 minutes)
    16 OmronConnect  oAuth Ping/Subscription-based*
    17 Suunto  oAuth Bulk request (every 15 minutes)
    18 Oura  oAuth Ping/Subscription-based*
    21 iHealth
    (restricted)
     oAuth Ping/Subscription-based*
    22 FreeStyleLibre (via LibreView)
    Direct Access Bulk request (every 15 minutes)
    27 Beurer
    (HealthManager Pro only)**
    oAuth Bulk request (every 15 minutes)
    38 HuaweiHealth  oAuth Bulk request (every 15 minutes)
    40 GoogleFit Native GoogleFit Android APIs (via Thryve SDK) Upon availability in GoogleFit app 1h schedule-based push via SDK
    41 Dexcom
    (restricted)
     oAuth Bulk request (every 15 minutes)
    42 Whoop
    **
     oAuth Ping/Subscription-based*
    43 Decathlon
    **
     oAuth Ping/Subscription-based*
    44 HealthConnect  via Thryve SDK Upon availability in Health Connect
    Get the full list of supported devices and sensorsDownload

    Experimental data sources

    Experimental datasource
    Several manufacturers do not support a dynamic transfer of their users’ data, have stopped maintenance of their APIs, or offer data-transfer with error-prone communication protocols such as BLE only. Thryve strives to cover their gaps and offer full data access, but limitations may occur any time with data sources marked as “experimental”. Please consider, that additional efforts might be necessary for a resilient production integration.

    Experimental data sources are not covered by the standard Thryve contract as they require additional efforts. If you want to use these data sources, please contact the Thryve business development team, so we can discuss the next steps.

    Direct access
    For all data sources marked as “direct access”, Thryve securely stores the user's credentials and directly draws data from the respective data sources APIs. Legally, Thryve acts as a vicarious agent on your behalf/on behalf of your end user - this requires corresponding transparency in the service terms & conditions as well as the privacy guidelines. Please contact us for further information.

    ID Name Integration Data retrieval frequency
    14 MyFitnessPal
    (experimental)
    Direct Access Bulk request (every 15 minutes)
    15 Runtastic
    (experimental)
    Direct Access Bulk request (every 15 minutes)
    19 Runkeeper
    (experimental)
    Direct Access Bulk request (every 15 minutes)
    20 Endomondo
    (experimental)
    Direct Access Bulk request (every 15 minutes)
    23 i-Sens
    (experimental)
    Bluetooth (Native integration only) Pushed after measurement
    24 Sleep As Android
    (experimental)
     oAuth Bulk request (on weekly basis due to user's limitation to upload routine to sleep-cloud)
    25 Clue
    (experimental)
    Direct Access Bulk request (every 15 minutes)
    26 HealthForYou
    (experimental)
    Direct Access Bulk request (every 15 minutes)
    30 Lykon
    (experimental)
    Direct Access Bulk request (every 15 minutes)
    32 Ovy
    (experimental)
    Direct Access Bulk request (every 15 minutes)
    33 Motiv
    (experimental)
    Direct Access Bulk request (every 15 minutes)
    34 Medisafe
    (experimental)
    Direct Access Bulk request (every 15 minutes)
    35 B.Braun
    (experimental)
    Bluetooth (Native integration only) Pushed after measurement
    36 RocheAccu-chek
    (experimental)
    Bluetooth (Native integration only) Pushed after measurement
    37 Biomes
    (experimental)
    Direct Access Bulk request (every 15 minutes)

    Thryve data

    ID Name Integration Data retrieval frequency
    9 Thryve Connector Native Step Detection (Android SDK only) Pushed via App Service (every 15 minutes)
    1000 Multiple Thryve analytics layer Depending on evaluation job intervals, ranging from hourly, daily, and weekly
    1001 CustomerApp PartnerDataUpload Upon upload

    HTTP Error Codes

    Response Codes Description
    400 Bad Request (request is invalid)
    401 Unauthorized (Check the correct use of web authentication)
    403 Forbidden (Check use of parameters)
    404 Not found (Check correct URL)
    405 Method not allowed (Check request method)
    415 Unsupported media type (Check usage of Content-Type)