Send Phone Verification SMS
curl --request POST \
--url https://api.example.com/v1/auth/register/phone/send \
--header 'Content-Type: application/json' \
--data '
{
"phoneCountryCode": "<string>",
"phoneNumber": "<string>",
"contactVerificationId": "<string>"
}
'import requests
url = "https://api.example.com/v1/auth/register/phone/send"
payload = {
"phoneCountryCode": "<string>",
"phoneNumber": "<string>",
"contactVerificationId": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
phoneCountryCode: '<string>',
phoneNumber: '<string>',
contactVerificationId: '<string>'
})
};
fetch('https://api.example.com/v1/auth/register/phone/send', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/auth/register/phone/send",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'phoneCountryCode' => '<string>',
'phoneNumber' => '<string>',
'contactVerificationId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/auth/register/phone/send"
payload := strings.NewReader("{\n \"phoneCountryCode\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"contactVerificationId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/auth/register/phone/send")
.header("Content-Type", "application/json")
.body("{\n \"phoneCountryCode\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"contactVerificationId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/auth/register/phone/send")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"phoneCountryCode\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"contactVerificationId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyAuthentication
Send Phone Verification SMS
Send SMS verification code to user’s phone number during registration
POST
/
v1
/
auth
/
register
/
phone
/
send
Send Phone Verification SMS
curl --request POST \
--url https://api.example.com/v1/auth/register/phone/send \
--header 'Content-Type: application/json' \
--data '
{
"phoneCountryCode": "<string>",
"phoneNumber": "<string>",
"contactVerificationId": "<string>"
}
'import requests
url = "https://api.example.com/v1/auth/register/phone/send"
payload = {
"phoneCountryCode": "<string>",
"phoneNumber": "<string>",
"contactVerificationId": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
phoneCountryCode: '<string>',
phoneNumber: '<string>',
contactVerificationId: '<string>'
})
};
fetch('https://api.example.com/v1/auth/register/phone/send', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/auth/register/phone/send",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'phoneCountryCode' => '<string>',
'phoneNumber' => '<string>',
'contactVerificationId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/auth/register/phone/send"
payload := strings.NewReader("{\n \"phoneCountryCode\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"contactVerificationId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/auth/register/phone/send")
.header("Content-Type", "application/json")
.body("{\n \"phoneCountryCode\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"contactVerificationId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/auth/register/phone/send")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"phoneCountryCode\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"contactVerificationId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyOverview
Send a verification code via SMS to the user’s phone number. This is typically the second step in the registration onboarding flow after email verification. The user will receive a 6-digit code via SMS that must be verified in the next step.Request
Body
string
required
Phone country calling codeFormat: Include + prefixExample:
+44string
required
Phone number without country codeExample:
7400846282string
required
Verification ID from email send stepExample:
US_100a99cf-f4d3-4fa1-9be9-2e9828b20ebbResponse
{
"success": true
}
Code Examples
const response = await fetch('https://dev.api.baanx.com/v1/auth/register/phone/send', {
method: 'POST',
headers: {
'x-client-key': 'your-client-key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
phoneCountryCode: '+44',
phoneNumber: '7400846282',
contactVerificationId: sessionStorage.getItem('contactVerificationId')
})
});
console.log('SMS verification code sent');
Next Steps
Verify Phone Code
Verify the SMS code to confirm phone number
Was this page helpful?
⌘I