DOCUMENTATION
五分钟 API Quickstart
从 Self-Hosted 或托管 iSleep endpoint 查询经过授权的最新睡眠报告。
设置 endpoint 和 Token
使用具备 reports:read 的用户 Token 或后端委托 Token。不要在 App 中嵌入 Service Credential。
export ISLEEP_ENDPOINT=https://sleep.example.com
export ISLEEP_TOKEN=replace-with-a-short-lived-token选择已授权成员
列出当前身份可以访问的成员。
curl -H "Authorization: Bearer $ISLEEP_TOKEN" \
"$ISLEEP_ENDPOINT/api/v1/members"读取最新报告
使用 API 返回的不透明 Member ID。
curl -H "Authorization: Bearer $ISLEEP_TOKEN" \
"$ISLEEP_ENDPOINT/api/v1/members/$MEMBER_ID/sleep-reports/latest"文档没有回答你的问题?询问 iSleep