Endpoint: Listing Test Instances & Results

Endpoint: Listing Test Instances & Results
February, 2025
GET /api/integration/rest/v1/tasks/:taskId/test-instances

This endpoint lets you fetch multiple test instances. You apply filters and pagination using query parameters.

Query ParametersExpected TypesDefault
mode"basic" | "detailed""basic"
limitnumber10
pagenumber1
ticketIdstring
externalIdstring
  • 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 with this external id will be returned.
        Either candidateId or externalId can be used as a parameter in one request. Using both will cause an invalid error.

        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" 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