tai-sho/oura-api-php
Composer 安装命令:
composer require tai-sho/oura-api-php
包简介
A PHP client library for the Oura Ring API
README 文档
README
A PHP client library for the Oura Ring API.
Requirements
- PHP 7.4 or higher
- Composer
- Oura Personal Access Token (see below for more information)
Installation
You can install the library via Composer. Run the following command:
$ composer require tai-sho/oura-api-php
Usage
Personal Access Token
This library requires a personal access token to authenticate with the Oura API. You can obtain a personal access token from the Oura page: Oura API Doc
Initialization
First, you need to initialize the client with your API access token.
require 'vendor/autoload.php'; use OuraApiPhp\Client; $accessToken = 'your-access-token'; $client = new Client($accessToken);
Examples
Get Heart Rate Data
$params = ['start_date' => '2024-01-01', 'end_date' => '2024-01-07']; $response = $client->getHeartRate($params); $data = json_decode($response->getBody()->getContents(), true); print_r($data);
Get Personal Info
$response = $client->getPersonalInfo(); $data = json_decode($response->getBody()->getContents(), true); print_r($data);
Get Workout Data
$params = ['start_date' => '2024-01-01', 'end_date' => '2024-01-07']; $response = $client->getWorkout($params); $data = json_decode($response->getBody()->getContents(), true); print_r($data);
Get All Heart Rate Data (Handling Pagination)
$params = ['start_date' => '2024-01-01', 'end_date' => '2024-01-07']; $responses = $client->getAllHeartRateData($params); foreach ($responses as $response) { $data = json_decode($response->getBody()->getContents(), true); print_r($data); }
Available Endpoints
The client supports the following endpoints:
getHeartRate(array $params = [])getPersonalInfo(array $params = [])getTag(array $params = [])getEnhancedTag(array $params = [])getWorkout(array $params = [])getSession(array $params = [])getDailyActivity(array $params = [])getDailySleep(array $params = [])getDailySpo2(array $params = [])getDailyReadiness(array $params = [])getSleep(array $params = [])getSleepTime(array $params = [])getRestModePeriod(array $params = [])getRingConfiguration(array $params = [])getDailyStress(array $params = [])getTagById(string $documentId, array $params = [])getEnhancedTagById(string $documentId, array $params = [])getWorkoutById(string $documentId, array $params = [])getSessionById(string $documentId, array $params = [])getDailyActivityById(string $documentId, array $params = [])getDailySleepById(string $documentId, array $params = [])getDailySpo2ById(string $documentId, array $params = [])getDailyReadinessById(string $documentId, array $params = [])getSleepById(string $documentId, array $params = [])getSleepTimeById(string $documentId, array $params = [])getRestModePeriodById(string $documentId, array $params = [])getRingConfigurationById(string $documentId, array $params = [])getDailyStressById(string $documentId, array $params = [])
Get All Data Functions (Handling Pagination)
getAllHeartRateData(array $params = [])getAllWorkoutData(array $params = [])getAllTagData(array $params = [])getAllEnhancedTagData(array $params = [])getAllSessionData(array $params = [])getAllDailyActivityData(array $params = [])getAllDailySleepData(array $params = [])getAllDailySpo2Data(array $params = [])getAllDailyReadinessData(array $params = [])getAllSleepData(array $params = [])getAllSleepTimeData(array $params = [])getAllRestModePeriodData(array $params = [])getAllRingConfigurationData(array $params = [])getAllDailyStressData(array $params = [])
Contributing
Welcome contributions! Please submit a pull request or open an issue to discuss changes.
License
This project is licensed under the MIT License. See the LICENSE file for details.
tai-sho/oura-api-php 适用场景与选型建议
tai-sho/oura-api-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 11 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 06 月 08 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 tai-sho/oura-api-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 tai-sho/oura-api-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 11
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 18
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-06-08