Assist

Retrieve live sessions

Only available for Enterprise Edition (EE).

Returns the list of live sessions for a particular project.

Method

GET

URL

/api/v1/:projectKey/assist/sessions

Parameters

NameTypeDescription
projectKeystringThe ID of the project you're tracking (required)

Request Headers

Authorization: {YOUR_ORGANIZATION_API_KEY}: The key can be found in 'Preferences' > 'Account' > 'Organization API Key'.

Status Codes

200: Response sent as JSON in body

Example Request

curl -X GET \
https://openreplay.example.com/api/v1/aYYaFHiagqdXKEmVlmvJ/assist/sessions \
-H 'content-type: application/json' \
-H 'Authorization: {YOUR_ORGANIZATION_API_KEY}'

Example Response

{
"data": {
"total": 1,
"sessions": [
{
"pageTitle": "OpenReplay Blog",
"sessionID": "6975518573799938",
"metadata": {},
"userID": "",
"userUUID": "8998545b-553c-4f41-a39d-d7cba7fac2d1",
"projectKey": "aYYaFHiagqdXKEmVlmvJ",
"revID": "",
"timestamp": 1656437966459,
"trackerVersion": "3.5.11",
"isSnippet": true,
"userOs": "Mac OS",
"userBrowser": "Chrome",
"userBrowserVersion": "103.0.0.0",
"userDevice": null,
"userDeviceType": "desktop",
"userCountry": "FR",
"active": false,
"live": true,
"projectId": 3
}
]
}
}

Search live sessions

Search in the list of live sessions for a particular project.

Method

POST

URL

/api/v1/:projectKey/assist/sessions

Parameters

NameTypeDescription
projectKeystringThe ID of the project you're tracking (required)

Payload

NameTypeDescription
sortstringThe sort attribute (default:timestamp)
orderstringThe sort order, can be "DESC" or "ASC" (default:DESC)
pageintegerThe page number for pagination (default:1)
limitintegerThe number of sessions per page (default:200)
filtersarray of filterThe list of filters, check next table (default:[])

filter object:

NameTypeDescription
valuearray of case insensitive stringsThe list of values (default:[])
typecase insensitive stringThe filter attribute (required)
sourcecase insensitive stringThe metadata attribue name for type=metadata (default:"")
operatorcase sensitive stringThe operator to use for each value, can be "contains" or "is" (default:"contains")

The search will look for the live-sessions that have an attribute name that contains the given type and have a value that contains 1 of the given value.

PS: if values=[]; the search will look for the live-sessions that have a given attribute.

For example if you are looking for sessions that have a specific metadata (any value):

{"value": [], "type": "METADATA", "source": "myMeta"}

Request Headers

Authorization: {YOUR_ORGANIZATION_API_KEY}: The key can be found in 'Preferences' > 'Account' > 'Organization API Key'.

Status Codes

200: Response sent as JSON in body

Example Request

The following example will look for the first 10 live-sessions (reverse sort by timestamp) that have a userId contains 'openreplay' and metadata.plan contains 'trial' or 'free'.

curl -X POST \
https://openreplay.example.com/api/v1/aYYaFHiagqdXKEmVlmvJ/assist/sessions \
-H 'content-type: application/json' \
-H 'Authorization: {YOUR_ORGANIZATION_API_KEY}'
--data-raw '{
"filters": [
{
"value": [
"trial", "free"
],
"type": "METADATA",
"source": "plan",
"operator": "is"
},
{
"value": [
"openreplay"
],
"type": "USERID",
"operator": "contains"
}
],
"sort": "timestamp",
"order": "DESC",
"limit": 10,
"page": 1
}'

Example Response

{
"data": {
"total": 1,
"sessions": [
{
"pageTitle": "OpenReplay Blog",
"sessionID": "6975518573799185",
"metadata": {
"plan": "trial"
},
"userID": "dev@openreplay.com",
"userUUID": "8998545b-553c-4f41-a39d-d7cba7fac2d1",
"projectKey": "aYYaFHiagqdXKEmVlmvJ",
"revID": "",
"timestamp": 1656437966459,
"trackerVersion": "3.5.11",
"isSnippet": true,
"userOs": "Mac OS",
"userBrowser": "Chrome",
"userBrowserVersion": "103.0.0.0",
"userDevice": null,
"userDeviceType": "desktop",
"userCountry": "FR",
"active": false,
"live": true,
"projectId": 3
}
]
}
}