GET child physical activity by ID - ocariot/api-gateway GitHub Wiki

Description

Retrieves a physical activity data associated with a Child.

Permissions:

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

  • A Child can list any physical activity as long as it is yours.

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

  • A Family user can list any physical activity of any Child associated with it.

Scope

physicalactivities:read

URL

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

Parameters

child_id: string (A 24-byte hex ID)
physicalactivity_id: string (A 24-byte hex ID)

Curl example

curl -X GET "https://localhost/v1/children/5a62be07d6f33400146c9b61/physicalactivities/5c5277b8004ce629c1eef323" -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

  • 404 Not Found Error

  • 429 Too Many Requests Error

  • 500 Internal Server Error