Client tests
Use these methods to manage the tests used for client accreditation.
GET[host]/api/v2/quizzes |
|
GET[host]/api/v2/quizzes/{quizId} |
|
POST[host]/api/v2/quizzes/{quizId} |
|
PATCH[host]/api/v2/quizzes/{quizId} |
|
DELETE[host]/api/v2/quizzes/{quizId} |
Use these methods to manage the questions included in client tests.
GET[host]/api/v2/quizzes/{quizId}/questions |
|
GET[host]/api/v2/quizzes/{quizId}/questions/{questionId} |
|
POST[host]/api/v2/quizzes/{quizId}/questions |
|
PATCH[host]/api/v2/quizzes/{quizId}/questions/{questionId} |
|
DELETE[host]/api/v2/quizzes/{quizId}/questions/{questionId} |
Use these methods to manage answer options.
GET[host]/api/v2/quizzes/{quizId}/questions/{questionId}/answers |
|
GET[host]/api/v2/quizzes/{quizId}/questions/{questionId}/answers/{answerId} |
|
POST[host]/api/v2/quizzes/{quizId}/questions/{questionId}/answers |
|
PATCH[host]/api/v2/quizzes/{quizId}/questions/{questionId}/answers/{answerId} |
|
DELETE[host]/api/v2/quizzes/{quizId}/questions/{questionId}/answers/{answerId} |
Use these methods to obtain the data about the tests that have been completed by clients.
GET[host]/api/v2/clients/{clients}/quizzes |
|
GET[host]/api/v2/clients/{clientId}/quizzes/{attemptId} |
Get a list of client tests
Use this method to get a list of configured tests that are used for client accreditation.
Request
Header parameters:
Authorization: Bearer <token>
Query parameters:
The following filter parameters are available for this method:
- isVisible
If
true
, a test is displayed to clients in the B2Core UI; otherwise,false
.
The following sorting parameter is available for this method:
- 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/quizzes
curl --location -g 'https://host.name/api/v2/quizzes?limit=10&offset=0&sort_order=desc&sort_by=createTime&filter[isVisible]=true' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja'
Response
A response contains an array of Client Test objects providing information about the tests matching the request parameters.
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/quizzes/{quizId}
curl --location -g 'https://host.name/api/v2/quizzes/1' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja'
Response
A response includes a Client Test object providing information about the specified test.
Create a client test
Use this method to create a new client test.
Request
Header parameters:
Authorization: Bearer <token>
Body:
Specify the following parameters for a client test:
- caption string required
The test’s title displayed to clients in the B2Core UI.
- isVisible boolean required
If
true
, a test is displayed to clients in the B2Core UI; otherwise,false
.- details string
The test’s description or any other helpful information that clients should know before they start passing the test.
- resources object
An array of resource objects specifying the localized strings for user interface pages displayed to a client.
POST[host]/api/v2/quizzes/{quizId}
curl --location --request POST 'https://host.name/api/v2/quizzes' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja' \
--data-raw '{
"caption": "Discover Your Trading Style",
"isVisible": true,
"details": "Takes just a couple of minutes",
"resources": [
{
"key": "caption",
"locale": "ru_RU",
"value": "value"
},
{
"key": "caption",
"locale": "en_US",
"value": "value"
}
]
}'
Response
A response contains a Client Test object providing information about the client test that was created.
Update a client test
Use this method to update a specified client test.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters
- quizId required
The identifier of a test.
Body:
The following field values can be updated:
- caption string
The test’s title displayed to clients in the B2Core UI.
- isVisible boolean
If
true
, a test is displayed to clients in the B2Core UI; otherwise,false
.- details string
The test’s description or any other helpful information that clients should know before they start passing the test.
- resources object
An array of resource objects specifying the localized strings for user interface pages displayed to a client.
PATCH[host]/api/v2/quizzes/{quizId}
curl --location --request PATCH 'https://host.name/api/v2/quizzes/1' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja' \
--data-raw '{
"caption": "Discover Your Trading Style",
"isVisible": true,
"details": "Takes just a couple of minutes",
"resources": [
{
"key": "caption",
"locale": "ru_RU",
"value": "value"
},
{
"key": "caption",
"locale": "en_US",
"value": "value"
}
]
}'
Response
A response includes a Client Test object providing information about the test that was updated.
Delete a client test
Use this method to delete a specified client test.
Request
Header parameters:
Authorization: Bearer <token>
Path parameters:
- quizId required
The identifier of a test.
DELETE[host]/api/v2/quizzes/{quizId}
curl --location --request DELETE 'https://host.name/api/v2/quizzes/1' \
--header 'Authorization: Bearer <token>'
Response
In case of success, no response body is returned.
Get a list of test’s questions
Use this method to get a list of questions included in client tests.
Request
Header parameters:
Authorization: Bearer <token>
Path parameters:
- quizId required
The identifier of a test.
Query parameters:
The following filter parameters are available for this method:
- isVisible
If
true
, a question is displayed to clients when passing a test in the B2Core UI; otherwise,false
.- 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.
The following sorting parameters are available for this method:
- priority (default)
The priority index assigned to a question.
- createTime
The date and time when a question was added to a test.
Refer to the Query parameters section in the API Overview for details on applying filter and sorting parameters.
GET[host]/api/v2/quizzes/{quizId}/questions
curl --location -g 'https://host.name/api/v2/quizzes/1/questions?limit=10&offset=0&sort_order=desc&sort_by=createTime&filter[isVisible]=true&filter[type]=closed' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja'
Response
A response contains an array of Test’s Question objects providing information about the questions matching the request parameters.
Get test’s question details
Use this method to get detailed information about a specific question included in a client test.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- quizId required
The identifier of a test.
- questionId required
The question identifier.
GET[host]/api/v2/quizzes/{quizId}/questions/{questionId}
curl --location 'https://host.name/api/v2/quizzes/1/questions/1' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja'
Response
A response includes a Test’s Question object providing information about the specified question.
Add a question to a client test
Use this method to add a new question to a client test.
Request
Header parameters:
Authorization: Bearer <token>
- quizId required
The identifier of a test.
Body:
Specify the following parameters for a question:
- question string required
The text of a question.
- isVisible boolean required
If
true
, a question is displayed to clients when passing a test in the B2Core UI; otherwise,false
.- type string required
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.
- isMultipleChoices boolean
If
true
, multiple answer options are added for a question; otherwise,false
.- resources object
An array of resource objects specifying the localized strings for user interface pages displayed to a client.
POST[host]/api/v2/quizzes/{quizId}/questions
curl --location --request POST 'https://host.name/api/v2/quizzes/1/questions' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja' \
--data-raw '{
"question": "What kind of information helps you make informed decisions?",
"isVisible": true,
"type": "open",
"category": "General questions",
"isMultipleChoices": false,
"resources": [
{
"key": "caption",
"locale": "ru_RU",
"value": "value"
},
{
"key": "caption",
"locale": "en_US",
"value": "value"
}
]
}'
Response
A response contains a Test’s Question object providing information about the question that was added to a test.
Update a test’s question
Use this method to update a specified question included in a client test.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters
- quizId required
The identifier of a test.
- questionId required
The question identifier.
Body:
The following field values can be updated:
- question string
The text of a question.
- isVisible boolean
If
true
, a question is displayed to clients when passing a test in the B2Core UI; otherwise,false
.- type string
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.
- isMultipleChoices boolean
If
true
, multiple answer options are added for a question; otherwise,false
.- priority integer
The priority index assigned to a question.
- resources object
An array of resource objects specifying the localized strings for user interface pages displayed to a client.
PATCH[host]/api/v2/quizzes/{quizId}/questions/{questionId}
curl --location --request PATCH 'https://host.name/api/v2/quizzes/1/questions/1' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja' \
--data-raw '{
"question": "What kind of information helps you make informed decisions?",
"isVisible": false,
"type": "closed",
"category": "General questions",
"isMultipleChoices": true,
"priority": 1,
"resources": [
{
"key": "caption",
"locale": "ru_RU",
"value": "value"
},
{
"key": "caption",
"locale": "en_US",
"value": "value"
}
]
}'
Response
A response includes a Test’s Question object providing information about the question that was updated.
Delete a test’s question
Use this method to delete a specified question included in a client test.
Request
Header parameters:
Authorization: Bearer <token>
Path parameters:
- quizId required
The identifier of a test.
- questionId required
The question identifier.
DELETE[host]/api/v2/quizzes/{quizId}/questions/{questionId}
curl --location --request DELETE 'https://host.name/api/v2/quizzes/1/questions/1' \
--header 'Authorization: Bearer <token>'
Response
In case of success, no response body is returned.
Get a list of answer options
Use this method to get a list of answer options added for a specific question.
Request
Header parameters:
Authorization: Bearer <token>
Path parameters:
- quizId required
The identifier of a test.
- questionId required
The question identifier.
Query parameters:
The following filter parameter is available for this method:
- isVisible
If
true
, an answer option is displayed to clients when passing a test in the B2Core UI; otherwise,false
.
The following sorting parameters are available for this method:
- priority (default)
The priority index assigned to an answer option.
- createTime
The date and time when an answer option was added.
Refer to the Query parameters section in the API Overview for details on applying filter and sorting parameters.
GET[host]/api/v2/quizzes/{quizId}/questions/{questionId}/answers
curl --location -g 'https://host.name/api/v2/quizzes/1/questions/1/answers?limit=10&offset=0&sort_order=desc&sort_by=createTime&filter[isVisible]=true' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja'
Response
A response contains an array of Answer Option objects providing information about the answer options matching the request parameters.
Get answer option details
Use this method to get detailed information about a specific answer option added for a question.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- quizId required
The identifier of a test.
- questionId required
The question identifier.
- answerId required
The identifier of an answer option.
GET[host]/api/v2/quizzes/{quizId}/questions/{questionId}/answers/{answerId}
curl --location -g 'https://host.name/api/v2/quizzes/1/questions/1/answers/1' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja'
Response
A response includes an Answer Option object providing information about the specified answer option.
Add an answer option
Use this method to add a new answer option for a specified question.
Request
Header parameters:
Authorization: Bearer <token>
- quizId required
The identifier of a test.
- questionId required
The question identifier.
Body:
Specify the following parameters for an answer option:
- text string required
The text of an answer option.
- isVisible boolean required
If
true
, an answer option is displayed to clients when passing a specified test; otherwise,false
.- isCorrect boolean
If
true
, an answer option is the correct one; otherwise,false
.- resources object
An array of resource objects specifying the localized strings for user interface pages displayed to a client.
POST[host]/api/v2/quizzes/{quizId}/questions/{questionId}/answers
curl --location --request POST 'https://host.name/api/v2/quizzes/1/questions/1/answers' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja' \
--data-raw '{
"text": "The text of an answer option",
"isVisible": true,
"isCorrect": true,
"resources": [
{
"key": "caption",
"locale": "ru_RU",
"value": "value"
},
{
"key": "caption",
"locale": "en_US",
"value": "value"
}
]
}'
Response
A response contains an Answer Option object providing information about the answer option that was added for a question.
Update an answer option
Use this method to update a specific answer option.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters
- quizId required
The identifier of a test.
- questionId required
The question identifier.
- answerId required
The identifier of an answer option.
Body:
The following field values can be updated:
- text string
The text of an answer option.
- isVisible boolean
If
true
, an answer option is displayed to clients when passing a test in the B2Core UI; otherwise,false
.- isCorrect boolean
If
true
, an answer option is the correct one; otherwise,false
.- resources object
An array of resource objects specifying the localized strings for user interface pages displayed to a client.
PATCH[host]/api/v2/quizzes/{quizId}/questions/{questionId}/answers/{answerId}
curl --location --request PATCH 'https://host.name/api/v2/quizzes/1/questions/1/answers/1' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja' \
--data-raw '{
"text": "The text of an answer option",
"isVisible": true,
"isCorrect": true,
"resources": [
{
"key": "caption",
"locale": "ru_RU",
"value": "value"
},
{
"key": "caption",
"locale": "en_US",
"value": "value"
}
]
}'
Response
A response includes an Answer Option object providing information about the answer option that was updated.
Delete an answer option
Use this method to delete a specific answer option that was previously added for a question.
Request
Header parameters:
Authorization: Bearer <token>
Path parameters:
- quizId required
The identifier of a test.
- questionId required
The question identifier.
- answerId required
The identifier of an answer option.
DELETE[host]/api/v2/quizzes/{quizId}/questions/{questionId}/answers/{answerId}
curl --location --request DELETE 'https://host.name/api/v2/quizzes/1/questions/1/answers/1' \
--header 'Authorization: Bearer <token>'
Response
In case of success, no response body is returned.
Get a list of completed tests
Use this method to get a list of attempts that were made by a client when passing a specific test and view the attempt results.
Request
Header parameters:
Authorization: Bearer <token>
Path parameters:
- clientId required
The client identifier.
Query parameters:
The following filter parameters are available for this method:
- quizId
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
The following sorting parameter is available for this method:
- createTime
The date and time when a test was completed by a client.
Refer to the Query parameters section in the API Overview for details on applying filter and sorting parameters.
GET[host]/api/v2/clients/{clients}/quizzes
curl --location -g --request GET 'https://host.name/api/v2/clients/1/quizzes?limit=10&offset=0&sort_order=desc&sort_by=createTime&filter[quizId]=1&filter[status]=completed' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja'
Response
A response contains an array of Completed Test objects providing information about the completed tests matching the request parameters.
Get completed test details
Use this method to get detailed information about a specific attempt that was made by a client to pass a test.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- clientId required
The client identifier.
- attemptId required
The identifier of an attempt.
GET[host]/api/v2/clients/{clientId}/quizzes/{attemptId}
curl --location -g --request GET 'https://host.name/api/v2/clients/1/quizzes/1' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja'
Response
A response includes a Completed Test object providing information about the specified attempt to pass the test.