Returns a paginated list of completed and in progress sessions
This endpoint should be used if there are more than 30 values for any given filter.
Body
Required
-
The maximum number of results to return per page.
Minimum value is
1, maximum value is100. Default value is100. -
Indicates the starting position or index (offset)
Default value is
0. -
The cursor for pagination. Encoded byte string used to navigate between pages.
-
Specify the sort order of the results.
The default sort order is
{"field": "startDate", "direction": "asc"}
POST
/smart-ia/sessions/search
curl \
--request POST 'https://connect.century.tech/api/v1/smart-ia/sessions/search' \
--header "x-api-key: $API_KEY" \
--header "Content-Type: application/json" \
--data '{"limit":100,"offset":0,"search":{"endDate":{"gt":"2023-01-01T12:00:00.000Z","lt":"2023-06-01T12:00:00.000Z"},"status":"COMPLETED"},"sort":{"field":"endDate","direction":"desc"}}'
Request examples
Search completed sessions within a date range
{
"limit": 100,
"offset": 0,
"search": {
"endDate": {
"gt": "2023-01-01T12:00:00.000Z",
"lt": "2023-06-01T12:00:00.000Z"
},
"status": "COMPLETED"
},
"sort": {
"field": "endDate",
"direction": "desc"
}
}
{
"limit": 100,
"offset": 0,
"search": {
"endDate": {
"gt": "2023-01-01T12:00:00.000Z"
},
"status": "COMPLETED"
},
"sort": {
"field": "endDate",
"direction": "desc"
}
}
{
"limit": 100,
"offset": 0,
"search": {
"testIds": [
"c5a77fda-7174-446f-a4f5-0f47ccbf15ce"
],
"status": "COMPLETED"
},
"sort": {
"field": "endDate",
"direction": "desc"
}
}
{
"limit": 100,
"offset": 0,
"search": {
"userIds": [
"2716be03-cec0-4027-a373-46b53fb6a08d"
]
},
"sort": {
"field": "startDate",
"direction": "desc"
}
}
Response examples (200)
{
"data": [
[
{
"sessionId": "d93ba3c3-2482-4b0d-8b99-42a20e68e11e",
"startDate": "2023-07-10T14:00:00.000Z",
"endDate": "2023-07-10T15:30:00.000Z",
"status": "COMPLETED",
"user": {
"userId": "2716be03-cec0-4027-a373-46b53fb6a08d",
"username": "john_doe",
"externalId": "External_ID_123",
"fullName": "John Doe",
"firstName": "John",
"lastName": "Doe",
"emails": [
"john.doe@email.com"
],
"gender": "male"
},
"test": {
"testId": "c5a77fda-7174-446f-a4f5-0f47ccbf15ce",
"testVersionId": "38444333-7450-49d5-922d-eb16a8f30589",
"name": "English Smart Initial Assessment",
"subject": "English"
},
"result": {
"createdDate": "2023-07-10T15:30:00.000Z",
"level": "L1 - Lower",
"duration": "PT1H30M"
}
},
{
"sessionId": "9f8a38c6-9194-480e-bb5f-9155b7636580",
"startDate": "2023-07-10T14:00:00.000Z",
"status": "IN_PROGRESS",
"user": {
"userId": "b4334e39-0fa9-4278-8b61-c7aa7e6c8d5e",
"username": "jane_doe",
"fullName": "Jane Doe",
"firstName": "Jane",
"lastName": "Doe",
"gender": "female"
},
"test": {
"testId": "c5a77fda-7174-446f-a4f5-0f47ccbf15ce",
"testVersionId": "38444333-7450-49d5-922d-eb16a8f30589",
"name": "English Smart Initial Assessment",
"subject": "English"
}
}
]
],
"pagination": {
"total": 300,
"limit": 30,
"offset": 100,
"previousCursor": "eyJsaW1pdCI6MSxiZWZvcmU6IiIsc29ydDpbWyJlbmREYXRlIiwiZGVzYyJdXX0=",
"nextCursor": "eyJsaW1pdCI6MSxiZWZvcmU6IiIsc29ydDpbWyJlbmREYXRlIiwiZGVzYyJdXX0="
}
}