Partner API Reference
📘 Overview
This document describes the Partner Open API, which allows external developers to integrate with the glucose device platform. Main features:- User registration and authentication
- User glucose data query
- Device information query
- Device glucose data query
🌐 API Endpoint
🔐 Authentication
All APIs (except user registration) require an access token.- User registration API
- Get user token API
📦 Common Response Format
| Field | Type | Description |
|---|---|---|
| code | int | 0 indicates success |
| msg | string | Business message |
| data | object | Response payload |
Common Error Codes
| Code | Description |
|---|---|
| 0 | Success |
| 1001 | Unauthorized / token invalid |
| 1002 | Permission denied |
⏱ Time Format
All time fields are represented as:👤 User APIs
1. Register User
Register a partner user in the platform.Endpoint
Content-Type
Request Body
| Field | Required | Description |
|---|---|---|
| partner_uid | Yes | Partner system user ID |
| region | No | User region (default: CN) |
Response Example
| Field | Description |
|---|---|
| open_id | Platform user identifier |
| access_token | Access token |
| expire_in | Token validity (seconds) |
2. Get User Token
Retrieve a new access token usingopen_id.
Endpoint
Query Parameters
| Name | Required | Description |
|---|---|---|
| open_id | Yes | User open_id |
Response
3. Query User Glucose Records
Query glucose records of a user within a time range.⚠️ Maximum time range: 30 days
Endpoint
Query Parameters
| Name | Required | Description |
|---|---|---|
| open_id | Yes | User open_id |
| start_time | Yes | Start timestamp (ms) |
| end_time | Yes | End timestamp (ms) |
Response Data Structure
Glucose Trend Values
| Value | Description |
|---|---|
| 1 | Stable |
| 5 | Slowly rising |
| 10 | Slowly falling |
| 15 | Rapid rise |
| 20 | Rapid drop |
🩺 Device APIs
4. Query Device Information
Retrieve lifecycle and binding information of a device.Endpoint
Query Parameters
| Name | Required | Description |
|---|---|---|
| device_sn | Yes | Device serial number |
Response Data
Device Status
| Status | Description |
|---|---|
| 0 | Unbound |
| 1 | Bound |
| 2 | Activated |
| 3 | Ended |
5. Query Device Glucose Records
Query glucose records by device serial number. Ifstart_time and end_time are not provided, all historical data will be returned.
Endpoint
Query Parameters
| Name | Required | Description |
|---|---|---|
| device_sn | Yes | Device SN |
| start_time | No | Start timestamp (ms) |
| end_time | No | End timestamp (ms) |
