Client profiles
Use these methods to obtain and edit client profile data.
GET[host]/api/v2/my/profile |
|
GET[host]/api/v2/my/profile/deactivation |
|
POST[host]/api/v2/my/profile/deactivation |
|
PUT[host]/api/v2/my/profile PATCH[host]/api/v2/my/profile |
Get client profile data
Use this method to get client profile data.
Request
Header parameters:
Authorization: Bearer <access_token>
GET[host]/api/v2/my/profile
curl --location --request GET 'https://host.name/api/v2/my/profile' \
--header 'Authorization: Bearer <token>'
Response
A response contains a Client Profile object providing client-related data.
Initialize client profile deactivation
Use this method to enable clients to deactivate their profiles through the mobile app.
Note
If the Delete data option is enabled in the Back Office, the client’s personal data is removed from client profiles after they are deactivated.
If you want the client’s personal data to be removed only after the admin’s approval, enable the Request required for Deleting Data option.
Both options are available upon navigating to System > Settings in the Back Office.
Request
Header parameters:
Authorization: Bearer <access_token>
GET[host]/api/v2/my/profile/deactivation
curl --location --request GET 'https://host.name/api/v2/my/profile/deactivation' \
--header 'Authorization: Bearer <token>'
Response
- code integer
An HTTP code specifying the current step of a procedure of deactivating a client profile:
HTTP code
200
for an intermediary step after which another page of the profile deactivation form is displayed to a clientHTTP code
202
for the final procedure step signaling that a client profile was successfully deactivated
- data object
The details about the verification code that has been sent to a client email address. The code is required to confirm a procedure of deactivating a client profile.
- done boolean
If
true
, the client profile was successfully deactivated; otherwise,false
.- uuid string
The universally unique identifier (UUID) assigned to a procedure of profile deactivation.
- expiredAt string
The date and time when a verification code is due to expire.
- sentAt string
The date and time when a verification code was sent to a client email address.
- workflow string
A string value indicating the next step of a procedure of profile deactivation. Always
email
, indicating that confirmation with the verification code sent to a client email address is required. Next, use the method to confirm client profile deactivation.
{
"code": 200,
"data": {
"status": 0,
"entity_id": 1,
"entity_type": "client",
"recipient": {
"class": "B2B\\TCA\\Confirmations\\Recipients\\EmailRecipient",
"template": "DeletePersonalData",
"email": "jdow@example.com",
"name": "John Doe",
"url": "",
"method": "email"
}
},
"done": false,
"uuid": "36f59381-5b54-48bd-a0c7-3b908c476732",
"sent": 1,
"expiredAt": "2022-01-01T00:00:00+00:00",
"sentAt": "2022-01-01T00:00:00+00:00",
"workflow": "email"
}
Confirm client profile deactivation
Use this method to confirm the procedure of deactivating a client profile that was initialized by a client through the mobile app.
Request
Body:
- uuid string required
The universally unique identifier (UUID) obtained after initializing a procedure of deactivating a client profile.
- code integer required
The verification code sent to a client email address.
POST[host]/api/v2/my/profile/deactivation
curl --location --request POST 'https://host.name/api/v2/my/profile/deactivation' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data '{
"uuid": "36f59381-5b54-48bd-a0c7-3b908c476732",
"code": 213690
}'
Response
- code integer
An HTTP code specifying the current step of a procedure of deactivating a client profile:
HTTP code
200
for an intermediary step after which another page of the profile deactivation form is displayed to a clientHTTP code
202
for the final procedure step signaling that a client profile was successfully deactivated
- data object
The object containing the following field:
Show object fieldsrequestCreated boolean
If
true
, a request for deactivating a client profile has been created and must be approved by the admin.If
false
, a client profile is deactivated without the admin’s approval.
- done boolean
If
true
, the client profile was successfully deactivated; otherwise,false
.- uuid string
The universally unique identifier (UUID) assigned to a procedure of profile deactivation.
- workflow string
A string value indicating the next step of a procedure of profile deactivation.
{
"code": 202,
"data": {
"requestCreated": false
},
"done": true,
"uuid": "36f59381-5b54-48bd-a0c7-3b908c47673",
"workflow": "B2B\\TCA\\Wizards\\Workflow\\TerminateWorkflow"
}
Update client profile data
Use this method to update a client profile.
Request
Header parameters:
Authorization: Bearer <access_token>
Body:
The following field values can be updated for a client profile:
- nickname string
The client’s nickname used in the B2Core UI.
- locale string
The localization settings applied to the B2Core UI.
- info object
The client personal data.
Show object fields- firstName string
The client’s first name.
- lastName string
The client’s last name.
- middleName string
The client’s middle name.
- birthday string
The client’s date of birth.
PUT[host]/api/v2/my/profile
curl --location --request PUT 'https://host.name/api/v2/my/profile' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"nickname": "Nickname",
"locale": "en_US",
"info": {
"firstName": "James",
"lastName": "Parker",
"middleName": "William",
"birthday": "2022-01-01T00:00:00+00:00"
}
}'
Response
A response includes a Client Profile object providing information about the updated client profile.