Skip to main content

Query for events

This tutorial will demonstrate how you can use the Analytics API to query events from your Sovrin API tenant.

The following request is an example of how you may query your events database:

Request

GET https://api.sovrin.one/core/v1/analytics/events
?requestIds=0QdK3jkDSPbOu1Sx9K2lM9
&limit=10
&cursor=Y3JlYXRlZEF0PTIwMjAtMDgtMjVUMDY6NDY6MDkuNTEwWiZpZD1h

This request queries the tenant for all analytic events that match the included requestIds.

Response

{
"data": [
{
"id": "f570ff36-9035-439c-8e25-dc0cd67b4b4a",
"type": "DID_RETRIEVE_LIST_SUCCESS",
"timestamp": "2023-08-20T22:32:59.151Z",
"category": "did",
"requestId": "0QdK3jkDSPbOu1Sx9K2lM9",
"metadata": {
"nextCursor": "Y3JlYXRlZEF0PTIwMjMtMDctMzFUMDAlM0EyMSUzQTMwLjUyN1omaWQ9Yzk3NmQ0YmEtNjE2OC00MTkyLWE4YjAtNjE3NzNiZmNhM2M3",
"entriesCount": 8
},
"data": null
},
{
"id": "d7a38f9a-374f-4e4d-9cc0-42149d61540a",
"type": "DID_RETRIEVE_LIST_START",
"timestamp": "2023-08-20T22:32:59.148Z",
"category": "did",
"requestId": "0QdK3jkDSPbOu1Sx9K2lM9",
"metadata": {
"limit": 100
},
"data": null
}
],
"nextCursor": "dGltZXN0YW1wPTIwMjMtMDgtMjBUMjIlM0EzMiUzQTU5LjE0OFomaWQ9ZDdhMzhmOWEtMzc0Zi00ZTRkLTljYzAtNDIxNDlkNjE1NDBh"
}
  • data: This array includes all the events that matched the query parameters. The example response includes two events that were part of a DID retrieval request - one for the start of the request, and one for the successful completion. Each event includes the following parameters:

  • id: Event identifier.

  • type: Event type.

  • timestamp: Event creation date and time.

  • category: Event category.

  • requestId: Request identifier.

  • metadata: Available metadata will vary based on Event type and logging level.

  • data: Available data will vary based on Event type and logging level.

  • nextCursor: This element is used for pagination the response. Refer to our API Reference for more information.

Troubleshooting The following queries would result in a 400 - Bad Request response:

  • Invalid category.

  • Invalid type.

  • Invalid dateTo/dateFrom.

If you provide a non-existent requestId or eventId, the response will include an empty list.