After a successful sign up, the first check needed is to verify a mobile phone number. This is mostly for compliance and to ensure the consumer will be able to use security features, such as Two Factor and Account Recovery.
Start by sending the verification code to the mobile phone using SMS:
const userId = "e6169f9b-6a8d-4f30-9778-1b74d457616e"; const phoneId = "ccb3f57b-b903-4a77-a7a5-11303e1e0c16"; // Sends SMS with a verification code await bitcapital.phones().sendVerificationToken(userId, phoneId);
The response of the request will include the time this code expires, as well as a cool down period in which you won't be able to send another code to the same number.
The token should be verified exactly as it was sent, an uppercase char, a hyphen followed by the 6 digit numeric code. In your UI, when the user input the code it received, you can verify the phone using the method below.
const token = "A-123456"; // Send the verification token to activate phone in the platform await bitcapital.phones().verify(userId, phoneId, token);
In case of time expiration, you may request a new code repeating the same steps shown above.
Updated 22 days ago