Skip to main content
Version: 1.18.1

Activities

Get activities

Query activities allows to get a list of activities detected by the camera.

notifications(filters: ActivityFilter order: ActivityOrdering pagination: OffsetPaginationInput): ActivityOutputCountList!

Input parameters:

filters: ActivityFilter: To get only required activities, you can adjust filtration

  • id: Filtration by activity ID:
    • exact: ID: Get an exact activity object using the value of activity ID.
    • iExact: ID: Get an exact activity object using the value of activity ID. Not case-sensitive.
    • contains: String: Get activity objects using the value matching with activity ID.
    • iContains: String: Get activity objects using the value matching with activity ID. Not case-sensitive.
    • inList: [ID!]: Get certain activity objects using a list of activity IDs.
    • gt: ID: Get activity objects which IDs are greater (>) than submitted ID. String matching is used.
    • gte: ID: Get activity objects which IDs are greater than or equal to (>=) to submitted ID. String matching is used.
    • lt: ID: Get activity objects which IDs are less (<) than submitted ID. String matching is used.
    • lte: ID: Get activity objects which IDs are less than or equal to (<=) to submitted ID. String matching is used.
    • startsWith: String: Get activity objects which IDs start with submitted value.
    • iStartsWith: String: Get activity objects which IDs start with submitted value. Not case-sensitive.
    • endsWith: String: Get activity objects which IDs end with submitted value.
    • iEndsWith: String: Get activity objects which IDs end with submitted value. Not case-sensitive.
    • range: [ID!]: Get activity objects which IDs are within the range of submitted IDs. String matching is used.
    • isNull: Boolean: Get activity objects which IDs are equal(true) or not equal to(false) null.
    • regex: String: Get activity objects which IDs meet a submitted regular expression.
    • iRegex: String: Get activity objects which IDs meet a submitted regular expression. Not case-sensitive.
  • creationDate: DatetimeFilterLookupCustom: Filtration by activity creation date. The parameters are similar to the ones for filtration by ID.
  • lastModified: DatetimeFilterLookupCustom: Filtration by date of the last activity modification. The parameters are similar to the ones for filtration by ID.
  • profileId: ID: Activity filtration by profile ID.

order: ActivityOrdering: You can adjust sorting of activity list:

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

pagination: OffsetPaginationInput:

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

Output parameters:

ActivityOutputCountList!: The query result is an activity list that contains the following parameters:

  • totalCount: Int!: Number of returned activities.
  • collectionItems: [ActivityOutput!]!:
    • id: ID!: Activity ID.
    • data: JSON: Additional information about activity.
    • lastModified: DateTime: Date of the last activity modification in ISO 8601 format.
    • agentTitle: String: Name of the Agent that sent processes for the activity.
    • creationDate: DateTime!: Activity creation date in ISO 8601 format.
    • bestShotId: ID: ID of the best face image received from the camera that detected the activity (Missing, if the anonymous mode is enabled or the camera couldn't detect a face image).
    • cameraId: ID!: ID assigned to the camera that detected the activity.
    • cameraTitle: String: Name of the camera that caught the activity.
    • locationId: String!: ID assigned to location which the camera is linked to.
    • profileId: ID: Profile ID.
    • status: ActivityType!:
      • Progress
      • Finalized
      • Failed
    • timeStart: String!: Activity starting time.
    • timeEnd: String!: Activity ending time.

Example Request:

{
activities(filters: {
id: {
exact: "78f7c795-0f28-42ce-a9d2-818095dd5f84"
}
}) {
totalCount
collectionItems {
id
data
cameraId
bestShotId
locationId
profileId
timeStart
creationDate
lastModified
cameraTitle
agentTitle
}
}
}

Example Response:

API returns the following result:
{
"data": {
"activities": {
"totalCount": 1,
"collectionItems": [
{
"id": "78f7c795-0f28-42ce-a9d2-818095dd5f84",
"data": {
"processes": [
{
"id": "78f7c795-0f28-42ce-a9d2-818095dd5f84",
"type": "track",
"object": {
"id": "c4398bcc-6fee-495a-be86-a59918a875e5",
"class": "human"
},
"time_interval": [
"2022-07-07T12:36:51.644000+05:00",
"2022-07-07T12:36:51.725000+05:00"
]
},
{
"id": "ecb65ed1-e3c5-484f-b1e3-7f4bdf869757",
"type": "track",
"object": {
"id": "c4398bcc-6fee-495a-be86-a59918a875e5",
"age": 36,
"class": "face",
"gender": "MALE",
"quality": -1114.097412109375,
"embeddings": {
"$binary_image": {
"id": "7fd8abfb-258b-4d6a-bdd7-eec1e30fd0b4"
},
"$template10v100": {
"id": "35b60b5f-d6da-4998-ac4c-5725d3e64520"
}
}
},
"parent": "78f7c795-0f28-42ce-a9d2-818095dd5f84",
"sample_id": "3071e862-7116-4ed3-94f1-309b0b5b912f",
"$best_shot": {
"id": "ab8d76c8-0a8c-4575-8d81-e9e469f8ef64"
},
"time_interval": [
"2022-07-07T12:36:51.644000+05:00",
"2022-07-07T12:36:51.725000+05:00"
]
},
{
"id": "3e33004f-6531-40ca-90d5-8345f66002ac",
"type": "attention",
"parent": "ecb65ed1-e3c5-484f-b1e3-7f4bdf869757",
"time_interval": [
"2022-07-07T12:36:51.806000+05:00",
"2022-07-07T12:36:52.413000+05:00"
]
}
]
},
"cameraId": "3c818dc4-352c-47a7-b32b-465fbd4a9665",
"bestShotId": "ab8d76c8-0a8c-4575-8d81-e9e469f8ef64",
"locationId": "",
"cameraTitle": "CameraName",
"agentTitle": "AgentName",
"profileId": "1cf13933-00be-4a6d-8dc3-3ff17f94aef8",
"timeStart": "2022-07-07T12:36:51.644000+05:00",
"creationDate": "2022-07-07T07:36:52.848815+00:00",
"lastModified": "2022-07-07T08:59:56.385040+00:00"
}
]
}
}
}