Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The process of viewing / downloading a recording is divided into three steps:

...

Code Block
languagegraphql
query{
  camera(node_id:62303){
    recordings(from:1589190089, to:1589190689){
      recording_id
      duration
      download_url
      outputs{
        height
      }
    }
  }
}

...

Response:

Code Block
languagejson
{
  "data": {
    "camera": {
      "recordings": [
        {
          "recording_id": "xRMElmAkh3",
          "duration": 598,
          "download_url": null,
          "outputs": [
            {
              "height": 480
            },
            {
              "height": 720
            },
            {
              "height": 800
            }
          ]
        }
      ]
    }
  }
}

Without Postman example.

If the response does not contain any recording in the list, check in the user interface whether the given camera is recording or was recording in the selected interval. We will now call a mutation to prepare a recording, whose parameters are recording_id and height from the previous step.

...

Code Block
languagegraphql
mutation{
  recordingPrepare(recording_id:"xRMElmAkh3", height:720)
}

...

Response:

Code Block
languagejson
{
  "data": {
    "recordingPrepare": true
  }
}

Without Postman example.

A value of true indicates that the recording preparation has started successfully. The state of preparation is obtained by querying the type of recording whose parameter is recording_id.

...

Code Block
languagegraphql
query{
  recording(recording_id:"6RjiHGzqCE"){
    progress
    download_url
  }
}

...

Response:

Code Block
languagejson
{
  "data": {
    "recording": {
      "progress": 100,
      "download_url": "https://cloud.camstreamer.com/api/download.php?auth_key=2YwmG01NAeNYz4m1bZfwIKLOaoHeCfxH"
    }
  }
}

Without Postman example.

Panel
panelIconIdatlassian-note
panelIcon:note:
bgColor#B3D4FF

The download_url is an http(s) address. Use HTTP client (GET request) or paste it to browser to fetch the video MP4 file.

...