Endpoint: Fetching a Test Session & Result

Endpoint: Fetching a Test Session & Result
January, 2025
GET /api/integration/rest/v1/tasks/:taskId/test-instances/:id

This endpoint lets you fetch one test session under one of your tasks. 

Query ParametersExpected ValueDefault
mode"basic" | "detailed""basic"

With the "mode" parameter, you can choose to receive a smaller or a bigger object for each task, depending on your needs.

Response

If the value of mode is "basic", you will receive: 

"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", extra properties and a more detailed result property:

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