Skip to main content
Version: 1.13.0

Notifications

Get Notifications

Query notifications is used to get a list of notifications sent from the system.

notifications(filters: NotificationFilter
order: NotificationOrdering
pagination: OffsetPaginationInput): NotificationOutputCountList!

filters: NotificationFilter: To get only required notifications, you can adjust filtration

  • id: Filtration by notification IDs:
    • exact: ID: Get an exact notification object using ID notification value.
    • iExact: ID: Get an exact notification object using ID notification value. Not case-sensitive.
    • contains: String: Get notification objects using value matching with notification ID.
    • iContains: String: Get notification objects using value matching with notification ID. Not case-sensitive.
    • inList: [ID!]: Get exact notification objects using a list of notification IDs.
    • gt: ID: Get notification objects which IDs are greater(>) than submitted IDs. String matching is used.
    • gte: ID: Get notification objects which IDs are greater than or equal to (>=) submitted ID. String matching is used.
    • lt: ID: Get notification objects which IDs are less (<) than submitted ID. String matching is used.
    • lte: ID: Get notification objects which IDs are less than or equal to(<=) submitted ID. String matching is used.
    • startsWith: String: Get notification objects which IDs start with submitted value.
    • iStartsWith: String: Get notification objects which IDs start with submitted value. Not case-sensitive.
    • endsWith: String: Get notification objects which IDs end with submitted value.
    • iEndsWith: String: Get notification objects which IDs end with submitted value. Not case-sensitive.
    • range: [ID!]: Get notification objects which IDs are within the range of submitted IDs. String matching is used.
    • isNull: Boolean: Get notification objects which IDs are equal(true) or not equal(false) to null.
    • regex: String: Get notification objects which IDs meet a submitted regular expression.
    • iRegex: String: Get notification objects which IDs meet a submitted regular expression. Not case-sensitive.
  • creationDate: DatetimeFilterLookupCustom: Filtration by notification creation date. The parameters are similar to the ones for filtration by ID.
  • lastModified: DatetimeFilterLookupCustom: Filtration by date of the last notification modification. The parameters are similar to the ones for filtration by ID.
  • isViewed: Boolean: Filtration of viewed (true) and not viewed (false) notifications.
  • isActive: Boolean: Filtration of active (true) and not active (false) notifications.
  • endpointId: UUID: Filtration of notifications by ID assigned to the endpoint they were sent to.
  • isSent: Boolean: Filtration of notifications by in-system notifications (true) and notifications sent to external endpoints (false).
  • triggerId: ID: Filtration of notifications by trigger ID.
  • profileId: ID: Filtration of notifications by profile ID.
  • type: NotificationType: Filtration of notifications by type.
  • profileGroupTitle: String: Filtration of notifications by group name.

order: NotificationOrdering: You can adjust sorting of notification list:

  • id: Ordering: Sorting by ID. String matching is used.(ASC: Ascending sorting, DESC: Descending sorting)
  • creationDate: Ordering: Sorting by notification creation date.
  • lastModified: Ordering: Sorting by date of the last notification modification.

pagination: OffsetPaginationInput:

  • limit: Int!: This parameter allows to get the first n notifications from the list.
  • offset: Int!: This parameter allows to remove the first n notifications from the list.

NotificationOutputCountList!: The query result is a list of notifications that contains the following parameters:

  • totalCount: Int!: Total number of notifications.
  • collectionItems: [NotificationOutput!]!:
    • id: ID!: Notification ID.
    • isActive: Boolean!: Attribute that notification is active.
    • isViewed: Boolean!: Attribute that notification is viewed.
    • lastModified: DateTime: Date of the last notification modification in ISO 8601 format.
    • activityId: ID: ID assigned to activity that causes creating of notification.
    • avatarId: ID: Profile avatar ID.
    • cameraId: ID: ID assigned to a camera that detected the activity.
    • cameraTitle: String: Camera name
    • creationDate: DateTime!: Notification creation date in ISO 8601 format.
    • currentCount: Int: Number of persons in the camera's field of view
    • description: String: Profile description
    • endpointStatuses: [EndpointStatusOutput!]: List of endpoints and their statuses:
      • endpoint: EndpointOutput!: Endpoint object.
      • status: String!: Submission status.
    • limit: Int: Max number of persons.
    • name: String: Profile name.
    • profileGroupColor: String: Color of the group linked to a trigger.
    • profileGroupId: ID: ID assigned to the group linked to a trigger.
    • profileGroupTitle: String: Name of the group linked to a trigger.
    • profileId: ID: Profile ID.
    • realtimeBodyPhotoId: String: ID assigned to a photo of the person detected by camera (Missing, if the anonymous mode is enabled).
    • realtimeFacePhotoId: String: ID assigned to a face image of a person detected by camera (Missing, if the anonymous mode is enabled).
    • triggerId: ID: ID assigned to a trigger that caused the notification.
    • type: String!: Notification type.

Example Request:

{
notifications(filters: {
id: {
exact: "ed1a55af-6daf-4368-ac68-0defdff5159c"
}
}) {
totalCount
collectionItems {
profileGroupColor
activityId
avatarId
cameraId
cameraTitle
creationDate
currentCount
description
id
endpointStatuses {
status
endpoint {
id
}
}
isActive
isViewed
lastModified
limit
name
profileGroupId
profileGroupTitle
profileId
realtimeBodyPhotoId
realtimeFacePhotoId
triggerId
type
}
}
}

Example Response:

API returns the following result:
{
"data": {
"notifications": {
"totalCount": 1,
"collectionItems": [
{
"profileGroupColor": "red.600",
"activityId": "f3bf0ac7-5849-45d7-85e0-12de925633da",
"avatarId": "4312809b-99b2-47a7-beb9-b60b87c07594",
"cameraId": "3c818dc4-352c-47a7-b32b-465fbd4a9665",
"cameraTitle": "My <ShortProductName/> Agent",
"creationDate": "2022-07-07T13:10:53.619145+00:00",
"currentCount": null,
"description": "gap\n",
"id": "ed1a55af-6daf-4368-ac68-0defdff5159c",
"endpointStatuses": [
{
"status": "success",
"endpoint": {
"id": "db38ec53-c09d-45f2-bfed-5877c9bd9016"
}
}
],
"isActive": false,
"isViewed": true,
"lastModified": "2022-07-07T13:11:12.264337+00:00",
"limit": null,
"name": null,
"profileGroupId": "97c1a9fa-bfde-460a-9bda-f610060423ca",
"profileGroupTitle": "My persons",
"profileId": "b4a16647-1336-4ed8-a440-e4e8896e1de3",
"realtimeBodyPhotoId": "339a4020-a9af-49e8-83d4-3fc34ef794e5",
"realtimeFacePhotoId": null,
"triggerId": "66b3eb1a-de88-469e-83c9-697785a0a4c2",
"type": "presence"
}
]
}
}
}

View Notifications

Mutation viewingNotifications marks one or several notifications as viewed.

viewingNotifications(notificationIds: [String!]!): MutationResult!

notificationIds: [String!]!: List of IDs assigned to notifications which should be marked as viewed.

MutationResult:The mutation result is JSON that contains the following parameters:

  • ok: Boolean!: Attribute that mutation is successfully completed.

Example Request:

mutation{
viewingNotifications(notificationIds: ["5a1a1bed-5bc0-4e8e-8154-e56c5ef5ea87"]) {
ok
}
}

Example Response:

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

View All Notifications

Mutation markAllNotificationsAsViewed marks all notifications as viewed.

markAllNotificationsAsViewed: MutationResult!

MutationResult:The mutation result is JSON that contains the following parameters:

  • ok: Boolean!: Attribute that mutation is successfully completed.

Example Request:

mutation{
markAllNotificationsAsViewed {
ok
}
}

Example Response:

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