This document describes how to use the CaPPr Big5 API. For general information about how to use the API, please consult the general API documentation.
Get account information.
GET
/account
curl
-H "Content-Type: multipart/form-data"
-H "Authorization: Basic ZnJlZDpmcmVk"
-X GET https://api.cappr.org/account| Value | Description |
|---|---|
| 200 | OK |
| 400 | Invalid request |
| 401 | Authentication error |
| 429 | Too many requests |
title (string)Account title.
language (string)Account language.
email (boolean)Shows if email address needs to be provided when creating a session.
password (boolean)Shows if password needs to be provided when creating a session.
subject (boolean)Shows if subject needs to be provided when creating a session.
position (boolean)Shows if position needs to be provided when creating a session.
test (boolean)Shows if a test round is presented during flow.
report (string)Account report type.
set (object)Set (flow) information.
positions (array)List of possible positions.
200{
"title": "Account",
"language": "en",
"email": true,
"password": false,
"subject": false,
"position": true,
"test": true,
"report": "score",
"set": {
"description": "Big 5",
"algorithm": "big5",
"polarity": "bipolar",
"image": true,
"caption": true
},
"positions": [
{
"id": 1,
"description": "Position 1"
},
{
"id": 2,
"description": "Position 2"
},
...
]
}Create a session.
POST
/session
email (string)User email address. Only needed when account response email value is true.
password (string)Password. Only needed when account response password value is true.
subject (string)Desciption of object. Only needed when account response subject value is true.
position (int)ID of position. Only needed when account response position value is true.
curl
-H "Content-Type: multipart/form-data"
-H "Authorization: Basic ZnJlZDpmcmVk"
-F "email=info@company.com"
-X POST https://api.cappr.org/session| Value | Description |
|---|---|
| 200 | OK |
| 400 | Invalid request |
| 401 | Authentication error |
| 406 | Invalid information provided |
| 429 | Too many requests |
uid (string)Session UID.
email (string)Stored email address.
errors (array)List of errors, can contain:
| Value | Description |
|---|---|
| ACCOUNT_EXPIRED | Account has expired |
| ACCOUNT_LIMIT | Account session limit is reached |
| EMAIL_INCORRECT | Email address is empty or format is incorrect |
| PASSWORD_EXPIRED | Provided password has expired |
| PASSWORD_INCORRECT | Provided password is incorrect |
| PASSWORD_LIMIT | Limit for provided is reached |
200{
"uid": "a99QIOYlv4pqcQwI",
"email": "info@company.com"
}406{
"errors": [
"EMAIL_INCORRECT"
]
}Get the current question or generate a new one.
GET
/session/:uid/question
uid (string, required)Session UID.
curl
-H "Content-Type: multipart/form-data"
-H "Authorization: Basic ZnJlZDpmcmVk"
-X GET https://api.cappr.org/session/a99QIOYlv4pqcQwI/question| Value | Description |
|---|---|
| 200 | OK |
| 400 | Invalid request |
| 401 | Authentication error |
| 429 | Too many requests |
id (int)Question ID.
progress (int)Contains the current test round (1 to 5, 0 for test round).
done (boolean)Indicates if flow is done.
cards (array)Collection of cards. bipolar sets contain two cards, unipolar sets only one. Questions can contain an image and/or a caption property. To determine if your current set has one or more of these fields consult the set information in the account response.
200{
"id": 1,
"progress": 0,
"done": false,
"cards": [
{
"id": 1,
"display": {
"image": "https://ftp.cappr.org/cards/1.jpg",
"caption": "Books"
}
},
{
"id": 2,
"display": {
"image": "https://ftp.cappr.org/cards/2.jpg",
"caption": "Casino"
}
}
]
}Answer a question.
POST
/session/:uid/answer
uid (string, required)Session UID.
question_id (int, required)ID of question to be answered.
answer (int, required)For sets with polariy unipolar this must be 0 (no) or 1 (yes), for bipolar sets this must be the Card ID of the chosen card.
curl
-H "Content-Type: multipart/form-data"
-H "Authorization: Basic ZnJlZDpmcmVk"
-F "question_id=1"
-F "answer=2"
-X POST https://api.cappr.org/session/a99QIOYlv4pqcQwI/answer| Value | Description |
|---|---|
| 200 | OK |
| 400 | Invalid request |
| 401 | Authentication error |
| 429 | Too many requests |
question_id (int)Given question ID.
answer (int)Given answer.
200{
"question_id": 1,
"answer": "2"
}Get the flow outcome report. To determine your report type consult the account response.
GET
/session/:uid/report
uid (string, required)Session UID.
curl
-H "Content-Type: multipart/form-data"
-H "Authorization: Basic ZnJlZDpmcmVk"
-X GET https://api.cappr.org/session/a99QIOYlv4pqcQwI/report| Value | Description |
|---|---|
| 200 | OK |
| 400 | Invalid request |
| 401 | Authentication error |
| 406 | Invalid information provided |
| 429 | Too many requests |
Report responses differ per report type and are mostly self explanatory.
200{
"o": 4.67,
"c": 2.4,
"e": 4.1,
"a": 3.75,
"n": 4.67
}Calculate the match between session and input.
GET
/session/:uid/match?o=:o&c=:c&e=:e&a=:a&n=:n
uid (string, required)Session UID.
o (float, required)Big5 OCEAN's 'O' score (min. 1, max. 5).
c (float, required)Big5 OCEAN's 'C' score (min. 1, max. 5).
e (float, required)Big5 OCEAN's 'E' score (min. 1, max. 5).
a (float, required)Big5 OCEAN's 'A' score (min. 1, max. 5).
n (float, required)Big5 OCEAN's 'N' score (min. 1, max. 5).
curl
-H "Content-Type: multipart/form-data"
-H "Authorization: Basic ZnJlZDpmcmVk"
-X GET https://api.cappr.org/session/a99QIOYlv4pqcQwI/match?o=1&c=1.2&e=4.8&a=1.1&n=1.7| Value | Description |
|---|---|
| 200 | OK |
| 400 | Invalid request |
| 401 | Authentication error |
| 406 | Invalid information provided |
| 429 | Too many requests |
session (object)Session score.
input (object)Input score.
match (int)Match percentage.
200{
"session": {
"o": 1,
"c": 1,
"e": 1,
"a": 1,
"n": 1
},
"input": {
"o": 1,
"c": 1.2,
"e": 4.8,
"a": 1.1,
"n": 1.7
},
"match": 81
}