Cameras
Get cameras
Query cameras
is used to get a list of cameras.
query {
cameras() { } }
Input parameters:
- ids
- To get a list with certain profile groups, specify their IDs.
- Data type: ID.
- filter
- Filtering the list of cameras (e.g., by custom fields)
- Data type: JSONString.
- order
- Sorting the list of cameras (by custom fields in alphabetical/reverse alphabetical order)
- Data type: String.
- offset
- The parameter is used to exclude the last n agents from the list.
- Data type: Int.
- limit
- The parameter is used to get the last n agents from the list.
- Data type: Int.
- withArchived:
- all: List of all cameras, including archived ones.
- archived: List of archived cameras only.
Output parameters:
- totalCount
- Total number of returned cameras
- Data type: Int.
- collectionItems: CameraOutput:
- id
- Camera identifier
- Data type: ID.
- creationDate
- Camera creation date
- Data format: ISO 8601
- lastModified
- Last modification date
- Data format: ISO 8601
- info
- Camera data, e.g., camera custom fields
- Data format: JSON.
- id
Example Request:
query {
cameras {
totalCount
collectionItems {
id
creationDate
lastModified
info
}
}
}
Example Response:
API returns the following result:
Create a camera
Mutation createCamera
is used to create a camera object.
mutation {
cameras() { }}
Input parameters:
- cameraData:
- fields:
- name
- Name of camera field
- Data type: String.
- value
- Value in camera field
- Data type: String.
- name
- agentId
- Identifier assigned to an agent which the camera will be bound to
- Data type: ID.
- fields:
Output parameters:
- ok
- Mutation completion status
- Data type: Boolean
- camera: CameraOutput
Example Request:
mutation
{createCamera(
cameraData: {fields: {name:"Title" value:"Camera 1"} agentId:"***"})
{
ok
camera {
id
creationDate
lastModified
info
}
}
}
Example Response:
API returns the following result:
Delete a camera
Mutation deleteCameras
is used to delete a camera object.
mutation {
deleteCameras() { }}
Input parameters:
- cameraIds
- Identifiers of cameras to be deleted
- Data type: ID
Output parameters:
- ok
- Mutation completion status
- Data type: Boolean
Example Request:
mutation {
deleteCameras(cameraIds: ["***"])
{
ok
}
}
Example Response:
API returns the following result:
Update a camera
Mutation updateCamera
is used to update data in a camera object (e.g., update data in camera fields).
mutation {
updateCamera() { }}
Input parameters:
- cameraId
- Identifier assigned to a camera which data should be updated
- Data type: ID.
- cameraData:
- fields:
- name
- Name of camera field
- Data type: String.
- value
- New value in camera field
- Data type: String.
- name
- agentId
- Identifier assigned to an agent which the camera will be bound to
- Data type: ID
- fields:
Output parameters:
- ok
- Mutation completion status
- Data type: Boolean
- camera: CameraOutput
Example Request:
mutation {
updateCamera(cameraId: "***"
cameraData: {fields: {name:"Title" value:"Camera 3"}})
{
ok
camera{
id
info
}
}
}
Example Response:
API returns the following result:
Link cameras to an Agent
Mutation addCamerasToAgent
is used to link cameras to an agent.
mutation {
addCamerasToAgent() { }}
Input parameters:
- camerasIds
- Identifiers assigned to cameras which should be linked to an agent
- Data type: ID.
- agentId
- Identifier assigned to an agent to which cameras will be linked
- Data type: ID.
Output parameters:
- ok
- Mutation completion status
- Data type: Boolean
- agent: AgentOutput
Example Request:
mutation {
addCamerasToAgent(camerasIds:"***" agentId: "***")
{
ok
agent {
id
creationDate
lastModified
token
camerasIds
cameras {
id
}
title
agentStatus
agentLastActiveTime
archived
}
}
}
Example Response:
API returns the following result:
Unlink cameras from an Agent
Mutation removeCamerasFromAgent
is used to link cameras to an agent.
mutation {
removeCamerasFromAgent() { }}
Input parameters:
- camerasIds
- Identifiers assigned to cameras which should be linked to an agent
- Data type: ID.
- agentId
- Identifier assigned to an agent to which cameras will be linked
- Data type: ID.
Output parameters:
- ok
- Mutation completion status
- Data type: Boolean
- agent: AgentOutput
Example Request:
mutation {
removeCamerasFromAgent(camerasIds: "***" agentId: "***")
{
ok
agent {
id
creationDate
lastModified
token
camerasIds
cameras {
id
}
title
agentStatus
archived
}
}
}
Example Response:
API returns the following result:
Get a list of custom fields for cameras
Query collectorSettings
returns a list of camera custom fields.
query {
collectorSettings() { }}
Output parameters:
- cameraFields
- List of current camera fields
- Data type: String.
Example Request:
query {
collectorSettings
{
cameraFields
}
}
Example Response:
API returns the following result:
Add custom fields for cameras
Mutation addCamerasField
is used to add camera custom fields.
mutation {
addCamerasField() { }}
Input parameters:
- fieldInput:
- name
- Name of a new camera field
- Data type: String.
- name
Output parameters:
- ok
- Mutation completion status
- Data type: Boolean.
- fields
- List of current camera fields
- Data type: String.
Example Request:
mutation {
addCamerasField(fieldInput: {name: "model"})
{
ok
fields
}
}
Example Response:
API returns the following result:
Delete custom fields for cameras
Mutation removeCamerasField
is used to delete camera custom fields.
mutation {
removeCamerasField() { }}
Input parameters:
- fieldInput:
- name
- Name of camera field to be deleted
- Data type: String.
- name
Output parameters:
- ok
- Mutation completion status
- Data type: Boolean.
- fields
- List of current camera fields
- Data type: String.
Example Request:
mutation {
removeCamerasField(fieldInput: {name: "model"})
{
ok
fields
}
}
Example Response: