Client tests
Use these methods to manage the tests used for client accreditation.
GET[host]/api/v2/my/quizzes |
|
GET[host]/api/v2/my/quizzes/{quizId} |
|
GET[host]/api/v2/my/quizzes/results |
|
POST[host]/api/v2/my/quizzes/{quizId}/answers |
Get a list of client tests
Use this method to get a list of configured tests used for client accreditation.
Request
Header parameters:
Authorization: Bearer <access_token>
Query parameters:
The following sorting parameters are available for this method:
- priority (default)
The priority index assigned to a test.
- createTime
The date and time when a test was created.
Refer to the Query parameters section in the API Overview for details on applying filter and sorting parameters.
GET[host]/api/v2/my/quizzes
curl --location --request GET 'https://host.name/api/v2/my/quizzes?limit=10&offset=0&sort_order=desc&sort_by=createTime' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja'
Response
A response contains the following data about each test matching the request parameters:
- id integer
The identifier of a test.
- caption string
The test’s title displayed to clients in the B2Core UI.
- details string
The test’s description or any other helpful information that clients should know before they start passing the test.
- completed boolean
If
true
, a test is completed by a client; otherwise,false
.- approvalStatus string
The status assigned to a completed test by the admin user.
- requiredForLevelsId array
An array of integer values identifying the verification levels that can be granted to clients only after passing a test.
{
"id": 1,
"caption": "Discover Your Trading Style",
"details": "Takes just a couple of minutes",
"completed": true,
"approvalStatus": "approved",
"requiredForLevelsId": [
1,
2
]
}
Get client test details
Use this method to get detailed information about a specific client test.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- quizId required
The identifier of a test.
GET[host]/api/v2/my/quizzes/{quizId}
curl --location --request GET 'https://host.name/api/v2/my/quizzes/1' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja'
Response
A response contains the following data about the specified test:
- id integer
The identifier of a test.
- caption string
The test’s title displayed to clients in the B2Core UI.
- details string
The test’s description or any other helpful information that clients should know before they start passing the test.
- completed boolean
If
true
, a test is completed by a client; otherwise,false
.- approvalStatus string
The status assigned to a completed test by the admin user.
- requiredForLevelsId array
An array of integer values identifying the verification levels that can be granted to clients only after passing a test.
- questions object
An array of objects providing the data about questions and answer options included in a test.
Show object fields- id integer
The question identifier.
- question string
The text of a question.
- answers object
An array of objects providing the data about answer options added for a question.
Show object fields- id integer
The identifier of an answer option.
- text string
The text of an answer option.
- priority integer
The priority index assigned to an answer option.
- type
The question type. Possible values:
open
— an open-ended question that can be answered in a free form.close
— a close-ended question that can be answered by choosing a single or multiple correct answers from a given list of options.questionnaire
— a multiple-choice question that can be answered by choosing one or more answers from a given list of options.poll
— a multiple-choice question that can be answered by choosing a single answer from a given list of options.
- category string
The category in which a question is included.
- priority integer
The priority index assigned to a question.
{
"id": 1,
"caption": "Discover Your Trading Style",
"completed": true,
"details": "Takes just a couple of minutes",
"requiredForLevelsId": [
1,
2
],
"approvalStatus": "approved",
"questions": [
{
"id": 1,
"question": "The text of the 1st question",
"answers": [
{
"id": 1,
"text": "The text of the 1st answer option",
"priority": 1
},
{
"id": 2,
"text": "The text of the 2nd answer option",
"priority": 2
}
],
"type": "closed",
"category": "General questions",
"priority": 1
}
]
}
Get completed client tests
Use this method to get the total number of tests completed by a client as well as the number of tests that were successfully passed.
Request
Header parameters:
Authorization: Bearer <access_token>
GET[host]/api/v2/my/quizzes/results
curl --location --request GET 'https://host.name/api/v2/my/quizzes/results' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja'
Response
A response contains the following data:
- total integer
The number of tests completed by a client.
- completed string
The number of tests that were successfully passed by a client.
{
"total": 7,
"completed": 2
}
Submit answers to test’s questions
Use this method to submit answers to the questions included in a specific client test.
Request
Header parameters:
Authorization: Bearer <token>
- quizId required
The identifier of a test.
Body:
Specify the following parameters:
- answers object required
An array of string values identifying the questions included in a test, accompanied by string values specifying the answers to these questions.
POST[host]/api/v2/my/quizzes/{quizId}/answers
curl --location --request POST 'https://host.name/api/v2/my/quizzes/1/answers' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"answers": {
"1": "The text of an answer to a close-ended question",
"2": "4",
"3": "1",
}
}'
Response
A response contains the following data:
- id integer
The identifier of an attempt made by a client to pass a test.
- quizId integer
The identifier of a test.
- status
The test status. Possible values:
COMPLETED
— a test was successfully passed by a clientFAILED
— a test was failedWAITING_CONFIRMATION
— a test has been completed by a client and its results await approval by the admin user
{
"id": 3,
"quizId": 1,
"status": "COMPLETED"
}