Skip to main content
Version: 1.18.1

Event filters

ATTENTION!

All queries described below are available at http://$DOMAIN/event-service/graphql.

Get event filters

The eventsFilters() query allows you to get a list of event filters.

Input parameters:

  • filters:
    • id:
      • exact:
        • Websocket endpoint ID
        • Data type: ID
  • order:
    • creation_date (Sort the list of endpoints by creation date):
      • ASC: from earliest to latest
      • DESC: from latest to earliest
    • last_modified (Sort the list of endpoints by last modification date):
      • ASC: from earliest to latest
      • DESC: from latest to earliest
  • pagination:
    • offset
      • Allows you to remove the last n endpoints from the list.
      • Data type: Int.
    • limit
      • Allows you to get the last n endpoints from a list.
      • Data type: Int.

Output parameters:

  • totalCount
    • Total number of event filters found
    • Data type: Int.
  • collectionItems: EventFiltersOutput!:
    • id
      • Event filter ID
      • Data type: ID.
    • creationDate
      • Event filter creation date
      • Data format: Date and time in ISO format.
    • lastModified
      • Event filter last modification date
      • Data format: Date and time in ISO format.
    • meta
      • Event filter metadata
      • Data type: JSON
    • workspaceId
      • Workspace ID
      • Data type: ID.
    • endpoints
      • List of attached endpoints
      • Data type: EndpointOutput
    • name
      • Event filter name
      • Data type: String

Example request:

query MyQuery {
eventsFilters(
filters: {id: {exact: "452cb352-1315-44d1-95d0-15eb9a7760fb"}}
) {
totalCount
collectionItems {
endpoints {
workspaceId
type
name
meta
lastModified
id
creationDate
}
workspaceId
name
meta
lastModified
id
creationDate
}
}
}

Example response:

API returns the following result:
{
"data": {
"eventsFilters": {
"totalCount": 1,
"collectionItems": [
{
"endpoints": [
{
"workspaceId": "c641ff9c-67df-4c03-8fa6-ee2eabffdc16",
"type": "WEB_SOCKET",
"name": "MyEndpoint",
"meta": {},
"lastModified": "2024-05-22T08:55:23.460103+00:00",
"id": "52c6548d-3e17-4b9b-9268-ce51d6900530",
"creationDate": "2024-05-22T08:55:23.460103+00:00"
},
{
"workspaceId": "c641ff9c-67df-4c03-8fa6-ee2eabffdc16",
"type": "WEB_HOOK",
"name": "My Endpoint",
"meta": {
"url": "https://web-hook.server.com",
"method": "POST"
},
"lastModified": "2024-05-22T09:00:03.005626+00:00",
"id": "357fe643-2396-4919-bd9e-a30f0ac28818",
"creationDate": "2024-05-22T09:00:03.005626+00:00"
}
],
"workspaceId": "c641ff9c-67df-4c03-8fa6-ee2eabffdc16",
"name": "asdasd",
"meta": {
"agent_ids__in": [
"e24c9d1e-f0bb-468d-9e25-6d7d8ce92514"
],
"camera_ids__in": [
"9a607355-848a-42dc-9d6e-9982f5121a92"
],
"event_types__in": [
"identification"
],
"profile_group_ids__in": [
"06119cec-b17c-4e07-8db8-70478e8302f9"
]
},
"lastModified": "2024-05-22T10:27:31.653576+00:00",
"id": "452cb352-1315-44d1-95d0-15eb9a7760fb",
"creationDate": "2024-05-22T10:27:31.653576+00:00"
}
]
}
}
}

Create event filters

The mutation createEventFilters() allows you to create an event filter.

Input parameters:

  • eventFiltersInput: EventFiltersInput!:
    • in: ConditionFields!: // Filtering condition:
      • cameraIds
        • By list of camera IDs
        • Data type: List[String]
      • agentIds
        • By list of agent IDs
        • Data type: List[String]
      • profileGroupIds
        • By list of watchlist IDs
        • Data type: List[String]
      • eventTypes
        • By list of event types
        • Data type: List[String]
  • endpointIds
    • List of endpopint IDs
    • Data type: List[ID]

Output parameters:

  • id
    • Event filter ID
    • Data type: ID
  • creationDate
    • Event filter creation date
    • Data format: Date and time in ISO format.
  • lastModified
    • Event filter last modification date
    • Data format: Date and time in ISO format.
  • meta
    • Event filter metadata
    • Data type: JSON
  • name
    • Event filter name
    • Data type: String
  • workspaceId
    • Workspace ID
    • Data type: ID.
  • endpoints
    • List of attached endpoints
    • Data type: EndpointOutput

Example request:

mutation {
createEventFilters(
eventFiltersInput: {
in: {
profileGroupIds: ["06119cec-b17c-4e07-8db8-70478e8302f9"],
eventTypes: ["identification"],
cameraIds: ["9a607355-848a-42dc-9d6e-9982f5121a92"],
agentIds: ["e24c9d1e-f0bb-468d-9e25-6d7d8ce92514"]
}
}
name: "MyEventFilters"
endpointIds: ["357fe643-2396-4919-bd9e-a30f0ac28818", "52c6548d-3e17-4b9b-9268-ce51d6900530"]
) {
id
lastModified
meta
name
workspaceId
creationDate
endpoints {
creationDate
id
lastModified
meta
name
type
workspaceId
}
}
}

Example response:

API returns the following result:
{
"data": {
"createEventFilters": {
"id": "452cb352-1315-44d1-95d0-15eb9a7760fb",
"lastModified": "2024-05-22T10:27:31.653576+00:00",
"meta": {
"agent_ids__in": [
"e24c9d1e-f0bb-468d-9e25-6d7d8ce92514"
],
"camera_ids__in": [
"9a607355-848a-42dc-9d6e-9982f5121a92"
],
"event_types__in": [
"identification"
],
"profile_group_ids__in": [
"06119cec-b17c-4e07-8db8-70478e8302f9"
]
},
"name": "MyEventFilters",
"workspaceId": "c641ff9c-67df-4c03-8fa6-ee2eabffdc16",
"creationDate": "2024-05-22T10:27:31.653576+00:00",
"endpoints": [
{
"creationDate": "2024-05-22T08:55:23.460103+00:00",
"id": "52c6548d-3e17-4b9b-9268-ce51d6900530",
"lastModified": "2024-05-22T08:55:23.460103+00:00",
"meta": {},
"name": "MyEndpoint",
"type": "WEB_SOCKET",
"workspaceId": "c641ff9c-67df-4c03-8fa6-ee2eabffdc16"
},
{
"creationDate": "2024-05-22T09:00:03.005626+00:00",
"id": "357fe643-2396-4919-bd9e-a30f0ac28818",
"lastModified": "2024-05-22T09:00:03.005626+00:00",
"meta": {
"url": "https://web-hook.server.com",
"method": "POST"
},
"name": "My Endpoint",
"type": "WEB_HOOK",
"workspaceId": "c641ff9c-67df-4c03-8fa6-ee2eabffdc16"
}
]
}
}
}

Delete event filters

The deleteEventsFilters() mutation allows you to delete a list of event filters.

Input parameters:

  • ids!
    • List of event filter IDs
    • Data type: List[ID]

Output parameters:

  • ok!
    • Flag indicating successful completion of the operation
    • Data type: Boolean

Example request:

mutation {
deleteEventsFilters(ids: ["2eff291d-8c8c-4325-8953-5a70b31bc63e", "29bcfb3a-3a26-4544-9def-d5d44bbd3be4"]) {
ok
}
}

Example response:

API returns the following result:
{
"data": {
"deleteEventsFilters": {
"ok": true
}
}
}