Withings API icon

Withings API

Withings API Integration

Sleep → Get

AI-generated

Overview

This node retrieves sleep data from the Withings API. It supports fetching detailed sleep information including heart rate, respiration rate, and snoring data. This node is useful for health and fitness applications that need to analyze or monitor sleep patterns and related biometric data over a specified time range.

Use Case Examples

  1. A user wants to track their sleep quality and associated heart rate data over the past week to identify trends.
  2. A health app integrates this node to fetch snoring data and respiration rates to provide insights into sleep apnea risks.

Properties

Name Meaning
Authentication Method How to authenticate with Withings API, either using stored OAuth2 credentials or a manual access token from a previous node.
Access Token (From Previous Node) The access token used for manual authentication, typically obtained from a Token Exchange node.
Additional Fields Optional parameters to filter the sleep data retrieval, including start date, end date, last update timestamp, and record offset.
Data Fields Types of sleep data to retrieve, such as heart rate (HR), respiration rate (RR), and snoring data.

Output

JSON

  • success - Indicates if the API call was successful.
  • resource - The resource type, here it will be 'sleep'.
  • operation - The operation performed, here it will be 'get'.
  • data - The sleep data retrieved from the Withings API, if available.
  • error - Error message if the API call failed.
  • status - HTTP status code returned by the API.
  • errorCode - Specific error code returned by the API, if any.

Dependencies

  • Withings API
  • OAuth2 credentials or manual access token for authentication

Troubleshooting

  • Ensure the access token is valid and not expired, especially when using manual token authentication.
  • If token refresh fails, reconnect the Withings account to update credentials.
  • Check the date and offset parameters to ensure they are correctly formatted timestamps and within valid ranges.
  • Common error messages include token expiration errors and API rate limits; handle these by refreshing tokens or retrying after delay.

Links

Discussion