Passwords
Use these methods to change or restore client passwords, as well as get a password change history.
POST[host]/api/v2/my/password/change |
|
POST[host]/api/v2/my/password/restore |
|
GET[host]/api/v2/my/password/changes |
|
GET[host]/api/v2/my/password/changes/{changeId} |
Change a client password
Use this method to change a client password.
Request
Header parameters:
Authorization: Bearer <access_token>
Content-Type: application/json
successToken: <token>
— the success token obtained after a 2FA procedure (the one initiated for a password change operation) has been successfully completed.
To obtain the success token, use the methods to initiate and then complete a 2FA procedure.
Body:
- password string required
The new password.
POST[host]/api/v2/my/password/change
curl --location --request POST 'https://host.name/api/v2/my/password/change' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'successToken: <token>' \
--data-raw '{
"password": "Qwerty123"
}'
Response
In case of success, no response body is returned.
Restore a client password
Use this method to restore a password for a client who is not signed in to the B2Core UI.
Request
Header parameters:
Content-Type: application/json
successToken: <token>
— the success token obtained after a 2FA procedure (the one initiated for a password recovery operation) has been successfully completed.
To obtain the success token, use the methods to initiate and then complete a 2FA procedure.
Body:
- password string required
The new password.
POST[host]/api/v2/my/password/restore
curl --location --request POST 'https://host.name/api/v2/my/password/restore' \
--header 'Content-Type: application/json' \
--header 'successToken: b2fcf999-2b0b-451d-9888-094a79117aa5' \
--data-raw '{
"password": "Qwerty123"
}'
Response
In case of success, no response body is returned.
Get a password change history
Use this method to get a password change history.
Request
Header parameters:
Authorization: Bearer <token>
Query parameters:
The following sorting parameter is available for this method:
- createTime (default)
The date and time when a password was changed or restored.
GET[host]/api/v2/my/password/changes
curl --location --request GET 'https://host.name/api/v2/my/password/changes?limit=10&offset=0&sort_order=desc&sort_by=createTime' \
--header 'Authorization: Bearer <token>'
Response
A response includes the following data about each password change record:
- id integer
The identifier of a password change record.
- type string
The password change type. Possible values:
changed
— a client’s password was updated by a Back Office user.restored
— a password was updated by a client.
- createTime string
The date and time when a password was changed or restored.
{
"total": 2,
"data": [
{
"id": 1,
"type": "changed",
"createTime": "2022-01-01T00:00:00+00:00"
},
{
"id": 2,
"type": "changed",
"createTime": "2022-01-01T00:00:00+00:00"
}
]
}
Get password change details
Use this method to obtain detailed information about a specified password change record.
Request
Header parameters:
Authorization: Bearer <token>
Path parameters:
- changeId required
The identifier of a password change record.
GET[host]/api/v2/my/password/changes/{changeId}
curl --location --request GET 'https://host.name/api/v2/my/password/changes/1' \
--header 'Authorization: Bearer <token>'
Response
A response includes the following data about a specified password change record:
- id integer
The identifier of a password change record.
- type string
The password change type. Possible values:
changed
— a client’s password was updated by a Back Office user.restored
— a password was updated by a client.
- createTime string
The date and time when a password was changed or restored.
{
"id": 1,
"type": "changed",
"createTime": "2022-01-01T00:00:00+00:00"
}