Verify code
curl --request POST \
--url https://verify-api.smsmanager.com/v1/validations/{token}/verify \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"code": "123456"
}
'import requests
url = "https://verify-api.smsmanager.com/v1/validations/{token}/verify"
payload = { "code": "123456" }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({code: '123456'})
};
fetch('https://verify-api.smsmanager.com/v1/validations/{token}/verify', 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://verify-api.smsmanager.com/v1/validations/{token}/verify",
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([
'code' => '123456'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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://verify-api.smsmanager.com/v1/validations/{token}/verify"
payload := strings.NewReader("{\n \"code\": \"123456\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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://verify-api.smsmanager.com/v1/validations/{token}/verify")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"code\": \"123456\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://verify-api.smsmanager.com/v1/validations/{token}/verify")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"code\": \"123456\"\n}"
response = http.request(request)
puts response.read_body{
"verified": true,
"phoneNumber": "1234567890",
"token": "61591bd88d8fbe7736bca535809d1216dd71cb0b5cbf2b07e5a08adfbeb5d35b",
"code": "123456",
"timestamp": "2024-01-15T10:30:00Z",
"proof": "86dd8444ed76402c93ce62497cb29a0d7af7215261b8497cb355e617b13f4ef2",
"verifiedAt": "2024-01-15T10:31:15Z"
}Verify API
Verify code
Verifies the code entered by the user. On successful verification, returns all data needed for backend verification including the phone number, token, code, timestamp, and HMAC proof (if account has verificationSecret configured).
The number of attempts is limited based on account configuration (default: 6).
POST
/
v1
/
validations
/
{token}
/
verify
Verify code
curl --request POST \
--url https://verify-api.smsmanager.com/v1/validations/{token}/verify \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"code": "123456"
}
'import requests
url = "https://verify-api.smsmanager.com/v1/validations/{token}/verify"
payload = { "code": "123456" }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({code: '123456'})
};
fetch('https://verify-api.smsmanager.com/v1/validations/{token}/verify', 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://verify-api.smsmanager.com/v1/validations/{token}/verify",
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([
'code' => '123456'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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://verify-api.smsmanager.com/v1/validations/{token}/verify"
payload := strings.NewReader("{\n \"code\": \"123456\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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://verify-api.smsmanager.com/v1/validations/{token}/verify")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"code\": \"123456\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://verify-api.smsmanager.com/v1/validations/{token}/verify")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"code\": \"123456\"\n}"
response = http.request(request)
puts response.read_body{
"verified": true,
"phoneNumber": "1234567890",
"token": "61591bd88d8fbe7736bca535809d1216dd71cb0b5cbf2b07e5a08adfbeb5d35b",
"code": "123456",
"timestamp": "2024-01-15T10:30:00Z",
"proof": "86dd8444ed76402c93ce62497cb29a0d7af7215261b8497cb355e617b13f4ef2",
"verifiedAt": "2024-01-15T10:31:15Z"
}Path Parameters
Body
application/json
Response
Code verified successfully
Was this page helpful?