Registration
To allow a user to sign up to the B2Core UI, you need to select which fields are displayed to the user on the registration form. To do this, initialize the Sign Up Wizard and configure the custom form validation rules.
POST[host]/api/v2/my/signup/wizard |
|
POST[host]/api/v2/my/signup |
Initialize the Sign Up Wizard
Use this method to initialize the Sign Up Wizard for a user and specify the fields displayed on the user registration form.
Request
Body:
- url string required
The template for a client registration link.
- utm object
This object provides the following field:
- referral string
The referral code which determines the client registration link address.
POST[host]/api/v2/my/signup/wizard
curl --location --request POST 'https://host.name/api/v2/my/signup/wizard' \
--data-raw '{
"url": "https://host.name/register/{registration}/{code}",
"utm": {
"referral": "29734fc149dc93809d18f49ae970810a"
}
}'
Response
- code integer
An HTTP code specifying the current step in a progression of wizard pages:
HTTP code
200
for an intermediary step after which another page of an authentication form is displayed to a userHTTP code
202
for a final wizard step signaling that user authentication succeeded
- data object
Contains an object providing the following field:
- fields object
An array of wizard fields displayed on a client registration form.
- done boolean
If
true
, the wizard initialization succeeded; otherwise,false
.- uuid string
The universally unique identifier (UUID) assigned to a client authentication session.
- workflow string
A string value indicating the current stage of an authentication procedure.
{
"code": 202,
"data": {
"fields": {}
},
"done": true,
"uuid": "36f59381-5b54-48bd-a0c7-3b908c476732",
"workflow": "basic_register_form"
}
Sign up to the B2Core UI
Use this method to sign up to the B2Core UI.
Request
Body:
- uuid string required
The universally unique identifier (UUID) assigned to a client authentication session.
- email string required
The client email.
- password string required
The client password.
- password_confirmation string required
The repeatedly entered password for its confirmation.
- device_fingerprint string required
The free-form JSON data (which includes the required
user_agent
field) generated by a client in the format of a Base64-encoded string that uniquely identifies a device from which a request is sent.To learn how to get a device fingerprint, refer to Obtain a device fingerprint.
- addresses object
A list of country codes indicating a client’s location.
- info object
An object specifying a client name:
Show object fields- familyName string
The client last name.
- givenName string
The client first name.
- recaptchaResponse string
The reCAPTCHA response token.
POST[host]/api/v2/my/signup
curl --location --request POST 'https://host.name/api/v2/my/signup' \
--data-raw '{
"uuid": "36f59381-5b54-48bd-a0c7-3b908c476732",
"email": "foo@bar.com",
"password": "Secret123",
"password_confirmation": "Secret123",
"device_fingerprint": "dwqdnNFJBOEBFJEBjqewbkjqbdwjqwbndjnbj",
"addresses": {
"0": {
"country_code": "16"
}
},
"info": {
"familyName": "Brown",
"givenName": "John"
},
"recaptchaResponse": "ut nu"
}'
Response
- code integer
An HTTP code specifying the current step in a progression of wizard pages:
HTTP code
200
for an intermediary step after which another page of an authentication form is displayed to a userHTTP code
202
for a final wizard step signaling that user authentication succeededHTTP code
400
for an invalid authentication request
- data object
The access token and refresh token data:
Show object fields- token string
The access or refresh token.
- createdAt string
The date and time when a token was generated.
- expiresAt string
The date and time when a token is due to expire.
- done boolean
If
true
, authentication has succeeded; otherwise,false
.- uuid string
The universally unique identifier (UUID) assigned to a client authentication session.
- workflow string
A string value indicating the current stage of an authentication procedure.
{
"code": 202,
"data": {},
"done": true,
"uuid": "36f59381-5b54-48bd-a0c7-3b908c476732",
"workflow": "login"
}