-
Notifications
You must be signed in to change notification settings - Fork 3
GET child logs by resource
Retrieves logs with information on the total steps, calories, active_minutes, lightly_active_minutes or sedentary_minutes of a Child in a given period.
The sedentary_minutes are calculated by movement, and you need to be inactive for 10 consecutive minutes before the period is considered stationary. The lightly_active_minutes field represents minutes of light activites. The active_minutes represent field represents minutes of fairly active and very active activities.
Permissions:
-
Admin and Application users can list any set of logs for any given resource of any Child.
-
A Child can list any set of logs for a given resource as long as these logs are their own.
-
An Educator as well as a Health Professional can list any set of logs for any given resource of any Child as long as the latter belongs to one of their groups.
-
A Family user can list any set of logs for a given resource of any Child that is associated with it.
physicalactivities:read
GET https://localhost/v1/children/{child_id}/logs/{resource}/date/{date_start}/{date_end}
child_id: string (A 24-byte hex ID)
resource: string (steps, calories, active_minutes, lightly_active_minutes or sedentary_minutes)
date_start: string The start date of range.
date_end: string The end date of range.
curl -X GET "https://localhost/v1/children/5a62be07d6f33400146c9b61/logs/steps/date/2019-11-20/2019-11-25" -H "accept: application/json" -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
-
200
Successful requisition.[ { "date": "2019-04-23", "value": 14100 }, { "date": "2019-04-24", "value": 15687 }, { "date": "2019-04-25", "value": 0 }, { "date": "2019-04-26", "value": 2901 }, { "date": "2019-04-27", "value": 8561 } ]
-
400
Validation errors-
Invalid type
- Example
{ "code": 400, "message": "One or more request fields are invalid...", "description": "The names of the allowed types are: steps, calories, active_minutes, lightly_active_minutes, sedentary_minutes." }
- Example
-
Invalid date
- Example
{ "code": 400, "message": "Date parameter: {datetime}, is not in valid ISO 8601 format.", "description": "Date must be in the format: yyyy-MM-dd" }
- Example
-
Invalid date range
- Example
{ "code": 400, "message": "Date range is invalid...", "description": "The date_end parameter can not contain an older date than that the date_start parameter!" || "The period between the received dates can not exceed one year!" }
- Example
-
403
Permission Error
OCARIoT API Gateway (Full documentation)
- POST institutions
- GET institutions
- GET institutions.inst_id
- PATCH institutions.inst_id
- DELETE institutions.inst_id
- POST children.physicalactivities
- GET children.physicalactivities
- GET children.physicalactivities.activity_id
- DELETE children.physicalactivities.activity_id
- POST children.weights
- GET children.weights
- GET children.weights.weight_id
- DELETE children.weights.weight_id
- POST children.bodyfats
- GET children.bodyfats
- GET children.bodyfats.bodyfat_id
- DELETE children.bodyfats.bodyfat_id
- POST educators.children.groups
- GET educators.children.groups
- GET educators.children.groups.group_id
- PATCH educators.children.groups.group_id
- DELETE educators.children.groups.group_id
- POST healthprofessionals
- GET healthprofessionals
- GET healthprofessionals.hprof_id
- PATCH healthprofessionals.hprof_id
- POST healthprofessionals.children.groups
- GET healthprofessionals.children.groups
- GET healthprofessionals.children.groups.group_id
- PATCH healthprofessionals.children.groups.group_id
- DELETE healthprofessionals.children.groups.group_id
- POST institutions.environments
- GET institutions.environments
- DELETE institutions.environments
- DELETE institutions.environments.environment_id
- Invalid ID
- Invalid JSON format
- Missing fields
- Empty string
- Invalid string
- Invalid date
- Negative number
- Invalid number
- Unregistered institution
- Unregistered children
- Invalid children attribute type
- Invalid children items
- Empty ID(s) in children attribute
- ID(s) with invalid format in children
- Attempting to update password on wrong route
- Child does not exist
- Institution does not exist