Skip to main content

Statistics Interface

Provides information on sessions and recordings. In order to access the statistics interface an authentication token with proper permissions is required.

Pagination Support​

All models can be queried with the following pagination pattern:

  1. Add a limit parameter with the number of elements.
  2. Retrieve the result which contains a next_token parameter.
  3. If next_token is present, query again, using both limit and next_token.
  4. If `next_token is not present (null), stop cause all data was retrieved.

See the next section for an example querying the sessions endpoint with pagination.

Session​

GET /api/v2/stats/:api_id/sessions

Query example:

Get a proper auth token first:

token=$(curl -X POST https://streamrec.eyeson.com/auth_v2/stats \
-d '{"master_key":"<api-key>"}' -s | jq -r .auth_token)

This token then can be used to query the stats endpoint:

curl -H "Authorization: Bearer $token" \
'https://streamrec.eyeson.com/api/v2/stats/eyeson/sessions?year=2021&month=9&limit=2'

An example output:

{
"api_id": "eyeson",
"next_token": "2",
"sessions": [
{
"api_id": "eyeson",
"session_id": "c7df807b-ddcd-4456-b5ec-908be933416d",
"client_id": "client-blablabla",
"state": "TERMINATED",
"created_at": "2021-09-13T14:36:29.538Z",
"stopped_at": "2021-09-13T14:53:26.719Z"
},
{
"api_id": "eyeson",
"session_id": "4eb41edc-5591-4cee-9883-800873220073",
"client_id": "client-blablabla",
"state": "TERMINATED",
"created_at": "2021-09-13T14:34:14.352Z",
"stopped_at": "2021-09-13T14:36:19.813Z"
}
]
}

To query the next elements, use the next_token from the result as additional query parameter:

curl -H "Authorization: Bearer $token" \
'https://streamrec.eyeson.com/api/v2/stats/eyeson/sessions?year=2021&month=9&limit=2&next_token=2'

Recordings​

GET /api/v2/stats/:api_id/recordings

An example output:

{
"api_id": "eyeson",
"recordings": [
{
"api_id": "eyeson",
"recording_id": "cdf24e22-4d2e-44ce-b775-3b1ddcb04ca0",
"client_id": "streamrec-demo-client",
"session_id": "5437506f-87dc-43d1-a2f3-cd2fccbb221f",
"created_at": "2023-08-17T08:41:47.384Z",
"stopped_at": "2023-08-17T08:41:50.747Z",
"uploaded_at": "2023-08-17T08:41:52.185Z",
"webhook_success_at": "2023-08-17T08:41:52.674Z"
}
]
}

Supervisor Sessions​

/api/v2/stats/:api_id/supervisor-sessions

An example output:

{
"api_id": "eyeson",
"sessions": [
{
"api_id": "eyeson",
"session_id": "7d8dc76d-f3e4-44a2-bbce-d2ecfa9de3a5",
"client_id": "supervisor-8899629",
"agent_session_id": "4da0807c-858f-444c-a4d4-f6d5ab9c66c3",
"agent_client_id": "client-1839465",
"state": "TERMINATED",
"created_at": "2023-11-09T09:58:02.298Z",
"stopped_at": "2023-11-09T09:58:06.904Z"
}
]
}