The process of viewing / downloading a recording is divided into three steps:
...
Code Block | ||
---|---|---|
| ||
query{ camera(node_id:62303){ recordings(from:1589190089, to:1589190689){ recording_id duration download_url outputs{ height } } } } |
...
Response:
Code Block | ||
---|---|---|
| ||
{ "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 | ||
---|---|---|
| ||
mutation{ recordingPrepare(recording_id:"xRMElmAkh3", height:720) } |
...
Response:
Code Block | ||
---|---|---|
| ||
{ "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 | ||
---|---|---|
| ||
query{ recording(recording_id:"6RjiHGzqCE"){ progress download_url } } |
...
Response:
Code Block | ||
---|---|---|
| ||
{ "data": { "recording": { "progress": 100, "download_url": "https://cloud.camstreamer.com/api/download.php?auth_key=2YwmG01NAeNYz4m1bZfwIKLOaoHeCfxH" } } } |
Without Postman example.
Panel | ||||||
---|---|---|---|---|---|---|
| ||||||
The download_url is an http(s) address. Use HTTP client (GET request) or paste it to browser to fetch the video MP4 file. |
...