目录

Querying Historical Exercise Performance

Function

Queries a user's historical exercise performance for up to the past 31 days.

Scenario

Queries a user's historical exercise performance for up to the past 31 days, including historical running ability index, condition index, fitness index, and fatigue index.

Restrictions

API Prototype

Protocol

HTTPS GET

Direction

App > Health Service Kit cloud

URL

https://health-api.cloud.huawei.com/healthkit/v2/athleticPerformance?types=***&types=***&startDay=***&endDay=***&timeZone=***

Data Format

Request: Content-Type: application/json

Response: Content-Type: application/json

Request Parameters

Request Header

Parameter

Type

Mandatory

Description

timeZone

String

Yes

Time zone. The special characters must be URL-encoded.

For example, if the time zone to be set is +0800, the value should be %2b0800.

startDay

int

Yes

Query start date, in yyyyMMdd format.

endDay

int

Yes

Query end date, in yyyyMMdd format. The maximum query period is 31 days starting from the start date.

types

String[]

No

Index to be queried:

  • runningAbility: running ability index (RAI)
  • condition: condition index
  • fitness: fitness index
  • fatigue: fatigue index

If no value is passed, the preceding four indexes are queried.

Request Body

None.

Request Example

GET https://health-api.cloud.huawei.com/healthkit/v2/athleticPerformance?types=runningAbility&types=condition&startDay=20241020&endDay=20241024&timeZone=%2b0800
Content-Type: application/json
Authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Response Parameters

When the status code is 200:

Response Header

Parameter

Type

Mandatory

Description

Content-Type

String

Yes

Value: application/json; charset=UTF-8

Response Body

Parameter

Type

Mandatory

Description

Map<Integer, AthleticPerformance>

Map

Yes

Historical running ability data. For details, please refer to the AthleticPerformance data model.

Response Example

HTTP/1.1 200 OK
Content-type: application/json;charset=utf-8
{
        20241020: {
            "runningAbility": 20,
            "fitness": 0.0814,
            "fatigue": 0.0001,
            "condition": 0.0832
        },
        20241021: {
            "runningAbility": 20,
            "fitness": 0.0795,
            "fatigue": 0.0001,
            "condition": 0.0812
        },
        20241022: {
            "runningAbility": 20,
            "fitness": 0.0776,
            "fatigue": 0.0001,
            "condition": 0.0794
        },
        20241023: {
            "runningAbility": 20,
            "fitness": 0.0758,
            "fatigue": 0.0001,
            "condition": 0.0775
        },
        20241024: {
            "runningAbility": 20,
            "fitness": 0.074,
            "fatigue": 0.0001,
            "condition": 0.0757
        }
}

Result Codes

For details, see Result Codes.