This endpoint lets you fetch multiple test instances. You apply filters and pagination using query parameters.
| Query Parameters | Expected Types | Default |
| mode | "basic" | "detailed" | "basic" |
| limit | number | 10 |
| page | number | 1 |
| candidateId | string | |
| externalId | string |
- mode: The mode of the return value. "detailed" mode will provide more information.
- candidateId: If provided, only the test instances belonging to the candidate will be returned.
- externalId: If provided, only the test instances assigned with this external id will be returned.
Response
{
testInstances: (Basic | Detailed)[];
pagination: {
totalItems: number;
totalPages: number;
currentPage: number;
limit: number;
next: string | null;
previous: string | null;
}
}- limit: The maximum number of test instances this query was meant to return.
- pagination.next: The query to fetch the next set of test instances (i.e. "?limit=5&page=3&mode=basic"). If null, it means there are no more test instances to fetch.
- pagination.previous: The query to fetch the previous set of test instances (i.e. "?limit=5&page=1&mode=basic"). If null, it means there are no more test instances to fetch.
The type of the test instances depends on the value of mode provided in the query parameters. If the value of mode is "basic", the test object in the response will be in this type:
"basic" test instance object
{
testInstanceId: string;
taskId: string;
stepId: string;
ticketId: string;
status: "STARTED" | "COMPLETE" | "RESETUP";
ignored: boolean;
result: false | {
completedAt: number;//seconds
scoreboard: {
pointsAchieved: number;
maxAchievablePoints: number;
achievementRatio: number;
};
};
}If the value of mode is "detailed", you will receive all of the properties from "basic" and also these properties:
// "detailed" test instance object:
Basic & {
organizationId: string;
candidate: {
id: string;
kind: "user" | "temp";
};
folder: string;
group: string;
labels: string[];
tags: Record<
string,
string
>;
result: false | {
completedAt: number; // seconds
scoreboard: {
pointsAchieved: number;
maxAchievablePoints: number;
achievementRatio: number;
noOfQuestions: number;
};
sections: {
uuid: string;
scoreboard: {
pointsAchieved: number;
maxAchievablePoints: number;
achievementRatio: number;
noOfQuestions: number;
}
}[];
dimensions: {
name: string;
scoreboard: {
pointsAchieved: number;
maxAchievablePoints: number;
achievementRatio: number;
noOfQuestions: number;
}
subDimensions: {
name: string;
scoreboard: {
pointsAchieved: number;
maxAchievablePoints: number;
achievementRatio: number;
noOfQuestions: number;
}
}[]
}[];
effects: {
name: string;
score: number;
subEffects: {
name: string;
score: number;
}[]
}[]
}
}