Skip to main content

Client

Struct Client 

Source
pub struct Client { /* private fields */ }
Expand description

Client for Oura API Documentation

§Overview

The Oura API allows Oura users and partner applications to improve their user experience with Oura data. This document describes the Oura API Version 2 (V2), which is the only available integration point for Oura data. The previous V1 API has been sunset.

§Getting Started

§What is an API?

An API (Application Programming Interface) allows different software applications to communicate with each other. The Oura API enables you to access your Oura Ring data programmatically.

§Quick Start Guide

  1. Register an API Application and implement OAuth2
  2. Make Your First API Call:
    curl -X GET https://api.ouraring.com/v2/usercollection/personal_info \
    -H "Authorization: Bearer YOUR_TOKEN_HERE" \
    -H "User-Agent: YourAppName/1.0"
  3. Explore Data Types:
    • Browse the available endpoints in this documentation to discover what data you can access
    • Each endpoint includes example requests and responses
  4. Set Up Webhooks (Strongly Recommended):
    • Webhooks are the preferred way to consume Oura data
    • We have not had customers hit rate limits with webhooks properly implemented
    • Make a single request for historical data when a user first connects, then use webhooks for ongoing updates
    • Webhook notifications come approximately 30 seconds after data syncs from the mobile app
    • Set up webhooks to receive notifications when data changes

§Common Questions

  • Data Delay: Different data types sync at different times - sleep data requires users to open the Oura app, while daily activity and stress may sync in the background

§Data Access

In order to access data, a registered API Application is required. API Applications are limited to 10 users before requiring approval from Oura. There is no limit once an application is approved. Additionally, Oura users must provide consent to share each data type an API Application has access to. All data access requests through the Oura API require Authentication. Additionally, we recommend that Oura users keep their mobile app updated to support API access for the latest data types.

§Authentication

The Oura Cloud API supports authentication through the industry-standard OAuth2 protocol. For more information, see our Authentication instructions. Access tokens must be included in the request header as follows:

GET /v2/usercollection/personal_info HTTP/1.1
Host: api.ouraring.com
Authorization: Bearer <token>
User-Agent: YourAppName/1.0

Please note that personal access tokens were deprecated in December 2025 and are no longer available for use.

§User-Agent Header

Every request must include a User-Agent header that identifies your application, for example User-Agent: YourAppName/1.0. Requests without one may be rejected. Not every HTTP library sends a default value, so set it explicitly rather than relying on the default. Browsers set their own User-Agent automatically; every other client (server-side code, scripts, native apps) must set it.

§Oura HTTP Response Codes

Response CodeDescription
200 OKSuccessful Response
400 Query Parameter Validation ErrorThe request contains query parameters that are invalid or incorrectly formatted.
401 UnauthorizedInvalid or expired authentication token.
403 ForbiddenThe requested resource requires additional permissions or the user’s Oura subscription has expired.
429 Too Many RequestsRate limit exceeded. See response headers for retry guidance.

§Rate Limits

The API enforces rate limits at two layers to ensure fair access across all applications:

  • a per-access-token limit, which throttles single-token floods, and
  • a per-application limit, which caps the aggregate traffic across all of an application’s end-user tokens so one fan-out app can’t dominate shared capacity.

A request that trips either layer receives a 429 Too Many Requests. The X-RateLimit-Tier response header identifies which layer fired.

If your application regularly approaches rate limits, webhooks are strongly recommended — most applications that implement webhooks correctly do not encounter rate limit issues.

Contact us if you expect your usage to require higher limits.

§Rate Limit Response Headers

When a 429 Too Many Requests response is returned, five headers are included to guide retries. Prefer these over fixed-interval backoff:

  • Retry-After — integer seconds to wait before retrying. RFC 7231-compliant; safe to feed directly into your client’s backoff logic.
  • X-RateLimit-Limit — the request ceiling for the current window.
  • X-RateLimit-Window — the rolling window length in seconds that the ceiling applies to.
  • X-RateLimit-Reset — Unix epoch (seconds) at which the window resets and quota is fully restored.
  • X-RateLimit-Tier — identifies which limit was exceeded, useful when contacting support.

https://cloud.ouraring.com/legal/api-agreement

Version: 2.0

Implementations§

Source§

impl Client

Source

pub fn new(baseurl: &str) -> Self

Create a new client.

baseurl is the base URL provided to the internal reqwest::Client, and should include a scheme and hostname, as well as port and a path stem if applicable.

Source

pub fn new_with_client(baseurl: &str, client: Client) -> Self

Construct a new client with an existing reqwest::Client, allowing more control over its configuration.

baseurl is the base URL provided to the internal reqwest::Client, and should include a scheme and hostname, as well as port and a path stem if applicable.

Source§

impl Client

Source

pub async fn sandbox_multiple_daily_activity_documents_v2_sandbox_usercollection_daily_activity_get<'a>( &'a self, end_date: Option<&'a NaiveDate>, next_token: Option<&'a str>, start_date: Option<&'a NaiveDate>, ) -> Result<ResponseValue<MultiDocumentResponsePublicDailyActivity>, Error<HttpValidationError>>

Sandbox - Multiple Daily Activity Documents

Sends a GET request to /v2/sandbox/usercollection/daily_activity

Source

pub async fn sandbox_single_daily_activity_document_v2_sandbox_usercollection_daily_activity_document_id_get<'a>( &'a self, document_id: &'a str, ) -> Result<ResponseValue<PublicDailyActivity>, Error<HttpValidationError>>

Sandbox - Single Daily Activity Document

Sends a GET request to /v2/sandbox/usercollection/daily_activity/{document_id}

Source

pub async fn sandbox_multiple_daily_cardiovascular_age_documents_v2_sandbox_usercollection_daily_cardiovascular_age_get<'a>( &'a self, end_date: Option<&'a NaiveDate>, next_token: Option<&'a str>, start_date: Option<&'a NaiveDate>, ) -> Result<ResponseValue<MultiDocumentResponsePublicDailyCardiovascularAge>, Error<HttpValidationError>>

Sandbox - Multiple Daily Cardiovascular Age Documents

Sends a GET request to /v2/sandbox/usercollection/daily_cardiovascular_age

Source

pub async fn sandbox_single_daily_cardiovascular_age_document_v2_sandbox_usercollection_daily_cardiovascular_age_document_id_get<'a>( &'a self, document_id: &'a str, ) -> Result<ResponseValue<PublicDailyCardiovascularAge>, Error<HttpValidationError>>

Sandbox - Single Daily Cardiovascular Age Document

Sends a GET request to /v2/sandbox/usercollection/daily_cardiovascular_age/{document_id}

Source

pub async fn sandbox_multiple_daily_readiness_documents_v2_sandbox_usercollection_daily_readiness_get<'a>( &'a self, end_date: Option<&'a NaiveDate>, next_token: Option<&'a str>, start_date: Option<&'a NaiveDate>, ) -> Result<ResponseValue<MultiDocumentResponsePublicDailyReadiness>, Error<HttpValidationError>>

Sandbox - Multiple Daily Readiness Documents

Sends a GET request to /v2/sandbox/usercollection/daily_readiness

Source

pub async fn sandbox_single_daily_readiness_document_v2_sandbox_usercollection_daily_readiness_document_id_get<'a>( &'a self, document_id: &'a str, ) -> Result<ResponseValue<PublicDailyReadiness>, Error<HttpValidationError>>

Sandbox - Single Daily Readiness Document

Sends a GET request to /v2/sandbox/usercollection/daily_readiness/{document_id}

Source

pub async fn sandbox_multiple_daily_resilience_documents_v2_sandbox_usercollection_daily_resilience_get<'a>( &'a self, end_date: Option<&'a NaiveDate>, next_token: Option<&'a str>, start_date: Option<&'a NaiveDate>, ) -> Result<ResponseValue<MultiDocumentResponseDailyResilienceModel>, Error<HttpValidationError>>

Sandbox - Multiple Daily Resilience Documents

Sends a GET request to /v2/sandbox/usercollection/daily_resilience

Source

pub async fn sandbox_single_daily_resilience_document_v2_sandbox_usercollection_daily_resilience_document_id_get<'a>( &'a self, document_id: &'a str, ) -> Result<ResponseValue<DailyResilienceModel>, Error<HttpValidationError>>

Sandbox - Single Daily Resilience Document

Sends a GET request to /v2/sandbox/usercollection/daily_resilience/{document_id}

Source

pub async fn sandbox_multiple_daily_sleep_documents_v2_sandbox_usercollection_daily_sleep_get<'a>( &'a self, end_date: Option<&'a NaiveDate>, next_token: Option<&'a str>, start_date: Option<&'a NaiveDate>, ) -> Result<ResponseValue<MultiDocumentResponsePublicDailySleep>, Error<HttpValidationError>>

Sandbox - Multiple Daily Sleep Documents

Sends a GET request to /v2/sandbox/usercollection/daily_sleep

Source

pub async fn sandbox_single_daily_sleep_document_v2_sandbox_usercollection_daily_sleep_document_id_get<'a>( &'a self, document_id: &'a str, ) -> Result<ResponseValue<PublicDailySleep>, Error<HttpValidationError>>

Sandbox - Single Daily Sleep Document

Sends a GET request to /v2/sandbox/usercollection/daily_sleep/{document_id}

Source

pub async fn sandbox_multiple_daily_spo2_documents_v2_sandbox_usercollection_daily_spo2_get<'a>( &'a self, end_date: Option<&'a NaiveDate>, next_token: Option<&'a str>, start_date: Option<&'a NaiveDate>, ) -> Result<ResponseValue<MultiDocumentResponsePublicDailySpO2>, Error<HttpValidationError>>

Sandbox - Multiple Daily Spo2 Documents

Sends a GET request to /v2/sandbox/usercollection/daily_spo2

Source

pub async fn sandbox_single_daily_spo2_document_v2_sandbox_usercollection_daily_spo2_document_id_get<'a>( &'a self, document_id: &'a str, ) -> Result<ResponseValue<PublicDailySpO2>, Error<HttpValidationError>>

Sandbox - Single Daily Spo2 Document

Sends a GET request to /v2/sandbox/usercollection/daily_spo2/{document_id}

Source

pub async fn sandbox_multiple_daily_stress_documents_v2_sandbox_usercollection_daily_stress_get<'a>( &'a self, end_date: Option<&'a NaiveDate>, next_token: Option<&'a str>, start_date: Option<&'a NaiveDate>, ) -> Result<ResponseValue<MultiDocumentResponsePublicDailyStress>, Error<HttpValidationError>>

Sandbox - Multiple Daily Stress Documents

Sends a GET request to /v2/sandbox/usercollection/daily_stress

Source

pub async fn sandbox_single_daily_stress_document_v2_sandbox_usercollection_daily_stress_document_id_get<'a>( &'a self, document_id: &'a str, ) -> Result<ResponseValue<PublicDailyStress>, Error<HttpValidationError>>

Sandbox - Single Daily Stress Document

Sends a GET request to /v2/sandbox/usercollection/daily_stress/{document_id}

Source

pub async fn sandbox_multiple_enhanced_tag_documents_v2_sandbox_usercollection_enhanced_tag_get<'a>( &'a self, end_date: Option<&'a NaiveDate>, next_token: Option<&'a str>, start_date: Option<&'a NaiveDate>, ) -> Result<ResponseValue<MultiDocumentResponseEnhancedTagModel>, Error<HttpValidationError>>

Sandbox - Multiple Enhanced Tag Documents

Sends a GET request to /v2/sandbox/usercollection/enhanced_tag

Source

pub async fn sandbox_single_enhanced_tag_document_v2_sandbox_usercollection_enhanced_tag_document_id_get<'a>( &'a self, document_id: &'a str, ) -> Result<ResponseValue<EnhancedTagModel>, Error<HttpValidationError>>

Sandbox - Single Enhanced Tag Document

Sends a GET request to /v2/sandbox/usercollection/enhanced_tag/{document_id}

Source

pub async fn sandbox_multiple_heartrate_documents_v2_sandbox_usercollection_heartrate_get<'a>( &'a self, end_datetime: Option<&'a DateTime<Utc>>, next_token: Option<&'a str>, start_datetime: Option<&'a DateTime<Utc>>, ) -> Result<ResponseValue<ResponseSandboxMultipleHeartrateDocumentsV2SandboxUsercollectionHeartrateGet>, Error<HttpValidationError>>

Sandbox - Multiple Heartrate Documents

Sends a GET request to /v2/sandbox/usercollection/heartrate

Source

pub async fn sandbox_multiple_rest_mode_period_documents_v2_sandbox_usercollection_rest_mode_period_get<'a>( &'a self, end_date: Option<&'a NaiveDate>, next_token: Option<&'a str>, start_date: Option<&'a NaiveDate>, ) -> Result<ResponseValue<MultiDocumentResponsePublicRestModePeriod>, Error<HttpValidationError>>

Sandbox - Multiple Rest Mode Period Documents

Sends a GET request to /v2/sandbox/usercollection/rest_mode_period

Source

pub async fn sandbox_single_rest_mode_period_document_v2_sandbox_usercollection_rest_mode_period_document_id_get<'a>( &'a self, document_id: &'a str, ) -> Result<ResponseValue<PublicRestModePeriod>, Error<HttpValidationError>>

Sandbox - Single Rest Mode Period Document

Sends a GET request to /v2/sandbox/usercollection/rest_mode_period/{document_id}

Source

pub async fn sandbox_multiple_ring_battery_level_documents_v2_sandbox_usercollection_ring_battery_level_get<'a>( &'a self, end_datetime: Option<&'a DateTime<Utc>>, next_token: Option<&'a str>, start_datetime: Option<&'a DateTime<Utc>>, ) -> Result<ResponseValue<ResponseSandboxMultipleRingBatteryLevelDocumentsV2SandboxUsercollectionRingBatteryLevelGet>, Error<HttpValidationError>>

Sandbox - Multiple Ring Battery Level Documents

Sends a GET request to /v2/sandbox/usercollection/ring_battery_level

Source

pub async fn sandbox_multiple_ring_configuration_documents_v2_sandbox_usercollection_ring_configuration_get<'a>( &'a self, next_token: Option<&'a str>, ) -> Result<ResponseValue<MultiDocumentResponsePublicRingConfiguration>, Error<HttpValidationError>>

Sandbox - Multiple Ring Configuration Documents

Sends a GET request to /v2/sandbox/usercollection/ring_configuration

Source

pub async fn sandbox_single_ring_configuration_document_v2_sandbox_usercollection_ring_configuration_document_id_get<'a>( &'a self, document_id: &'a str, ) -> Result<ResponseValue<PublicRingConfiguration>, Error<HttpValidationError>>

Sandbox - Single Ring Configuration Document

Sends a GET request to /v2/sandbox/usercollection/ring_configuration/{document_id}

Source

pub async fn sandbox_multiple_session_documents_v2_sandbox_usercollection_session_get<'a>( &'a self, end_date: Option<&'a NaiveDate>, next_token: Option<&'a str>, start_date: Option<&'a NaiveDate>, ) -> Result<ResponseValue<MultiDocumentResponsePublicSession>, Error<HttpValidationError>>

Sandbox - Multiple Session Documents

Sends a GET request to /v2/sandbox/usercollection/session

Source

pub async fn sandbox_single_session_document_v2_sandbox_usercollection_session_document_id_get<'a>( &'a self, document_id: &'a str, ) -> Result<ResponseValue<PublicSession>, Error<HttpValidationError>>

Sandbox - Single Session Document

Sends a GET request to /v2/sandbox/usercollection/session/{document_id}

Source

pub async fn sandbox_multiple_sleep_documents_v2_sandbox_usercollection_sleep_get<'a>( &'a self, end_date: Option<&'a NaiveDate>, next_token: Option<&'a str>, start_date: Option<&'a NaiveDate>, ) -> Result<ResponseValue<MultiDocumentResponsePublicModifiedSleepModel>, Error<HttpValidationError>>

Sandbox - Multiple Sleep Documents

Sends a GET request to /v2/sandbox/usercollection/sleep

Source

pub async fn sandbox_single_sleep_document_v2_sandbox_usercollection_sleep_document_id_get<'a>( &'a self, document_id: &'a str, ) -> Result<ResponseValue<PublicModifiedSleepModel>, Error<HttpValidationError>>

Sandbox - Single Sleep Document

Sends a GET request to /v2/sandbox/usercollection/sleep/{document_id}

Source

pub async fn sandbox_multiple_sleep_time_documents_v2_sandbox_usercollection_sleep_time_get<'a>( &'a self, end_date: Option<&'a NaiveDate>, next_token: Option<&'a str>, start_date: Option<&'a NaiveDate>, ) -> Result<ResponseValue<MultiDocumentResponsePublicSleepTime>, Error<HttpValidationError>>

Sandbox - Multiple Sleep Time Documents

Sends a GET request to /v2/sandbox/usercollection/sleep_time

Source

pub async fn sandbox_single_sleep_time_document_v2_sandbox_usercollection_sleep_time_document_id_get<'a>( &'a self, document_id: &'a str, ) -> Result<ResponseValue<PublicSleepTime>, Error<HttpValidationError>>

Sandbox - Single Sleep Time Document

Sends a GET request to /v2/sandbox/usercollection/sleep_time/{document_id}

Source

pub async fn sandbox_multiple_tag_documents_v2_sandbox_usercollection_tag_get<'a>( &'a self, end_date: Option<&'a NaiveDate>, next_token: Option<&'a str>, start_date: Option<&'a NaiveDate>, ) -> Result<ResponseValue<MultiDocumentResponseTagModel>, Error<HttpValidationError>>

Sandbox - Multiple Tag Documents

Sends a GET request to /v2/sandbox/usercollection/tag

Source

pub async fn sandbox_single_tag_document_v2_sandbox_usercollection_tag_document_id_get<'a>( &'a self, document_id: &'a str, ) -> Result<ResponseValue<TagModel>, Error<HttpValidationError>>

Sandbox - Single Tag Document

Sends a GET request to /v2/sandbox/usercollection/tag/{document_id}

Source

pub async fn sandbox_multiple_v_o2_max_documents_v2_sandbox_usercollection_v_o2_max_get<'a>( &'a self, end_date: Option<&'a NaiveDate>, next_token: Option<&'a str>, start_date: Option<&'a NaiveDate>, ) -> Result<ResponseValue<MultiDocumentResponsePublicVo2Max>, Error<HttpValidationError>>

Sandbox - Multiple Vo2 Max Documents

Sends a GET request to /v2/sandbox/usercollection/vO2_max

Source

pub async fn sandbox_single_v_o2_max_document_v2_sandbox_usercollection_v_o2_max_document_id_get<'a>( &'a self, document_id: &'a str, ) -> Result<ResponseValue<PublicVo2Max>, Error<HttpValidationError>>

Sandbox - Single Vo2 Max Document

Sends a GET request to /v2/sandbox/usercollection/vO2_max/{document_id}

Source

pub async fn sandbox_multiple_workout_documents_v2_sandbox_usercollection_workout_get<'a>( &'a self, end_date: Option<&'a NaiveDate>, next_token: Option<&'a str>, start_date: Option<&'a NaiveDate>, ) -> Result<ResponseValue<MultiDocumentResponsePublicWorkout>, Error<HttpValidationError>>

Sandbox - Multiple Workout Documents

Sends a GET request to /v2/sandbox/usercollection/workout

Source

pub async fn sandbox_single_workout_document_v2_sandbox_usercollection_workout_document_id_get<'a>( &'a self, document_id: &'a str, ) -> Result<ResponseValue<PublicWorkout>, Error<HttpValidationError>>

Sandbox - Single Workout Document

Sends a GET request to /v2/sandbox/usercollection/workout/{document_id}

Source

pub async fn multiple_daily_activity_documents_v2_usercollection_daily_activity_get<'a>( &'a self, end_date: Option<&'a NaiveDate>, fields: Option<&'a str>, next_token: Option<&'a str>, start_date: Option<&'a NaiveDate>, ) -> Result<ResponseValue<MultiDocumentResponsePublicDailyActivity>, Error<HttpValidationError>>

Multiple Daily Activity Documents

Sends a GET request to /v2/usercollection/daily_activity

Arguments:

  • end_date
  • fields: Comma-separated list of fields to include in the response, in addition to the always returned fields. Defaults to all fields if not provided.
  • next_token
  • start_date
Source

pub async fn single_daily_activity_document_v2_usercollection_daily_activity_document_id_get<'a>( &'a self, document_id: &'a str, ) -> Result<ResponseValue<PublicDailyActivity>, Error<HttpValidationError>>

Single Daily Activity Document

Sends a GET request to /v2/usercollection/daily_activity/{document_id}

Source

pub async fn multiple_daily_cardiovascular_age_documents_v2_usercollection_daily_cardiovascular_age_get<'a>( &'a self, end_date: Option<&'a NaiveDate>, fields: Option<&'a str>, next_token: Option<&'a str>, start_date: Option<&'a NaiveDate>, ) -> Result<ResponseValue<MultiDocumentResponsePublicDailyCardiovascularAge>, Error<HttpValidationError>>

Multiple Daily Cardiovascular Age Documents

Sends a GET request to /v2/usercollection/daily_cardiovascular_age

Arguments:

  • end_date
  • fields: Comma-separated list of fields to include in the response, in addition to the always returned fields. Defaults to all fields if not provided.
  • next_token
  • start_date
Source

pub async fn single_daily_cardiovascular_age_document_v2_usercollection_daily_cardiovascular_age_document_id_get<'a>( &'a self, document_id: &'a str, ) -> Result<ResponseValue<PublicDailyCardiovascularAge>, Error<HttpValidationError>>

Single Daily Cardiovascular Age Document

Sends a GET request to /v2/usercollection/daily_cardiovascular_age/{document_id}

Source

pub async fn multiple_daily_readiness_documents_v2_usercollection_daily_readiness_get<'a>( &'a self, end_date: Option<&'a NaiveDate>, fields: Option<&'a str>, next_token: Option<&'a str>, start_date: Option<&'a NaiveDate>, ) -> Result<ResponseValue<MultiDocumentResponsePublicDailyReadiness>, Error<HttpValidationError>>

Multiple Daily Readiness Documents

Sends a GET request to /v2/usercollection/daily_readiness

Arguments:

  • end_date
  • fields: Comma-separated list of fields to include in the response, in addition to the always returned fields. Defaults to all fields if not provided.
  • next_token
  • start_date
Source

pub async fn single_daily_readiness_document_v2_usercollection_daily_readiness_document_id_get<'a>( &'a self, document_id: &'a str, ) -> Result<ResponseValue<PublicDailyReadiness>, Error<HttpValidationError>>

Single Daily Readiness Document

Sends a GET request to /v2/usercollection/daily_readiness/{document_id}

Source

pub async fn multiple_daily_resilience_documents_v2_usercollection_daily_resilience_get<'a>( &'a self, end_date: Option<&'a NaiveDate>, fields: Option<&'a str>, next_token: Option<&'a str>, start_date: Option<&'a NaiveDate>, ) -> Result<ResponseValue<MultiDocumentResponseDailyResilienceModel>, Error<HttpValidationError>>

Multiple Daily Resilience Documents

Sends a GET request to /v2/usercollection/daily_resilience

Arguments:

  • end_date
  • fields: N/A. This route does not support field selection yet, all fields will be returned.
  • next_token
  • start_date
Source

pub async fn single_daily_resilience_document_v2_usercollection_daily_resilience_document_id_get<'a>( &'a self, document_id: &'a str, ) -> Result<ResponseValue<DailyResilienceModel>, Error<HttpValidationError>>

Single Daily Resilience Document

Sends a GET request to /v2/usercollection/daily_resilience/{document_id}

Source

pub async fn multiple_daily_sleep_documents_v2_usercollection_daily_sleep_get<'a>( &'a self, end_date: Option<&'a NaiveDate>, fields: Option<&'a str>, next_token: Option<&'a str>, start_date: Option<&'a NaiveDate>, ) -> Result<ResponseValue<MultiDocumentResponsePublicDailySleep>, Error<HttpValidationError>>

Multiple Daily Sleep Documents

Sends a GET request to /v2/usercollection/daily_sleep

Arguments:

  • end_date
  • fields: Comma-separated list of fields to include in the response, in addition to the always returned fields. Defaults to all fields if not provided.
  • next_token
  • start_date
Source

pub async fn single_daily_sleep_document_v2_usercollection_daily_sleep_document_id_get<'a>( &'a self, document_id: &'a str, ) -> Result<ResponseValue<PublicDailySleep>, Error<HttpValidationError>>

Single Daily Sleep Document

Sends a GET request to /v2/usercollection/daily_sleep/{document_id}

Source

pub async fn multiple_daily_spo2_documents_v2_usercollection_daily_spo2_get<'a>( &'a self, end_date: Option<&'a NaiveDate>, fields: Option<&'a str>, next_token: Option<&'a str>, start_date: Option<&'a NaiveDate>, ) -> Result<ResponseValue<MultiDocumentResponsePublicDailySpO2>, Error<HttpValidationError>>

Multiple Daily Spo2 Documents

Sends a GET request to /v2/usercollection/daily_spo2

Arguments:

  • end_date
  • fields: Comma-separated list of fields to include in the response, in addition to the always returned fields. Defaults to all fields if not provided.
  • next_token
  • start_date
Source

pub async fn single_daily_spo2_document_v2_usercollection_daily_spo2_document_id_get<'a>( &'a self, document_id: &'a str, ) -> Result<ResponseValue<PublicDailySpO2>, Error<HttpValidationError>>

Single Daily Spo2 Document

Sends a GET request to /v2/usercollection/daily_spo2/{document_id}

Source

pub async fn multiple_daily_stress_documents_v2_usercollection_daily_stress_get<'a>( &'a self, end_date: Option<&'a NaiveDate>, fields: Option<&'a str>, next_token: Option<&'a str>, start_date: Option<&'a NaiveDate>, ) -> Result<ResponseValue<MultiDocumentResponsePublicDailyStress>, Error<HttpValidationError>>

Multiple Daily Stress Documents

Sends a GET request to /v2/usercollection/daily_stress

Arguments:

  • end_date
  • fields: Comma-separated list of fields to include in the response, in addition to the always returned fields. Defaults to all fields if not provided.
  • next_token
  • start_date
Source

pub async fn single_daily_stress_document_v2_usercollection_daily_stress_document_id_get<'a>( &'a self, document_id: &'a str, ) -> Result<ResponseValue<PublicDailyStress>, Error<HttpValidationError>>

Single Daily Stress Document

Sends a GET request to /v2/usercollection/daily_stress/{document_id}

Source

pub async fn multiple_enhanced_tag_documents_v2_usercollection_enhanced_tag_get<'a>( &'a self, end_date: Option<&'a NaiveDate>, fields: Option<&'a str>, next_token: Option<&'a str>, start_date: Option<&'a NaiveDate>, ) -> Result<ResponseValue<MultiDocumentResponseEnhancedTagModel>, Error<HttpValidationError>>

Multiple Enhanced Tag Documents

Sends a GET request to /v2/usercollection/enhanced_tag

Arguments:

  • end_date
  • fields: N/A. This route does not support field selection yet, all fields will be returned.
  • next_token
  • start_date
Source

pub async fn single_enhanced_tag_document_v2_usercollection_enhanced_tag_document_id_get<'a>( &'a self, document_id: &'a str, ) -> Result<ResponseValue<EnhancedTagModel>, Error<HttpValidationError>>

Single Enhanced Tag Document

Sends a GET request to /v2/usercollection/enhanced_tag/{document_id}

Source

pub async fn multiple_heartrate_documents_v2_usercollection_heartrate_get<'a>( &'a self, end_datetime: Option<&'a DateTime<Utc>>, fields: Option<&'a str>, latest: Option<bool>, next_token: Option<&'a str>, start_datetime: Option<&'a DateTime<Utc>>, ) -> Result<ResponseValue<ResponseMultipleHeartrateDocumentsV2UsercollectionHeartrateGet>, Error<HttpValidationError>>

Multiple Heartrate Documents

Sends a GET request to /v2/usercollection/heartrate

Arguments:

  • end_datetime
  • fields: Comma-separated list of fields to include in the response, in addition to the always returned fields. Defaults to all fields if not provided.
  • latest: If True, returns most recent sample.
  • next_token
  • start_datetime
Source

pub async fn single_personal_info_document_v2_usercollection_personal_info_get<'a>( &'a self, ) -> Result<ResponseValue<PersonalInfoResponse>, Error<()>>

Single Personal Info Document

Sends a GET request to /v2/usercollection/personal_info

Source

pub async fn multiple_rest_mode_period_documents_v2_usercollection_rest_mode_period_get<'a>( &'a self, end_date: Option<&'a NaiveDate>, fields: Option<&'a str>, next_token: Option<&'a str>, start_date: Option<&'a NaiveDate>, ) -> Result<ResponseValue<MultiDocumentResponsePublicRestModePeriod>, Error<HttpValidationError>>

Multiple Rest Mode Period Documents

Sends a GET request to /v2/usercollection/rest_mode_period

Arguments:

  • end_date
  • fields: Comma-separated list of fields to include in the response, in addition to the always returned fields. Defaults to all fields if not provided.
  • next_token
  • start_date
Source

pub async fn single_rest_mode_period_document_v2_usercollection_rest_mode_period_document_id_get<'a>( &'a self, document_id: &'a str, ) -> Result<ResponseValue<PublicRestModePeriod>, Error<HttpValidationError>>

Single Rest Mode Period Document

Sends a GET request to /v2/usercollection/rest_mode_period/{document_id}

Source

pub async fn multiple_ring_battery_level_documents_v2_usercollection_ring_battery_level_get<'a>( &'a self, end_datetime: Option<&'a DateTime<Utc>>, fields: Option<&'a str>, latest: Option<bool>, next_token: Option<&'a str>, start_datetime: Option<&'a DateTime<Utc>>, ) -> Result<ResponseValue<ResponseMultipleRingBatteryLevelDocumentsV2UsercollectionRingBatteryLevelGet>, Error<HttpValidationError>>

Multiple Ring Battery Level Documents

Sends a GET request to /v2/usercollection/ring_battery_level

Arguments:

  • end_datetime
  • fields: Comma-separated list of fields to include in the response, in addition to the always returned fields. Defaults to all fields if not provided.
  • latest: If True, returns most recent sample.
  • next_token
  • start_datetime
Source

pub async fn multiple_ring_configuration_documents_v2_usercollection_ring_configuration_get<'a>( &'a self, fields: Option<&'a str>, next_token: Option<&'a str>, ) -> Result<ResponseValue<MultiDocumentResponsePublicRingConfiguration>, Error<HttpValidationError>>

Multiple Ring Configuration Documents

Sends a GET request to /v2/usercollection/ring_configuration

Arguments:

  • fields: Comma-separated list of fields to include in the response, in addition to the always returned fields. Defaults to all fields if not provided.
  • next_token
Source

pub async fn single_ring_configuration_document_v2_usercollection_ring_configuration_document_id_get<'a>( &'a self, document_id: &'a str, ) -> Result<ResponseValue<PublicRingConfiguration>, Error<HttpValidationError>>

Single Ring Configuration Document

Sends a GET request to /v2/usercollection/ring_configuration/{document_id}

Source

pub async fn multiple_session_documents_v2_usercollection_session_get<'a>( &'a self, end_date: Option<&'a NaiveDate>, fields: Option<&'a str>, next_token: Option<&'a str>, start_date: Option<&'a NaiveDate>, ) -> Result<ResponseValue<MultiDocumentResponsePublicSession>, Error<HttpValidationError>>

Multiple Session Documents

Sends a GET request to /v2/usercollection/session

Arguments:

  • end_date
  • fields: Comma-separated list of fields to include in the response, in addition to the always returned fields. Defaults to all fields if not provided.
  • next_token
  • start_date
Source

pub async fn single_session_document_v2_usercollection_session_document_id_get<'a>( &'a self, document_id: &'a str, ) -> Result<ResponseValue<PublicSession>, Error<HttpValidationError>>

Single Session Document

Sends a GET request to /v2/usercollection/session/{document_id}

Source

pub async fn multiple_sleep_documents_v2_usercollection_sleep_get<'a>( &'a self, end_date: Option<&'a NaiveDate>, fields: Option<&'a str>, next_token: Option<&'a str>, start_date: Option<&'a NaiveDate>, ) -> Result<ResponseValue<MultiDocumentResponsePublicModifiedSleepModel>, Error<HttpValidationError>>

Multiple Sleep Documents

Sends a GET request to /v2/usercollection/sleep

Arguments:

  • end_date
  • fields: Comma-separated list of fields to include in the response, in addition to the always returned fields. Defaults to all fields if not provided.
  • next_token
  • start_date
Source

pub async fn single_sleep_document_v2_usercollection_sleep_document_id_get<'a>( &'a self, document_id: &'a str, ) -> Result<ResponseValue<PublicModifiedSleepModel>, Error<HttpValidationError>>

Single Sleep Document

Sends a GET request to /v2/usercollection/sleep/{document_id}

Source

pub async fn multiple_sleep_time_documents_v2_usercollection_sleep_time_get<'a>( &'a self, end_date: Option<&'a NaiveDate>, fields: Option<&'a str>, next_token: Option<&'a str>, start_date: Option<&'a NaiveDate>, ) -> Result<ResponseValue<MultiDocumentResponsePublicSleepTime>, Error<HttpValidationError>>

Multiple Sleep Time Documents

Sends a GET request to /v2/usercollection/sleep_time

Arguments:

  • end_date
  • fields: Comma-separated list of fields to include in the response, in addition to the always returned fields. Defaults to all fields if not provided.
  • next_token
  • start_date
Source

pub async fn single_sleep_time_document_v2_usercollection_sleep_time_document_id_get<'a>( &'a self, document_id: &'a str, ) -> Result<ResponseValue<PublicSleepTime>, Error<HttpValidationError>>

Single Sleep Time Document

Sends a GET request to /v2/usercollection/sleep_time/{document_id}

Source

pub async fn multiple_tag_documents_v2_usercollection_tag_get<'a>( &'a self, end_date: Option<&'a NaiveDate>, fields: Option<&'a str>, next_token: Option<&'a str>, start_date: Option<&'a NaiveDate>, ) -> Result<ResponseValue<MultiDocumentResponseTagModel>, Error<HttpValidationError>>

Multiple Tag Documents

Sends a GET request to /v2/usercollection/tag

Arguments:

  • end_date
  • fields: N/A. This route does not support field selection yet, all fields will be returned.
  • next_token
  • start_date
Source

pub async fn single_tag_document_v2_usercollection_tag_document_id_get<'a>( &'a self, document_id: &'a str, ) -> Result<ResponseValue<TagModel>, Error<HttpValidationError>>

Single Tag Document

Sends a GET request to /v2/usercollection/tag/{document_id}

Source

pub async fn multiple_v_o2_max_documents_v2_usercollection_v_o2_max_get<'a>( &'a self, end_date: Option<&'a NaiveDate>, fields: Option<&'a str>, next_token: Option<&'a str>, start_date: Option<&'a NaiveDate>, ) -> Result<ResponseValue<MultiDocumentResponsePublicVo2Max>, Error<HttpValidationError>>

Multiple Vo2 Max Documents

Sends a GET request to /v2/usercollection/vO2_max

Arguments:

  • end_date
  • fields: Comma-separated list of fields to include in the response, in addition to the always returned fields. Defaults to all fields if not provided.
  • next_token
  • start_date
Source

pub async fn single_v_o2_max_document_v2_usercollection_v_o2_max_document_id_get<'a>( &'a self, document_id: &'a str, ) -> Result<ResponseValue<PublicVo2Max>, Error<HttpValidationError>>

Single Vo2 Max Document

Sends a GET request to /v2/usercollection/vO2_max/{document_id}

Source

pub async fn multiple_workout_documents_v2_usercollection_workout_get<'a>( &'a self, end_date: Option<&'a NaiveDate>, fields: Option<&'a str>, next_token: Option<&'a str>, start_date: Option<&'a NaiveDate>, ) -> Result<ResponseValue<MultiDocumentResponsePublicWorkout>, Error<HttpValidationError>>

Multiple Workout Documents

Sends a GET request to /v2/usercollection/workout

Arguments:

  • end_date
  • fields: Comma-separated list of fields to include in the response, in addition to the always returned fields. Defaults to all fields if not provided.
  • next_token
  • start_date
Source

pub async fn single_workout_document_v2_usercollection_workout_document_id_get<'a>( &'a self, document_id: &'a str, ) -> Result<ResponseValue<PublicWorkout>, Error<HttpValidationError>>

Single Workout Document

Sends a GET request to /v2/usercollection/workout/{document_id}

Source

pub async fn list_webhook_subscriptions_v2_webhook_subscription_get<'a>( &'a self, ) -> Result<ResponseValue<Vec<WebhookSubscriptionModel>>, Error<()>>

List Webhook Subscriptions

Sends a GET request to /v2/webhook/subscription

Source

pub async fn create_webhook_subscription_v2_webhook_subscription_post<'a>( &'a self, body: &'a CreateWebhookSubscriptionRequest, ) -> Result<ResponseValue<WebhookSubscriptionModel>, Error<HttpValidationError>>

Create Webhook Subscription

Sends a POST request to /v2/webhook/subscription

Source

pub async fn renew_webhook_subscription_v2_webhook_subscription_renew_id_put<'a>( &'a self, id: &'a str, ) -> Result<ResponseValue<WebhookSubscriptionModel>, Error<HttpValidationError>>

Renew Webhook Subscription

Sends a PUT request to /v2/webhook/subscription/renew/{id}

Source

pub async fn get_webhook_subscription_v2_webhook_subscription_id_get<'a>( &'a self, id: &'a str, ) -> Result<ResponseValue<WebhookSubscriptionModel>, Error<HttpValidationError>>

Get Webhook Subscription

Sends a GET request to /v2/webhook/subscription/{id}

Source

pub async fn update_webhook_subscription_v2_webhook_subscription_id_put<'a>( &'a self, id: &'a str, body: &'a UpdateWebhookSubscriptionRequest, ) -> Result<ResponseValue<WebhookSubscriptionModel>, Error<HttpValidationError>>

Update Webhook Subscription

Sends a PUT request to /v2/webhook/subscription/{id}

Source

pub async fn delete_webhook_subscription_v2_webhook_subscription_id_delete<'a>( &'a self, id: &'a str, ) -> Result<ResponseValue<()>, Error<HttpValidationError>>

Delete Webhook Subscription

Sends a DELETE request to /v2/webhook/subscription/{id}

Trait Implementations§

Source§

impl ClientHooks for &Client

Source§

async fn pre<E>( &self, request: &mut Request, info: &OperationInfo, ) -> Result<(), Error<E>>

Runs prior to the execution of the request. This may be used to modify the request before it is transmitted.
Source§

async fn post<E>( &self, result: &Result<Response, Error>, info: &OperationInfo, ) -> Result<(), Error<E>>

Runs after completion of the request.
Source§

async fn exec( &self, request: Request, info: &OperationInfo, ) -> Result<Response, Error>

Execute the request. Note that for almost any reasonable implementation this will include code equivalent to this: Read more
Source§

impl ClientInfo<()> for Client

Source§

fn api_version() -> &'static str

Get the version of this API. Read more
Source§

fn baseurl(&self) -> &str

Get the base URL to which requests are made.
Source§

fn client(&self) -> &Client

Get the internal reqwest::Client used to make requests.
Source§

fn inner(&self) -> &()

Get the inner value of type T if one is specified.
Source§

impl Clone for Client

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Client

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more