Skip to main content

Registration and Login

Sailplay helps identify the client when they log in to the website or mobile application.
Actions for registration and login differ, so it is important to correctly organize their order.

Registration — entering a phone number

Registration

  1. After entering the phone number in the registration field and clicking the "Get Code" button, send an API request.
    Check if the client is registered in the loyalty program using the user information retrieval method /users/info`/.

Registration — user already exists

  1. If the API returned information about an existing user, display a message to the client that registration is not possible.

Registration — user not found

  1. If the API returned information that the user is missing from the system, immediately after the response, send an SMS code for number confirmation.
    Use the SMS sending method /users/sms-code/`.

  2. In response to the SMS sending request, the method will return a verification code in the sms-code parameter.
    Match it with the value entered by the client.

Registration — entering SMS code

  1. If the client entered the correct code, send the next request to the API at /users/add/ `.

  2. If the client entered an incorrect verification code, display error information to the client.

Registration — incorrect SMS code

Upon completion of registration, it is recommended to pass the tag
"registration on website" or "registration in mobile application" using the tag addition method /users/tags/add/`.


Login

  1. To confirm the phone number during login, create a request to send an SMS
    upon clicking the "Get Code" button using the SMS sending method /users/sms-code/`.

Login — sending SMS code

  1. After sending the SMS, a verification code entry field should appear on the website.
    When the client enters the code and clicks the "Confirm" button, match the entered value with the code from the API response (sms-code).

    If the values do not match, display a message to the client that the code was entered incorrectly.

Login — confirming SMS code

  1. If the code from the API response matches the code entered by the client, authorize the user on the website.
    Perform all subsequent position calculation requests on behalf of the authorized client.