This document describes how to use the CaPPr Drives 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)false for Drives accounts.
test (boolean)false for Drives accounts.
report (string)Account report type.
set (object)Set (flow) information.
positions (array)null for Drives accounts.
200{
"title": "Account",
"language": "en",
"email": true,
"password": false,
"subject": false,
"position": false,
"test": true,
"report": "score",
"set": {
"description": "Drives",
"algorithm": "drives",
"polarity": "unipolar",
"image": true,
"caption": true
},
"positions": null
}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.
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 completion percentage.
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": "Lorem ipsum"
}
}
]
}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)Answer for the current question. Must be 0 (no) or 1 (yes).
curl
-H "Content-Type: multipart/form-data"
-H "Authorization: Basic ZnJlZDpmcmVk"
-F "question_id=1"
-F "answer=1"
-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": "1"
}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[
"green",
"red",
"purple",
"yellow",
"orange",
"blue"
]Calculate the match between session and input.
GET
`/session/:uid/match?1=:color&2=:color&3=:color
color (string, required)The request needs the three strongest Drives colors.
curl
-H "Content-Type: multipart/form-data"
-H "Authorization: Basic ZnJlZDpmcmVk"
-X GET https://api.cappr.org/session/a99QIOYlv4pqcQwI/match?1=green&2=red&3=purple| 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": [
"green",
"red",
"purple",
"yellow",
"orange",
"blue"
],
"input": [
"purple",
"red",
"purple"
],
"match": 50
}