Sommaire

1. INTRODUCTION

This document describes Central Test API based on REST Protocol (Representational State

Transfer).

More information about REST can be found under:

http://en.wikipedia.org/wiki/Representational_State_Transfer

This document lists all the available REST services and their suitable parameters. Each service comes with an example of the output on success.

In the following :

● company states the entity that invites people to take a test

● candidate or participant states the person that will take the test

● assessment states the fact of taking an assessment

1.1. Format

1.1.1. Request format

The output format can be switched between XML and JSON for each method. However, JSON is recommended as the output size would be lower. Therefore, JSON is used as the default format if none is given.

To choose XML output format, use « xml » in service call.

To choose the JSON output format, use « json » in the service call.

1.1.2 Data format definition

Integer : numeric value. Ex : « 153 »

String : string value. Ex « some string »

Boolean : 0 or 1

Integer collection : collection of integers, comma separated. Ex : « 1,2,3 » or « 1 »

1.2 Token

The first step to use the Central Test API is the authentication method. This authentication method returns a private token. Each further call of any method has to rely on this token. Therefore, the token has to be put in the http header attribute WWW-Authenticate of each method. The toke nhas an unlimited lifespan. You can keep using it and renew it if you have a leak or whenever you see fit

1.2.1 JSON

{

"error": {

"code":401,

"messages":[

"invalid token"

]

}

}

Errors can be specific to a field.

{

"error":{

"code":500,

"messages":{

"password":"\"12\" is too short (3 characters min).",

"email":"An object with the same \"email\" already exist."

}

}

}

1.2.2 XML

<?xml version="1.0" encoding="utf-8"?>

<error code="401">

<messages>

<message><![CDATA[invalid token]]></message>

</messages>

</error>

Errors can be specific to a field.

<?xml version="1.0" encoding="utf-8"?>

<error code="500">

<messages>

<message field="password"><![CDATA["12" is too short (3 characters min).]]></message>

<message field="email"><![CDATA[An object with the same "email" already exist.]]></message>

</messages>

</error>

1.2.3 JSON

{

}

"token":"{SSHA}MzxfRjbQGXXP+DbDZ5F6YxkG03Cd67h3" , "expiration_date":"2025-07-04 10:44:15" , 1.2.4 XML

<?xml version="1.0" encoding="utf-8"?>

<success>

<token><![CDATA[{SSHA}7fX0eIcAN6F4PW2pgLofoDSOGJDCUwO/]]></token>

<expiration_date><![CDATA[2025-07-04 10:44:15]]></expiration_date>

</success>

2. RETURN

All services return a 200 HTTP code on success, and a 500 HTTP code on error

2.1 Success

The relevant information (recorded data) is returned. Find in each service description the specific

output it returns.

In the examples below, the JSON output is formatted with an indentation for readability convenience.

2.2 Error

If any error occurs, the error details (error code and error message) are given within the output.

3 AUTHENTICATION

3.1 Call

Url: https://app.centraltest.com/customer/REST/connect/[FORMAT]

Method: GET or POST

HTTP Headers : none

Parameters :

● login (string)

● password (string) PLEASE NOTE THAT YOU CAN ENCRYPT THE PASSWORD IN THE REQUEST BY USING THE SALT

3.2 Password encryption

When you add a salt to your account configuration, we will try to decode the password we received in the API calls using that salt and the ‘aes-256-cbc’ method. If there’s no salt, we directly check the raw password. Example of encrypting with PHP:

3.3 Output

The method returns the token to use for any further call.

For all other services, the token is mandatory and has to be used in the WWW-Authenticate http

header attribute.

4. REFERENCE DATA

These methods allow you to retrieve the reference data from Central Test's database. Those data may be required during the call of some methods.

4.1 Get the list of titles (civility): list/title

This list is used during the candidate management process.

4.1.1 Call

Url: https://app.centraltest.com/customer/REST/list/title/[FORMAT]

Method: GET or POST

HTTP Headers : WWW-Authenticate => [TOKEN]

Parameters : none

Optional parameters :

● locale_id (integer) : Default display language. (See list/locale service to get ids).

4.1.2 Success output

The method returns the list of the available titles with their id and their label.

JSON

[

{

"id":"1",

"label":"Mr"

},

...

]

XML