Attempt Completed Webhook

This event is triggered when a user's attempt on any test has been Completed, e.g. once it has been submitted and marked.

  • For attempts which are automatically marked (e.g. pure MCQ exams), this will be sent at the same time as the Attempt Submitted webhook.

  • For attempts which are manually marked, this will be sent after the Attempt Submitted webhook

  • This webhook will be sent for any attempt, including Collections, Spaced Learning, Assignments and Exams. We have a separate webhook just for Exam attempts which may be better depending on your use case.

To subscribe to this webhook, please set up a URL endpoint capable of receiving POST requests.

Request Details

The request will POST a JSON payload that conforms to the following Typescript interface:

export interface AttemptCompletedWebhookBody {
  user: {
    id: string;
    name: string;
    email: string;
    customAttributes: Record<string, unknown>;
  };
  portal: { id: string };
  meta: { timestamp: string };
  certificate?: {
    url: string;
    certificatePdfPath: string;
  };
  attempt: {
    score: number;
    scoreFrac: number;
    totalAnsweredCorrectly: number;
    id: string;
    isExam: false;
    state: {
      responseQuestionMap: string[][];
      isRevoked: boolean;
      isStarted: boolean;
      timeStarted: string;
      timeCompleted: string;
      timeSpentInMs: number;
      results: { status: string };
    };
    marks: Marks;
    totalQuestions: number;
    tags: {
      nonFacetTags: string[];
      skill: string[];
      difficulty: string[];
      subtopic: string[];
      topic: string[];
      subject: string[];
      module: string[];
      exam: string[];
    };
    totalAnswered: number;
    timeStarted: string;
    timeCompleted: string;
    timeSpentInMs: number;
  };
  test: { id: string; title: string };
  id: string;
  score: number;
  scoreFrac: number;
  timeStarted: string;
  timeCompleted: string;
  timeSpentInMs: number;
}

This should contain all of the information you need for most common use cases, such as emailing a confirmation to the user, or adding the attempt information to another system. You can also use this in conjunction with our APIs to fetch more data if needed.

Last updated