GET /v1/tests/{testId} returns detailed test information if the test is available to the current company and is not an integrated synthetic SCORM/CMI5/xAPI test.
Endpoint
| Method | URL |
|---|---|
| GET | https://smartway.pro/api/v1/tests/{testId} |
Purpose
Retrieve settings for a specific test: activity status, question count, timer, uniqueness, validation and passing score.
Prerequisites
| Requirement | Value |
|---|---|
| Authorisation | Authorization: Bearer <access_token> |
| Scope | tests.read |
| Tenant context | Search is performed within the tenant context from the Bearer token |
Request
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
testId |
int64 | yes | Test ID |
curl example
curl -X GET 'https://smartway.pro/api/v1/tests/200001' \
-H 'Authorization: Bearer <access_token>' \
-H 'Accept: application/json'
Response
Successful response: 200 OK.
{
"testId": 200001,
"name": "Adaptive Sales",
"active": true,
"companyOwned": true,
"questionCount": 12,
"timerEnabled": true,
"timerMinutes": 10,
"uniquenessEnabled": true,
"uniquenessQuestionCount": 25,
"validationEnabled": true,
"passingScore": 75
}
Response fields
| Field | Type | Description |
|---|---|---|
testId |
int64 | Test ID |
name |
string | Test name |
active |
boolean | Test activity flag |
companyOwned |
boolean | true if the test belongs to the current company |
questionCount |
int32 | Number of questions in the test |
timerEnabled |
boolean | Whether the timer is enabled |
timerMinutes |
int32 | Timer duration in minutes |
uniquenessEnabled |
boolean | Whether question uniqueness is enabled |
uniquenessQuestionCount |
int32 | Number of unique questions |
validationEnabled |
boolean | Whether result validation is enabled |
passingScore |
int32 | Passing score |
Business logic
-
The API searches for the test within the tenant context from the Bearer token.
-
If the test is not available to the current company, the API returns
404 Not Found. -
Integrated synthetic SCORM/CMI5/xAPI tests are not returned by this endpoint.
Edge cases
| Scenario | API behaviour |
|---|---|
| The test is not available to the current company | 404 Not Found |
testId belongs to an integrated synthetic SCORM/CMI5/xAPI test |
404 Not Found |
| Timer, uniqueness, validation or passing score settings do not apply | The related fields can be null |
Errors
| HTTP status | Reason |
|---|---|
| 401 Unauthorized | Bearer token is missing or invalid |
| 403 Forbidden | Insufficient permissions |
| 404 Not Found | Test not found, unavailable to the current tenant or is an integrated synthetic test |
| 500 Internal Server Error | Unexpected LMS Smart Way error |
| 503 Service Unavailable | LMS Smart Way internal integration failure |
Usage
Use this endpoint after GET /v1/tests to retrieve details for a specific test before creating an invitation or analysing settings.
Common mistakes
| Mistake | How to avoid it |
|---|---|
Using a testId unavailable to the current company |
Retrieve testId values through GET /v1/tests |
| Treating nullable fields as required | Check for null in test settings |
FAQ
Why does the API return 404 Not Found for an existing testId?
The test may be unavailable to the current company or may be an integrated synthetic SCORM/CMI5/xAPI test.
Are all test settings always populated?
No. Some settings can be null.