Test
A Test is a resource to where candidates are sent to map their strengths, weaknesses and other abilities. After the candidate is done testing, they will be redirected back to your application. The request query parameters will contain candidate-id and state. The state represent the candidates progress when doing the test. It may have the following values: "completed", "aborted" and "invalid".
Create
Create a new test. When creating a new test you must provide a redirect_uri (A), an URL to where the candidates should be redirected after the test is completed. When sending a user to perform a test you may provide a redirect-uri (B) query parameter. The redirect_uri (A) must be a subset of query parameter (B).
// Valid example
redirect_uri (A): https://my-app.com/return/123
redirect-uri (B): https://my-app.com/return/123/cadidate-session/456
// Broken example
redirect_uri (A): https://my-app.com/return/123
redirect-uri (B): https://different-app.com/123
// Broken example
redirect_uri (A): https://my-app.com/return/123
redirect-uri (B): https://my-app.com/foobar/123
Request
POST /api/tests
Host: api.happyrmatch.com
Authorization: Bearer eyJ0eXAi1QiLCJ...
Accept: application/vnd.api+json
Content-Type: application/vnd.api+json
{
"role": "[role_id]",
"types": [
"[type_id]"
],
"redirect_uri": "https:\/\/my-app.com\/return\/123"
}
Parameters
Name | Description |
---|---|
redirect_uri | The default URL the candidate should be redirected to when they are done with the test. |
role | An ID to a Role |
types | An array with IDs to a Test Type |
Response
HTTP/1.0 201 Created
Cache-Control: no-cache, private
Content-Type: application/vnd.api+json
Date: Wed, 14 Sep 2022 05:38:55 GMT
{
"data": {
"type": "test",
"id": "25ad3238-e00f-4efb-add9-8310455dc056",
"attributes": {
"url": "https:\/\/api.happyrmatch.com\/test-session\/25ad3238-e00f-4efb-add9-8310455dc056\/start"
}
}
}