With the release of the new request version v2, version v1 is moved to legacy.
For new integrations, use the current version v2.
Version v1 remains available to support existing integrations.
|
PATCH /api/v2/billing/cameras |
This method updates a camera in VMS through an external system. Identify the camera using one of these parameters:id, external_idormac. Parameters that aren't provided remain unchanged, except foronvif_credentialsfields: this object replaces all camera ONVIF settings.
Moving a camera to another tree element or private folder uses the same parameters as camera creation: VMS Billing / External system cameras / Create a camera by an external system
If the request contains thestreamsfield with a video stream type that hasn't been created yet, these settings are applied when that stream is created.
{
"external_id": "bd0a951f-40a2-4edf-b213-bcd90ff5273d",
"new_mac": "12:12:12:12:12:12",
"serial_number": "111111111111",
"service": "8MP",
"profile": [
1,
0
],
"name": "Camera 1",
"group_type": "private",
"group_id": 16,
"folder_id": 3,
"is_user_owner": false,
"latitude": -28.776933731993793,
"longitude": 76.65771489519997,
"onvif_credentials": {
"login": "login",
"password": "password",
"port": 80,
"ip": "192.168.1.100",
"network": "direct",
"network_scope": "local",
"nat_port": 8080
},
"start_provisioning": true,
"is_can_manage_archive_storage_days": false,
"is_enabled": true,
"log_extra": {
"some": "information"
},
"streams": [
{
"type": "high",
"is_archive_enabled": false
},
{
"type": "low",
"is_archive_enabled": true,
"archive_storage_days": 14
}
]
}
Method parameters
int id required , Camera ID in VMS (required if external_id and mac aren't specified; provide only one of the three)
string external_id required , Current camera external_id (required if id and mac aren't specified)
string mac required , Current camera MAC address, maximum 48 characters (required if id and external_id aren't specified)
string new_external_id, New camera external_id, maximum 50 characters. Must be unique among VMS cameras
string new_mac, New camera MAC address, for example when replacing a device, maximum 48 characters. Must be unique among VMS cameras; `00:00:00:00:00:00` and `11:11:11:11:11:11` aren't allowed
string serial_number, New camera serial number as shown on the device, maximum 100 characters. Must be unique among VMS cameras
string service, Camera profile used to apply configuration templates (video quality settings). Allowed values: `1.3MP`, `2MP`, `3MP`, `4MP`, `6MP`, `8MP`, `Any`
array profile, Additional camera profile data (for example, resolution and frame rate) in any format. VMS stores the data unchanged
string name, Camera name, maximum 255 characters; an empty value isn't allowed. Displayed in the VMS interface
string group_type, Camera group type: `private` – the camera is available to a limited set of users, with access controlled by a private folder (folder_id or folder_key is required); `public` – the camera is available to all users of the tree element and is removed from the private folder
int group_id, ID of the leaf tree element in VMS to which the camera is moved. Can't be provided together with group_external_id
string|int group_external_id, Key of the leaf tree element assigned by the external system when it was created, identifying the element to which the camera is moved. Can't be provided together with group_id
int folder_id, ID of the private folder in VMS where the camera is placed. The folder must be in the camera's tree element (the new element, if provided). Applies to a private camera or together with group_type = `private`. Can't be provided together with folder_key
string|int folder_key, Key assigned when the private folder was created. The same conditions apply as for folder_id. Can't be provided together with folder_id
bool is_user_owner, Flag indicating whether the camera belongs to a user
double latitude, Latitude of the camera installation location, from -90 to 90. Provided together with longitude; used to display the camera on the map
double longitude, Longitude of the camera installation location, from -180 to 180. Provided together with latitude
array onvif_credentials, Credentials for accessing the camera through ONVIF. Replace all camera ONVIF settings: omitted fields are reset, and network, network_scope, and nat_port receive their default values
bool start_provisioning, Start ONVIF provisioning after updating the camera. Requires onvif_credentials.port and an IP address (from the request or the camera's network device); returns 422 if they're missing
bool is_can_manage_archive_storage_days, Whether the camera archive retention period can be changed in VMS. If `false`, only the external system sets the retention period
bool is_enabled, Enable or disable camera video stream capture. When capture is disabled, the recorded archive remains available
array shared_groups_to_attach, Tree elements (and their folders) where camera sharing must be enabled
array shared_groups_to_detach, Tree elements (and their folders) where camera sharing must be disabled
string|array log_extra, Additional information from the external system: a string or array
array streams, Archive settings by stream type
|
200 |
|
Successful response JSON
|
|
422 |
|
Returns a JSON error object For more information, seeGeneral information > Validation. JSON
|