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.
|
POST /api/v2/billing/cameras |
This method creates a camera in VMS through an external system.
A camera is created in a leaf tree element – an element without children. Cameras can be assigned only to such elements. Specify the element bygroup_id– its ID in VMS, or bygroup_external_id– the key assigned by the external system when the element was created. VMS Billing / Tree / Create a tree element
To restrict camera access to specific users within a single tree element, passgroup_type = privateand place the camera in a private folder: specify eitherfolder_id– the folder ID in VMS, orfolder_key– the key assigned when the folder was created. The folder must be in the same tree element where the camera is created.VMS Billing / Tree / Folders / Create a private folder. A public camera (group_type = public) isn't placed in a folder.
If the request contains thestreamsfield, archive settings for the specified stream types are saved and applied later when the video streams are created.
{
"name": "Camera 1",
"mac": "AA:BB:CC:DD:EE:FF",
"serial_number": "12345678",
"group_type": "private",
"group_id": 16,
"folder_id": 3,
"is_user_owner": false,
"latitude": -28.776933731993793,
"longitude": 76.65771489519997,
"service": "8MP",
"external_id": "unique_id",
"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": true,
"log_extra": {
"some": "information"
},
"streams": [
{
"type": "high",
"is_archive_enabled": true,
"archive_storage_days": 30
},
{
"type": "low",
"is_archive_enabled": false
}
]
}
Method parameters
string name required , Camera name, maximum 255 characters. Displayed in the VMS interface; specified by the external system
string mac, Camera MAC address, maximum 48 characters (for example, `AA:BB:CC:DD:EE:FF`). Found in the camera specifications or network equipment settings. 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, Camera serial number as shown on the device, maximum 100 characters. Must be unique among VMS cameras. Omit this parameter if the serial number is unknown
int intercom_id, ID of the intercom for which the camera is created. The intercom must not already have a camera; the camera counts toward the intercom camera license limit
string group_type required , 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 folder_id and folder_key must not be provided
int group_id required , ID of the leaf tree element in VMS where the camera is created (required if group_external_id isn't specified; can't be provided together with it). The ID is returned when the tree element is created and in the response fromVMS Billing / Tree / Get the platform tree.
string|int group_external_id required , Key of the leaf tree element assigned by the external system when it was created (required if group_id isn't specified). Allows referring to the element without its VMS ID
int folder_id required , ID of the private folder in VMS where the camera is placed (when group_type = `private`, required if folder_key isn't specified; can't be provided together with it). The ID is returned when the private folder is created
string|int folder_key required , Key assigned when the private folder was created (when group_type = `private`, required if folder_id isn't specified)
bool is_user_owner, Flag indicating whether the camera belongs to a user. Default: `false`
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
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 external_id, Camera identifier in the external system, used to refer to the camera in other methods. Must be unique among VMS cameras
bool is_sound_enabled, Enable camera audio. Default: `false`
array onvif_credentials, Credentials for accessing the camera through ONVIF. Omit this parameter if the camera doesn't support ONVIF
bool start_provisioning, Start ONVIF provisioning after creating the camera. Requires onvif_credentials.ip and onvif_credentials.port; 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. Default: `true`
string|array log_extra, Additional information from the external system: a string or array
array streams, Archive settings by stream type
|
201 |
|
Successful response JSON
|
|
422 |
|
Returns a JSON error object. For more information, seeGeneral information > Validation. JSON
|