Update a camera with the installed Agent
The method and parameters
The method is used to update a camera device with the installed Agent.
A required permission level is camera-agents
.
PATCH /api/admin/v1/camera-agents/{cameraAgent} |
The parameters:
int cameraAgent
– a unique device identifier.
string name
– a device name.
bool is_local_archive_enabled
– enable or disable a local archive.
bool is_cloud_archive_enabled
– enable or disable a cloud archive.
int cloud_archive_storage_days
– a number of storage days for the cloud archive.
Example:
{
"name": "name-updated",
"is_local_archive_enabled": false,
"is_cloud_archive_enabled": false,
"cloud_archive_storage_days": 80
}
cURL
curl -k --request POST \
--url 'https://your-domain/api/admin/v1/camera-agents/{cameraAgent}' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
"cameraAgent": 0,
"name": "string",
"is_local_archive_enabled": true,
"is_cloud_archive_enabled": true,
"cloud_archive_storage_days": 0
}'
PHP
$data = array (
'cameraAgent' => 0,
'name' => 'string',
'is_local_archive_enabled' => true,
'is_cloud_archive_enabled' => true,
'cloud_archive_storage_days' => 0,
);
$context = stream_context_create([
'ssl'=>['verify_peer' => false],
'http' => [
'method' => 'PATCH',
'header' => "Content-Type: application/json\r
Accept: application/json",
'content'=>json_encode($data)
]
]);
$result = file_get_contents('https://your-domain/api/admin/v1/camera-agents/{cameraAgent}', false, $context);
Responses
A detailed list of response codes is in the General description API documentation section.
A successful response:
200 – a successful response
200 |
Returns the device object.
JSON
|
Error responses:
401 |
The authorization token is invalid or isn’t submitted. |
422 |
Returns a JSON object with an error.
JSON
|