Archiving a Video
You can archive any recorded video using the /export
API. This creates an export job that processes the video and saves it in the archive for long-term storage or downloading to your local machine.
curl --request POST \
--url https://api.c030.eagleeyenetworks.com/api/v3.0/exports \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"type": "video",
"period": {
"startTimestamp": "2023-03-19T09:08:07.542Z",
"endTimestamp": "2023-03-20T09:08:07.542Z"
},
"info": {
"directory": "/exports",
"name": "sun_going_under_on_the_7th"
},
"deviceId": "10058b7a"
}
'
import requests
url = "https://api.c030.eagleeyenetworks.com/api/v3.0/exports"
payload = {
"type": "video",
"period": {
"startTimestamp": "2023-03-19T09:08:07.542Z",
"endTimestamp": "2023-03-20T09:08:07.542Z"
},
"info": {
"name": "sun_going_under_on_the_7th",
"directory": "/exports"
},
"deviceId": "10058b7a"
}
headers = {
"accept": "application/json",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
using RestSharp;
var options = new RestClientOptions("https://api.c030.eagleeyenetworks.com/api/v3.0/exports");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("accept", "application/json");
request.AddJsonBody("{\"type\":\"video\",\"period\":{\"startTimestamp\":\"2023-03-19T09:08:07.542Z\",\"endTimestamp\":\"2023-03-20T09:08:07.542Z\"},\"info\":{\"name\":\"sun_going_under_on_the_7th\",\"directory\":\"/exports\"},\"deviceId\":\"10058b7a\"}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
const url = 'https://api.c030.eagleeyenetworks.com/api/v3.0/exports';
const options = {
method: 'POST',
headers: {accept: 'application/json', 'content-type': 'application/json'},
body: JSON.stringify({
type: 'video',
period: {
startTimestamp: '2023-03-19T09:08:07.542Z',
endTimestamp: '2023-03-20T09:08:07.542Z'
},
info: {name: 'sun_going_under_on_the_7th', directory: '/exports'},
deviceId: '10058b7a'
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));
On success, the response includes the ID of the new export job. The job will process asynchronously, and you can check its status using the /exports/{id}
endpoint.
{
"id": "f2d4ad7b-bada-4c44-9f70-9c4b85e46b7d"
}
Note
The id of the export job is not the same as the id of the archived file. To identify the file id, you need to wait for the job to complete and then call the /files with query parameters that match the
directory
andname
you specified in the request above.
Updated 1 day ago