post

/oauth2/login/phone/request

Starts authentication by the user phone number and sends a confirmation code to their phone number. The code lifetime is 3 minutes.

This call is used only with the Complete auth by phone number call.

The workflow of using this call:

  1. The application opens an authentication form so the user can enter their phone number.
  2. The user enters their phone number.
  3. The application sends this request to the Xsolla Login server: a. If the parameter send_link is true, after this request, you should send the Get confirmation code request to make SMS contain the confirmation code and link. b. If the parameter send_link is false or not passed, the SMS will contain the confirmation code only.
  4. The Xsolla Login server sends the SMS and returns the ID of the confirmation code.
  5. The application shows a field so the user can fill in the confirmation code.
  6. The user enters the received confirmation code or follows the link.
  7. The application sends the Complete auth by phone number request with the received ID to the Xsolla Login server.
  8. The user is considered as authorized.

Request Parameters

5 Query Parameters

Request Body

Schema
object
link_url
string

URL to redirect the user to the status authentication page. Required if the parameter send_link is true.

1 validation
phone_number
string

User phone number.

2 validations + required
send_link
boolean

Shows whether a link is sent with the confirmation code in the SMS or not.

The link can be used instead of the confirmation code to log in.

If the parameter has the true value, the link is sent in the SMS.

Responses

OK

Schema
object
operation_id
string

ID of the confirmation code.

required

Send a Test Request

Send requests directly from the browser (CORS must be enabled)
$$.env
No $$.env variables are being used in this request.