Skip to content

GET child sleep by ID

JeffMedeiros edited this page Dec 2, 2019 · 3 revisions

Description

Retrieves a sleep data associated with a Child.

URL

GET https://localhost:4001/v1/children/{child_id}/sleep/{sleep_id}

Parameters

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

Curl example

curl -X GET "https://localhost:4001/v1/children/5a62be07d6f33400146c9b61/sleep/3bc1274329fb282470e45004" -H "accept: application/json"

Response body

  • 200 Successful requisition.

    {
      "id": "3bc1274329fb282470e45004",
      "start_time": "2019-08-18T01:40:30Z",
      "end_time": "2019-08-18T09:52:30Z",
      "duration": 29520000,
      "type": "classic",
      "pattern": {
        "data_set": [
          {
            "start_time": "2019-08-18T01:40:30.00Z",
            "name": "restless",
            "duration": 60000
          },
          {
            "start_time": "2019-08-18T01:41:30.00Z",
            "name": "asleep",
            "duration": 360000
          },
          {
            "start_time": "2019-08-18T01:47:30.00Z",
            "name": "restless",
            "duration": 240000
          },
          {
            "start_time": "2019-08-18T01:51:30.00Z",
            "name": "asleep",
            "duration": 60000
          },
          {
            "start_time": "2019-08-18T02:32:30.00Z",
            "name": "awake",
            "duration": 180000
          },
          {
            "start_time": "2019-08-18T06:47:30.00Z",
            "name": "restless",
            "duration": 60000
          },
          {
            "start_time": "2019-08-18T06:48:30.00Z",
            "name": "asleep",
            "duration": 2580000
          },
          {
            "start_time": "2019-08-18T07:31:30.00Z",
            "name": "restless",
            "duration": 120000
          },
          {
            "start_time": "2019-08-18T09:36:30.00Z",
            "name": "asleep",
            "duration": 960000
          }
        ],
        "summary": {
          "asleep": {
            "count": 4,
            "duration": 3960000
          },
          "awake": {
            "count": 1,
            "duration": 180000
          },
          "restless": {
            "count": 4,
            "duration": 480000
          }
        }
      },
      "child_id": "5a62be07de34500146d9c544"
    }
  • 400 Validation errors

  • 404 Not Found Error

  • 500 Internal Server Error

Clone this wiki locally