Endpoint: Searching Test Instances & Results

Endpoint: Searching Test Instances & Results
February, 2025
POST /api/integration/rest/v1/tasks/:taskId/test-instances/filter

This endpoint lets you list multiple test instances under a task of your organization. You can apply pagination to your request using query parameters and apply filters using the request body.

Query ParametersExpected TypesDefault
mode"basic" | "detailed""basic"
limitnumber10
lastDocIdstring
  • mode: The mode of the return value. "detailed" mode will provide more information.
    • lastDocId: The id of the test instance after which the query will execute. If no provided, the first set of test instances that pass the filters will be returned.

      Request Body

      The body can be of 2 types:

      {
        kind: "meta";
        group?: string;
        label?: string;
        stepId?: string;
        status?: "STARTED" | "COMPLETE" | "RESETUP";
        from?: number; // millisecond
        to?: number; // millisecond
      } | {
        kind: "info";
        displayName?: string;
        email?: string;
        credential1?: string;
        code?: string;
        uniqId?: string;
      }

      With meta kind, more general filters can be applied, and the test instances that fit all of the filters will be returned. The info kind is used to make a pinpoint search with the candidate's information.

      Response

      {
        testInstances: (Basic | Detailed)[];
        pagination: {
          limit: number;
          lastDocId: string | null;
          next: string | null;
        }
      }
      • pagination.limit: The limit used in this query. The maximum number of objects this query is meant to return.
        • pagination.lastDocId: The id of the new last document following this query. In order to get the next set of documents, this id needs to be provided in the next request's query parameters. If null, it means there are no test instances to continue from.
          • pagination.next: The query for the next set of documents (i.e. "?mode=basic&limit=5&lastDocId=xxx"). If null, it means there isn't anymore objects 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" user object:
            Basic & {
              organizationId: string;
              candidate: {
                id: string;
                kind: "user" | "temp";
              };
            
              folder: string;
              group: string;
              labels: string[];
              tags: Record;
              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;
                  }[]
                }[]
              }
            }
            Go Back
            Talk to a representative
            Figure out if TestInvite is a good match for your organization
            Book a demo