Health Service
Health service will handle all the health-related services.
Endpoints
# Endpoints
Get pointer
This endpoint get user's last step pointer
Request (StepPointerReqDTO)
POST /steps/sync
{
"userId": "user-1"
}
Response (StepPointerResDTO)
{
"success": true,
"message": "",
"data": {
"pointer": "2025-04-02T16:00:00.000Z"
}
}
Sync step
This endpoint synchronizes user's steps.
Request (UpdateStepDTO)
POST /steps/sync
{
"data": [
{
"userId": "user-1",
"startTime": "2024-06-07T09:38:07.000Z",
"endTime": "2024-06-07T10:38:07.000Z",
"steps": 376,
"birthdate": "1993-04-09",
"height": 172,
"weight": 65.2
}
]
}
Response
{
"success": true,
"message": "",
"data": null
}
Adjust step
This endpoint synchronizes user's steps.
Request (UpdateStepDTO)
POST /steps/adjust
{
"data": [
{
"userId": "user-1",
"startTime": "2024-06-07T09:38:07.000Z",
"endTime": "2024-06-07T10:38:07.000Z",
"steps": 376,
"birthdate": "1993-04-09",
"height": 172,
"weight": 65.2
}
]
}
Response
{
"success": true,
"message": "",
"data": null
}
Fetch step
This endpoint fetches user's steps.
Request (FetchStepReqDTO)
POST /steps/fetch
{
"userId": "user-1",
"mode": 3,
"fillMode": false,
"startTime": "2024-05-10T16:00:00.000Z",
"endTime": "2024-07-15T08:00:00.000Z"
}
Response (FetchStepResDTO)
mode = 1
{
"success": true,
"message": "",
"data": {
"total": {
"steps": 1274,
"distance": 906,
"calories": 59
},
"rows": [
{
"startTime": "2024-06-07 08:00:00",
"endTime": "2024-06-07 09:00:00",
"steps": 328,
"distance": 233,
"calories": 15
}
],
"isFullDay": false
}
}
mode = 2
{
"success": true,
"message": "",
"data": {
"total": {
"steps": 1274,
"distance": 906,
"calories": 59
},
"dailyAverage": {
"steps": 1274,
"distance": 906,
"calories": 59
},
"rows": [
{
"date": "2024-06-07",
"steps": 1274,
"distance": 906,
"calories": 59
}
]
}
}
mode = 3
{
"success": true,
"message": "",
"data": {
"total": {
"steps": 1274,
"distance": 906,
"calories": 59
},
"dailyAverage": {
"steps": 1274,
"distance": 906,
"calories": 59
},
"rows": [
{
"month": "2024-06",
"steps": 328,
"distance": 233,
"calories": 15
}
]
}
}
Fetch user last activity
This endpoint returns the users' id for those whose last activity is before the specific number of days before today.
Request (FetchUserLastActivityReqDTO)
POST /steps/user-last-activity
{
"userIds": [
"user-1"
],
"gt": 3
}
Response (FetchUserLastActivityResDTO)
{
"success": true,
"message": "",
"data": [
"userId1",
"userId2"
]
}
Sync step v2
This endpoint synchronizes user's steps.
Request (UpdateStepV2DTO)
POST /steps/sync
{
"dataOrigins": [
"IOS"
],
"dataOrigin": "IOS",
"userId": "user-1",
"birthdate": "1993-04-09",
"height": 172,
"weight": 65.2,
"data": [
{
"startTime": "2024-06-07T09:38:07.000Z",
"endTime": "2024-06-07T10:38:07.000Z",
"steps": 376
}
]
}
Response
{
"success": true,
"message": "",
"data": null
}
Adjust step v2
This endpoint synchronizes user's steps.
Request (UpdateStepDTO)
POST /steps/adjust
{
"data": [
{
"userId": "user-1",
"startTime": "2024-06-07T09:38:07.000Z",
"endTime": "2024-06-07T10:38:07.000Z",
"steps": 376,
"birthdate": "1993-04-09",
"height": 172,
"weight": 65.2
}
]
}
Response
{
"success": true,
"message": "",
"data": null
}
Fetch step v2
This endpoint fetches user's steps.
Request (FetchStepReqDTO)
POST /steps/fetch
{
"userId": "user-1",
"mode": 3,
"fillMode": false,
"startTime": "2024-05-10T16:00:00.000Z",
"endTime": "2024-07-15T08:00:00.000Z"
}
Response (FetchStepResDTO)
mode = 1
{
"success": true,
"message": "",
"data": {
"total": {
"steps": 1274,
"distance": 906,
"calories": 59
},
"rows": [
{
"startTime": "2024-06-07 08:00:00",
"endTime": "2024-06-07 09:00:00",
"steps": 328,
"distance": 233,
"calories": 15
}
],
"isFullDay": false
}
}
mode = 2
{
"success": true,
"message": "",
"data": {
"total": {
"steps": 1274,
"distance": 906,
"calories": 59
},
"dailyAverage": {
"steps": 1274,
"distance": 906,
"calories": 59
},
"rows": [
{
"date": "2024-06-07",
"steps": 1274,
"distance": 906,
"calories": 59
}
]
}
}
mode = 3
{
"success": true,
"message": "",
"data": {
"total": {
"steps": 1274,
"distance": 906,
"calories": 59
},
"dailyAverage": {
"steps": 1274,
"distance": 906,
"calories": 59
},
"rows": [
{
"month": "2024-06",
"steps": 328,
"distance": 233,
"calories": 15
}
]
}
}
Fetch user last activity v2
This endpoint returns the users' id for those whose last activity is before the specific number of days before today.
Request (FetchUserLastActivityReqDTO)
POST /steps/user-last-activity
{
"userIds": [
"user-1"
],
"gt": 3
}
Response (FetchUserLastActivityResDTO)
{
"success": true,
"message": "",
"data": [
"userId1",
"userId2"
]
}
Resources
StepPointerReqDTO
properties
userId
stringrequiredThe id of the user.
StepPointerResDTO
properties
pointer
stringrequiredThe last step time of the user.
UpdateStepDTO
properties
data
A list of step entities.
UpdateStepItemDTO
properties
userId
stringrequiredThe id of the user.
startTime
datetimerequiredYYYY-MM-DDThh:mm:ss.000ZThe start time.
endTime
datetimerequiredYYYY-MM-DDThh:mm:ss.000ZThe end time.
steps
numberrequiredThe step count of the user.
birthdate
stringrequiredThe id of the user.
height
numberrequiredThe height of the user.
weight
numberrequiredThe weight of the user.
UpdateStepV2DTO
properties
dataOrigins
arrayrequiredAll data sources reported from the APP.
dataOrigin
stringrequiredThe chosen data source reported from the APP.
userId
stringrequiredThe id of the user.
birthdate
stringrequiredThe id of the user.
height
numberrequiredThe height of the user.
weight
numberrequiredThe weight of the user.
A list of step entities.
UpdateStepItemV2DTO
properties
userId
stringrequiredThe id of the user.
startTime
datetimerequiredYYYY-MM-DDThh:mm:ss.000ZThe start time.
endTime
datetimerequiredYYYY-MM-DDThh:mm:ss.000ZThe end time.
steps
numberrequiredThe step count of the user.
birthdate
stringrequiredThe id of the user.
height
numberrequiredThe height of the user.
weight
numberrequiredThe weight of the user.
FetchStepReqDTO
properties
userId
stringrequiredThe id of the user.
The fetch mode of the request.
fillMode
booleandefault:If fillMode = True, it will fill in all the entries; otherwise, it will only return the existing entry.
startTime
datetimerequiredYYYY-MM-DDThh:mm:ss.000ZThe start time.
endTime
datetimerequiredYYYY-MM-DDThh:mm:ss.000ZThe end time.
FetchStepResDTO
properties
total
The summary of the steps over the period.
dailyAverage
The summary of the daily average information over the period. It is only available for the mode = 2 or mode = 3.
The step entity.
isFullDay
booleanIf the current data source is Samsung Health, it will be True; otherwise, it is False
StepTotalDTO
properties
steps
numberrequiredThe total step count over the period.
distance
numberrequiredThe total distance over the period.
calories
numberrequiredThe total calories over the period.
StepDailyAverageDTO
properties
steps
numberrequiredThe daily average of the step count over the period.
distance
numberrequiredThe daily average of the distance over the period.
calories
numberrequiredThe daily average of the calories over the period.
StepHourlyItemDTO
properties
startTime
datetimerequiredYYYY-MM-DDThh:mm:ss.000ZThe start time.
endTime
datetimerequiredYYYY-MM-DDThh:mm:ss.000ZThe end time.
steps
numberrequiredThe step count of the user.
distance
numberrequiredThe distance of the user.
calories
numberrequiredThe calories of the user.
StepDailyItemDTO
properties
date
datetimeYYYY-MM-DDThe date for the statistics.
steps
numberThe step count of the user.
distance
numberThe distance of the user.
calories
numberThe calories of the user.
StepMonthlyItemDTO
properties
month
stringrequiredYYYY-MMThe month of the statistics.
steps
numberrequiredThe step count of the user.
distance
numberrequiredThe distance of the user.
calories
numberrequiredThe calories of the user.
FetchUserLastActivityReqDTO
properties
userIds
stringrequiredThe list of the users' id.
gt
numberrequiredThe number of day before today.
FetchUserLastActivityResDTO
properties
data
listrequiredThe list of the users' id.
FetchMode
Name | Value |
---|---|
Hourly | 1 |
Daily | 2 |
Monthly | 3 |