Sample API Integration Flow Diagram
The following article details a sample integration flow to help you get started. To read more about each of the APIs mentioned below, request you to refer to our
API Documentation.
Admin Side Flow
Assessment Creation
You can add/create assessments by:
- Logging in to mettl.com i.e, through your dashboard - You can add prebuilt tests (PBTs) to your account from our Test Library or create a custom assessment.
- Using POST API Add PBTs.
- Using POST API Create Assessment. This option can only be used to create assessments at runtime with your questions only imported onto Mettl by you or your team. (Click here to read how to import your questions)
Mapping Jobs/Courses on your ATS/LMS to Mettl Assessments
GET API
Get All Assessments
can be used to retrieve all assessments in your Mettl account to proceed with mapping them with jobs/courses on your system. Each assessment has a unique identifier called assessment ID.
At this step, you can also define a passing criteria (if any) on your ATS/LMS for each assessment mapped to a job/course.
Candidate Experience - Redirection after Finishing Test
Using
POST
API
Edit Assessment
settings for a particular Assessment
, you can set a URL to which candidate should be redirected to, after clicking on ‘Finish Test’ on the Mettl test window. In this API, please refer to the parameter: “exitRedirectionURL”.
ATS/LMS Back-End Flow
Creation of Schedules/Test Links
At Mettl, to allow a candidate to take an assessment/test, you need to create a schedule/test link. Using
POST API Create Schedule for a particular Assessment
, you can create multiple schedules/test links for each assessment depending on:
- The number of attempts allowed for a candidate.
- If different sets of candidates need to be administered the assessment with a unique set of security settings.
As a suggestion, you can name the schedules/test links as 1st attempt, 2nd attempt and so on. Each schedule is uniquely identified by its access-key. When/If a candidate is eligible to take the 2nd attempt of the same test, the access-key of the second schedule can be sent and so on.
Live updation of scores and reports using a Webhook
You may configure Webhooks and set their callback URLs on the following JSON properties of each schedule/test link to receive live notifications and results on your application. To configure these:
- At the time of schedule/test link creation using POST API Create Schedule for a particular Assessment.
- For schedules/test links that were created earlier using POST API Edit Schedule.
These properties can be set in the sc JSON in the above APIs. Mettl will POST JSON data on these URLs for the respective candidate actions:
- testStartNotificationURL: When a candidate’s test starts
- testFinishNotificationURL: When a candidate’s test ends
- testGradedNotificationURL: When a candidate’s test result gets generated
- testResumeEnabledForExpiredTestURL: When an expired candidate’s test is allowed to resume by an Admin after logging in to their mettl account.
To secure these notifications from Mettl:
- While creating or editing a schedule/test link, supply an additional parameter testNotificationBasicAuthHeader with value as base64encoded(username:password)
- In case IP Whitelisting is required, IP addresses can be found here.
In addition to the detailed scores and the HTML report link, the JSON data POSTed on the testGradedNotificationURL also contains:
- completionMode – This will help the Admin understand if the candidate:
- Successfully completed the test – By clicking on Finish test, or because the timer counted down to zero.
- Navigated away more times than allowed and the test was stopped by Mettl
- Got disconnected due to power/internet disconnection – this indicates to the Admin that the test maybe incomplete. In such a case, you may use this input to display an appropriate message to the logged in user on your system.
For the full list of values, please refer this article.
-
candidateCredibilityIndex – Possible values are High, Medium or Low.
- Recommendation(s) and Response Style - In reports that contain these elements, the recommendation(s) and response style are also included in the webhook response.
On demand Results
For Psychometric assessment reports (
link to sample), do not consider any of the scores in the JSON response.
By including the following non-mandatory arguments, you may also fetch:
- 'Recommendation' values - "ir":'{"recommendation":true}'
- 'Response Style' value - rs = true;
Candidate Flow
At Mettl, candidates are identified uniquely using their email ID.
Please set the candidate registration fields as desired in the account level settings in your Mettl.com account in the very beginning as this is required while using
POST
API
Register Candidates in Schedule
. T
his should be in sync with the information collected at the time of candidate signup on the ATS/LMS.
Starting the Test
Using
POST
API
Register Candidates in Schedule
, you can give a single-sign-on experience to the candidate i.e. the candidate doesn't have to fill in any details, test starts directly). This
POST API
needs to be supplied with an access-key which uniquely identifies a schedule/test link. (See ATS/LMS Back-end flow)
When this API is used a candidate specific encrypted URL is generated which can be used by the candidate only once. (Hence, there is no possibility of misuse)
This candidate-specific-encrypted link can be:
- Sent to the candidate over email.
- Displayed to the candidate on the LMS/ATS. Optionally, at the candidate’s selected slot time, the ‘Take Test’ button can be enabled.
Making Report available on Candidate/Admin dashboard
The JSON data POSTed on the testGradedNotificationURL also contains the candidate's HTML report URL. As per the requirement, this can be shared with candidate on his/her profile or displayed to an Admin on the ATS/LMS.
Resuming an Expired Test
In case a candidate's test is interrupted for some reason, the candidate may refresh the test link and continue the test from the point of disruption within 30mins.
If the candidate couldn't do this for some reason, Mettl grades the candidates responses and sends results to ATS/LMS:
- In the data posted on the testGradeNotificationUrl the value of the parameter finish_mode will be TestExpired.
- In case the candidate's result is accessed on demand using API 6.2 or 6.3 or 7, the value of completionMode will be Expired.
You can use this notification to re-activate the Take test button on the candidate's profile or send an email to the candidate.
Sample Flowchart and Sequence Flow
The following documents will help you understand how to understand how to use our APIs to integrate your system with our assessment platform:
- Flowchart: To understand the flow of candidates and assessment between Mettl and your application
- Sequential Explanations: A detailed explanation of API calls and necessary parameters needed for the flow of data and how to store it.