Skip to main content
Skip table of contents

Retrieve a list of cameras with the installed Agent

The method and parameters

With this method, you can retrieve a paginated list of cameras with the installed Agent that are available in the system.

Camera Agent is a software that camera manufacturers can integrate directly into the device firmware. The Agent integrated into the camera ensures the transmission of video and audio streams directly from users' local networks over an encrypted communication channel. This software serves as intermediaries that enable media servers to access and control cameras on separate networks.

A required permission level is camera-agents.

GET api/admin/v1/camera-agents

The parameters

string search – search is carried out by serial number or MAC address of a device.

bool is_online – filter devices by their online status: 1 – online, 0 - offline.

string status –  filter devices by a camera status, active – active, inactive – inactive, partial – partially active.

int per_page – a number of elements on a single pagination page.

string sort – the field by which devices are sorted.

string dir – the field that specifies the sorting direction: desc – a descending order: asc – an ascending order

array users – an array of user IDs. This field is used to filter cameras by associated users.

int page –  a pagination page number.

cURL
BASH
curl -k --request POST \
	--url 'https://your-domainapi/admin/v1/camera-agents' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '{
    "search": "string",
    "is_online": true,
    "status": "string",
    "per_page": 0,
    "sort": "string",
    "dir": "string",
    "users": [],
    "page": 0
}'
PHP
PHP
$data = array (
  'search' => 'string',
  'is_online' => true,
  'status' => 'string',
  'per_page' => 0,
  'sort' => 'string',
  'dir' => 'string',
  'users' => 
  array (
  ),
  'page' => 0,
);
$context = stream_context_create([
	'ssl'=>['verify_peer' => false],
	'http' => [
		'method' => 'GET',
		'header' => "Content-Type: application/json\r
Accept: application/json",
		'content'=>json_encode($data)
	]
]);
$result = file_get_contents('https://your-domainapi/admin/v1/camera-agents', false, $context);

Responses

A detailed list of response codes is in the General description API documentation section.

A successful response:

200 – OK

200 OK

Returns a list of cameras with agents on the i pagination page.

JSON
{
    "data": [
        {
            "id": 1,
            "name": "camera-1",
            "uuid": "a21907cf-391b-4350-affe-3a6bdfdbd5e5",
            "mac": "mac1",
            "serial_number": "serial1",
            "status": "activated",
            "is_online": true,
            "version": "3.4",
            "created_at": "2024-05-31T13:17:08.000000Z",
            "updated_at": "2024-05-31T13:17:08.000000Z",
            "last_updated_at": null,
            "camera": {
                "id": 1,
                "group_id": 1,
                "status": "active",
                "type": "mediaagent",
                "start_at": null,
                "created_at": "2024-06-04T12:36:42.000000Z",
                "name": "name",
                "can_edit": true,
                "origin": null,
                "group_type": "public",
                "ip": "127.0.0.1",
                "lat": null,
                "lng": null,
                "azimuth": null,
                "is_sensitive": false,
                "is_buffer_enabled": false,
                "is_public": 0,
                "is_ip_reserved": false,
                "count_issues": 0,
                "source": "manual",
                "archive_storage_days": 80,
                "is_archive_recording": false,
                "archive_recording_type": "fulltime",
                "is_local_archive_enabled": false,
                "local_archive_storage_days": 30,
                "is_increased_reconnect": 0,
                "is_sound_enabled": true,
                "is_bridge": false,
                "is_agent": true,
                "is_auto_create_streams": false,
                "is_provisioning_enable": false,
                "is_editable": true,
                "status_changed_at": null,
                "is_intercom": false,
                "deleted_at": null,
                "is_need_replace": false
            }
        }
    ],
    "links": {
        "first": "https://vms.local:8080/api/admin/v1/camera-agents?page=1",
        "last": "https://vms.local:8080/api/admin/v1/camera-agents?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "pagination.previous",
                "active": false
            },
            {
                "url": "https://vms.local:8080/api/admin/v1/camera-agents?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": null,
                "label": "pagination.next",
                "active": false
            }
        ],
        "path": "https://vms.local:8080/api/admin/v1/camera-agents",
        "per_page": 25,
        "to": 1,
        "total": 1
    }
}
  • Responses with errors:

401 Unauthorized

The authorization token is invalid or isn’t submitted.

422 Unprocessable Entity

Returns a JSON object with an error.

JSON
{
    "message": "There will be no informative message here",
    "errors": {
        "any_key": [
            "The cause of the error will be described here"
        ]
    }
}
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.