Event Retrieval
Pre-requisite: The user has to be signed in to perform the following operations.
Get Event Tokens
To get the event token, The following method can be used:
spaceId(required): The space id for which the tokens is to be fetched.
InstaVision.eventServices.getEventTokens(
spaceId = spaceId, // The space id for which the tokens is to be fetched
onSuccess = { eventTokens ->
// A list of objects containing the event token for each bucket.
},
onError = { error ->
// The error object contains the error code and message
}
)
Get Events
To get the list of events, The following method can be used:
spaceId(required): The space id for which the events are to be fetched.deviceIds(optional): The list of device ids to filter the events by.from(required): The start time from events to be fetched from.to(required): The end time upto which the events have to be fetch.tags(optional): The list of tags to filter the events by.skip(required): The number of events to be skipped in order for pagination.
InstaVision.eventServices.getEvents(
spaceId = spaceId, // The space id for which the events are to be fetched
deviceIds = deviceIds, // The list of device ids to filter the events by
from = startTime, // The start time of the events
to = endTime, // The end time of the events
tags = tags, // The list of tags to filter the events by
skip = 0, // The number of events to skip
onSuccess = { events ->
// The list of events
},
onError = { error ->
// The error object contains the error code and message
}
)
Get Event
To get the event, The following method can be used:
spaceId(required): The space id for which the event belongs to.eventId(required): The event id for which the event is to be fetched.
InstaVision.eventServices.getEvent(
spaceId = spaceId, // The space id for which the event belongs to
eventId = eventId, // The event id for which the event is to be fetched
onSuccess = { event ->
// The event object
},
onError = { error ->
// The error object contains the error code and message
}
)
Get Event Ids for semantic search
To get the list of event ids for semantic search, The following method can be used:
spaceId(required): The space id for which the events are to be fetched.query(required): The search query string.
InstaVision.eventServices.searchEvents(
spaceId = spaceId, // The space id for which the events are to be fetched
query = query, // The search query string
onSuccess = { eventIds ->
// The list of event ids matching the search query
},
onError = { error ->
// The error object contains the error code and message
}
)
Get NVR Event Tokens
To get the event tokens for an NVR device, The following method can be used:
spaceId(required): The space id for which the tokens is to be fetched.
InstaVision.eventServices.getNvrEventTokens(
spaceId = spaceId, // The space id for which the tokens is to be fetched
onSuccess = { eventTokens ->
// A list of objects containing the event token for each NVR bucket.
},
onError = { error ->
// The error object contains the error code and message
}
)
Submit Event Feedback
To submit feedback on whether an event’s detection was accurate, The following method can be used:
spaceId(required): The space id for which the event belongs to.eventId(required): The event id for which feedback is being submitted.isAccurate(required): Whether the event’s detection was accurate.
InstaVision.eventServices.feedback(
spaceId = spaceId, // The space id for which the event belongs to
eventId = eventId, // The event id for which feedback is being submitted
isAccurate = true, // Whether the event's detection was accurate
onSuccess = {
// Feedback submitted successfully
},
onError = { error ->
// The error object contains the error code and message
}
)