GET child physical activities - ocariot/api-gateway GitHub Wiki

Description

Retrieves a list with all physical activities associated with a Child.

Permissions:

  • Admin and Application users can list all physical activities of any Child.

  • A child can list all his physical activities.

  • An Educator as well as a Health Professional can list all physical activities of any Child as long as the Child belongs to one of their groups.

  • A Family user can list all physical activities of any Child associated with them.

Scope

physicalactivities:read

URL

GET https://localhost/v1/children/{child_id}/physicalactivities

Parameters

child_id: string (A 24-byte hex ID)

Curl example

curl -X GET "https://localhost/v1/children/5a62be07d6f33400146c9b61/physicalactivities" -H "accept: application/json" -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Response body

  • 200 Successful requisition.

    [
      {
        "id": "5a62be07de34500146d9c544",
        "name": "Walk",
        "start_time": "2019-12-14T12:52:59Z",
        "end_time": "2019-12-14T13:12:37Z",
        "duration": 1178000,
        "calories": 109,
        "steps": 1407,
        "distance": 800,
        "levels": [
          {
            "name": "sedentary",
            "duration": 120000
          },
          {
            "name": "lightly",
            "duration": 60000
          },
          {
            "name": "fairly",
            "duration": 540000
          },
          {
            "name": "very",
            "duration": 420000
          }
        ],
        "heart_rate": {
          "average": 107,
          "out_of_range_zone": {
            "min": 30,
            "max": 91,
            "duration": 0
          },
          "fat_burn_zone": {
            "min": 91,
            "max": 127,
            "duration": 600000
          },
          "cardio_zone": {
            "min": 127,
            "max": 154,
            "duration": 0
          },
          "peak_zone": {
            "min": 154,
            "max": 220,
            "duration": 0
          }
        },
        "child_id": "5a62be07de34500146d9c544"
      }
    ]
    
  • 400 Validation errors

  • 401 Unauthorized Error

  • 403 Permission Error

  • 429 Too Many Requests Error

  • 500 Internal Server Error

Query Strings (Optional)

Query strings are used as follows: there must be a question mark following the URL and providing the parameters for the desired operations. There are four possible operations: filtering, paging, limiting, and sorting.

All parameters can also be used together concatenated by the & character as follows:

https://localhost/v1/children/5a62be07d6f33400146c9b61/physicalactivities?name=*walk*&sort=name&page=1&limit=20

For more details about using Query Strings click here.