Skip to main content
Version: 26.01

Performance Monitoring - Read User Samples

Endpoint​

/o/apm/user-samples

Overview​

Returns a page of the network or device trace samples recorded for one app user.

Authentication​

Pass api_key or auth_token as a query parameter, or send countly-token as a header. See Authentication.

Permissions​

Requires performance_monitoring Read permission.

Request Parameters​

ParameterTypeRequiredDescription
app_idStringYesApplication ID.
uidStringYesCountly internal user ID.
typeStringYesTrace type: network or device.
sSearchStringNoOnly samples whose trace name matches this text (case-insensitive) are returned.
iSortCol_0NumberNoColumn to sort by: 1 trace name, 2 start time, 3 end time. Defaults to 2.
sSortDir_0StringNoasc for ascending order; any other value sorts descending.
iDisplayStartNumberNoNumber of samples to skip. Defaults to 0.
iDisplayLengthNumberNoNumber of samples to return. Defaults to 5.
sEchoStringNoValue returned unchanged in the response.
api_keyStringConditionalRequired if auth_token is not provided.
auth_tokenStringConditionalRequired if api_key is not provided.

Examples​

Read the latest network samples of a user​

/o/apm/user-samples?
app_id=6991c75b024cb89cdc04efd2&
api_key=YOUR_API_KEY&
uid=1&
type=network

Response​

Success Response​

{
"sEcho": "1",
"iTotalRecords": 1,
"iTotalDisplayRecords": 1,
"aaData": [
{
"_id": "SAMPLE_ID",
"uid": "1",
"did": "device_123",
"ts": 1682328445330,
"sg": {
"name": "example.com/demo/",
"apm_metrics": "{}",
"stz": 1682328445000,
"etz": 1682328446000
}
}
]
}

Response Fields​

FieldTypeDescription
sEchoStringValue of the sEcho request parameter.
iTotalRecordsNumberTotal number of samples of the user.
iTotalDisplayRecordsNumberTotal number of samples of the user.
aaDataArraySamples of the requested page, with _id, did, uid, ts, and the segments name, apm_metrics, stz and etz.

Error Responses​

  • 400
{
"result": "Please provide user uid."
}
  • 400
{
"result": "Please provide APM type."
}
  • 400
{
"result": "Something went wrong."
}