The Assessment API enables external providers to integrate directly with the Page Up recruitment process.
The Assessment API provides methods to register assessment providers and packages, creating assessments, updating the status of assessment and posting assessment results.
A mock API which returns the examples defined in this spec (with the exception of access token endpoints) is available at: https://assessment-mock-api.dc0.pageuppeople.com/.
NOTE |
---|
Directly accessing the above mock root URI, or any other endpoint or URI not part of the documentation below, will typically have a response other than HTTP 200 OK ; it would usually return HTTP 403 Forbidden instead. |
Although there is no endpoint to retrieve an access token for the mock API, you will be expected to provide Authorization headers in the correct format, without requiring a valid access token. For example, providing an Authorization
header with the value Bearer <any-string-value>
will work.
PageUp account managers are responsible for managing the integrations with assessment providers. This includes registering assessment providers into the PageUp system and configuring them in case there are changes. Once an assessment provider has been created, Super Users may add assessment packages via the PageUp Admin system. Candidates can then be invited to take assessments using the assessment packages.
GET /assessmentorders/{assessmentOrderId}
endpoint and process the order. Once processed, the POST /assessmentorders/{assessmentOrderId}/acknowledge
endpoint is used to project the newly created assessment back into the PageUp system.POST /assessments/notifyassessmentreport?assessmentOrderId={assessmentOrderId}
endpoint.To secure communications between PageUp and its partners, the Assessment API require that API calls into it as well as webhook calls into partner systems should be encrypted using HTTPS over TLS version 1.2 or higher. The API will no longer call or receive requests to and from servers that either do not have HTTPS enabled, or those that still use obsolete versions of TLS (e.g., 1.1 and below) or any version of SSL.
This is the webhook notification which contains metadata and hyperlinks processing the assessment order and assessment.
{
"event": "assessmentorder_requested",
"instanceId": "218",
"assessmentOrder": {
"id": "6b806b55-e2da-42e8-91cf-51d48f448050"
},
"_links": {
"auth": {
"href": "https://login.dc2.pageuppeople.com/"
},
"host": {
"href": "https://api.dc2.pageuppeople.com/v3/218/recruitment/"
}
}
}
Where
event - the descriptive name of the event
instanceId - a reference to the InstanceId used for requesting an access token
assessmentOrder id - an identifier for acknowledging, scoring and resetting the assessment
auth link - the endpoint on which an access token is requested. Example usage is appending this value with `/connect/token` to retrieve a token
host link - the endpoint on which assessment related operations are performed. Example usage is appending this value with `/assessments/assessmentorders/{guid}` to retrieve an assessment order
PageUp expects an HTTP status code 200 response from the webhook request to continue the begin assessment flow. If the provider responds with a non-200 status code, the begin assessment flow is stopped and the candidate is redirected to an error page.
To invoke any of the endpoints, an access token must be acquired through the PageUp Auth service using credentials provided by the PageUp team. Results from the Acecss token request will include an expires_in
field which indicates the number of seconds before the token expires (as of time of writing, 600 seconds). It is recommended that the token be reused until it expires (or nears expiry).
To retrieve an access token, the assessment provider must use the clientId and clientSecret the matches the tenant from which the assessment order originated from. The section below describes the concepts around multi-tenancy and access tokens.
Language | Definition |
---|---|
Client | An organisation using the PageUp product. |
Data Centre | A client's data is only located in the region closest to them, we call these Data Centres. |
Instance | We refer to the client as an instance, and each instance is identified by an integer instance id. |
Tenant | A provisioned client environment of the PageUp Product. |
A client usually has a Live and UAT (User Acceptance Testing) environment available to them. UAT is used for ongoing integrations, improvements and validations while Live has the actual production versions and values. Live and UAT may run different versions of the code base and have separate data stores. These two environments are the clients' two tenants. Access tokens are unique per tenant. For example, if an assessment provider is deployed for Client_A and Client_B, both of which have a Live and UAT environment then said assessment provider will have 4 sets of credentials:
The following is an example hashmap of tenants and credentials
Client | InstanceId | AuthUrl | ClientId | ClientSecret | Tenant |
---|---|---|---|---|---|
Client_A | 218 | https://login.dc2.pageuppeople.com | Client_A Live Id | Client_A Live Secret | 218_LIVE |
Client_A | 218 | https://loginuat.dc2.pageuppeople.com | Client_A UAT Id | Client_A UAT Secret | 218_UAT |
Client_B | 543 | https://login.dc3.pageuppeople.com | Client_B Live Id | Client_B Live Secret | 543_LIVE |
Client_B | 543 | https://loginuat.dc3.pageuppeople.com | Client_B UAT Id | Client_B UAT Secret | 543_UAT |
Using the webhook instanceId
and _links.auth.href
properties, assessment providers should map the corresponding credentials to use in retrieving the access token. Using an incorrect credential will cause security or access errors.
When first testing your integration, you will be given credentials for a single tenant matching one of PageUp's Demo UAT (User Acceptance Testing) environments. During this time, there is only one access token generation endpoint and one set of credentials. The format for requesting a token is as follows:
Url: <authLink>connect/token
Method: POST
Header:
Content-Type:application/x-www-form-urlencoded
Body:
client_id:<clientId>
client_secret:<clientSecret>
grant_type:client_credentials
scope:Public.Assessment.Read Public.Assessment.Write
Where
<authLink> - the authentication endpoint supplied in the assessment order event (e.g. https://loginuat.dc2.pageuppeople.com)
<clientId> - the partner id supplied by PageUp
<clientSecret> - the partner secret supplied by PageUp
Once the initial integration is successful, you will be provided Live/UAT credentials for the client's tenants. Please use the webhook properties to correctly map the credentials and endpoints to use.
When making a request to the API, the Access Token must be included as an Authorization
header value matching the format Bearer <your-token-here>
.
Url: <hostLink>v3/<instanceId>/recruitment/assessment
Where
<hostLink> - the host endpoint supplied in the assessment order event
<instanceId> = the instance id supplied in the assessment order event
Example - connect to the 218 production environment on dc2
https://api.dc2.pageuppeople.com/v3/218/recruitment/assessment
Using the webhook payload, the assessment order aggregate ID is assembled to retrieve the assessment order.
After creating the assessment, use this endpoint to project the assessment onto the PageUp system.
After a candidate completes the assessment, the assessment provider should redirect the candidate to the onCompletionURL
. If there was a failure in the operation, redirect the candidate to the onFailedURL
.
This is an optional step. If a manual review of an assessment is required after a candidate completes the assessment, the assessment provider should notify PageUp and supply a URL where reviewers can perform this action.
Providers can send a Report on the Results or any other updates for the Assessment. This includes an optional field showing the state of the Assessment /Report/AssessmentResults/AssessmentStatus
which can have either of two values:
Reset Assessment is an action that allows an candidate to restart taking a test due to errors encountered (i.e. power/connection outage while taking a test, the candidate encountered an emergency in the middle of taking an exam, or similar non-technical reasons where a test has to be restarted.) The state of the assessment would be anywhere between ordered and completed, and once a reset is done, the state of the assessment should return the candidate back to the invited state to allow the candidate to re-take the test. Assessment resets are usually performed upon the request or confirmation of the client and usage is as-needed.
This endpoint allows Providers to create and update Assessment Packages in the PageUp system.
This endpoint allows Providers to archive Assessment Packages in the PageUp system.
The JSON responses are subject to a fuzzy serializer to loosen coupling (https://www.abhayachauhan.com/2017/10/fuzzy-serializer/) and as part of this operation, two things happen: a random property is added and the response is shuffled.
Only the first received POST /assessmentorders/{assessmentOrderId}/acknowledge
call for each assessment is successful. Subsequent calls will return 409 Conflict
unless the assessment is reset.
PageUp waits for ~10secs after a successful webhook response for the assessment to be created (via the POST /assessmentorders/{assessmentOrderId}/acknowledge
endpoint). If the operation times out and no assessment was created, the candidate is redirected to an error page with advise to retry.
Note that if the POST /assessmentorders/{assessmentOrderId}/acknowledge
call comes after the timeout, this can still succeed but will not result in the redirect unless the candidate re-attempts to begin the assessment.
This timeout may be revisited/negotiated depending on the assessment providers workflows.
Although it is not part of the normal workflow, there are usage or error scenarios which may result in the webhook getting invoked two or more times for the same assessment order. It is expected that in this scenario that the assessment provider invokes the POST /assessmentorders/{assessmentOrderId}/acknowledge
endpoint with the same metadata as the already acknowledged order. Note that there is no need to invoke GET /assessmentorders/{assessmentOrderId}
if the assessment provider already has the metadata they need to invoke POST /assessmentorders/{assessmentOrderId}/acknowledge
.
This is usually accompanied by the following HTTP response message:
The id (aaaaaaaa-1111-2222-3333-bbbbbbbbbbbbb) provided does not exist or is not accessible. Please check the API documentation in https://developers.pageuppeople.com/Api/Recruitment/Assessment or verify your credentials with PageUp Support.
This error can occur when an incorrect access token is used.
An assessment provider is integrated with client A and client B. When an assessment order webhook from client B is received, the access token is generated using client A's credentials.
An assessment provider is integrated with client A who has a Live and UAT environment. When an assessment order webhook from the Live environment is received, the access token is generated using the UAT credentials.
Please make sure to use an access token generated from the matching client and environment credentials as highlighted in the Retrieving Access Tokens
section.