Send OTP
curl --request POST \
--url https://otpedge.com/api/v1/send-otp \
--header 'Content-Type: application/json' \
--data '
{
"to": "<string>",
"app": "<string>",
"environment": "<string>",
"template": "<string>"
}
'import requests
url = "https://otpedge.com/api/v1/send-otp"
payload = {
"to": "<string>",
"app": "<string>",
"environment": "<string>",
"template": "<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({to: '<string>', app: '<string>', environment: '<string>', template: '<string>'})
};
fetch('https://otpedge.com/api/v1/send-otp', 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://otpedge.com/api/v1/send-otp",
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([
'to' => '<string>',
'app' => '<string>',
'environment' => '<string>',
'template' => '<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://otpedge.com/api/v1/send-otp"
payload := strings.NewReader("{\n \"to\": \"<string>\",\n \"app\": \"<string>\",\n \"environment\": \"<string>\",\n \"template\": \"<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://otpedge.com/api/v1/send-otp")
.header("Content-Type", "application/json")
.body("{\n \"to\": \"<string>\",\n \"app\": \"<string>\",\n \"environment\": \"<string>\",\n \"template\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://otpedge.com/api/v1/send-otp")
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 \"to\": \"<string>\",\n \"app\": \"<string>\",\n \"environment\": \"<string>\",\n \"template\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"req_id": "oe_a1b2c3d4e5f6",
"status": "dispatched"
}
{
"error": "Spam Prevention: Too many requests to this number. Please wait 60 seconds.",
"code": "SPAM_COOLDOWN"
}
API Endpoints
Send OTP
Dispatches a 6-digit verification code to a WhatsApp number.
POST
/
api
/
v1
/
send-otp
Send OTP
curl --request POST \
--url https://otpedge.com/api/v1/send-otp \
--header 'Content-Type: application/json' \
--data '
{
"to": "<string>",
"app": "<string>",
"environment": "<string>",
"template": "<string>"
}
'import requests
url = "https://otpedge.com/api/v1/send-otp"
payload = {
"to": "<string>",
"app": "<string>",
"environment": "<string>",
"template": "<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({to: '<string>', app: '<string>', environment: '<string>', template: '<string>'})
};
fetch('https://otpedge.com/api/v1/send-otp', 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://otpedge.com/api/v1/send-otp",
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([
'to' => '<string>',
'app' => '<string>',
'environment' => '<string>',
'template' => '<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://otpedge.com/api/v1/send-otp"
payload := strings.NewReader("{\n \"to\": \"<string>\",\n \"app\": \"<string>\",\n \"environment\": \"<string>\",\n \"template\": \"<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://otpedge.com/api/v1/send-otp")
.header("Content-Type", "application/json")
.body("{\n \"to\": \"<string>\",\n \"app\": \"<string>\",\n \"environment\": \"<string>\",\n \"template\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://otpedge.com/api/v1/send-otp")
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 \"to\": \"<string>\",\n \"app\": \"<string>\",\n \"environment\": \"<string>\",\n \"template\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"req_id": "oe_a1b2c3d4e5f6",
"status": "dispatched"
}
{
"error": "Spam Prevention: Too many requests to this number. Please wait 60 seconds.",
"code": "SPAM_COOLDOWN"
}
Request Body
string
required
The recipient’s phone number in strict E.164 format (e.g.,
+919876543210).string
required
The name of your application, used for branding in the message.
string
required
The environment for the request (e.g.,
live or sandbox).string
required
The template ID to use (e.g.,
otp_veri).Expiry: The dispatched OTP code is valid for exactly 10 minutes from the time of generation.
Request Examples
curl -X POST https://otpedge.com/api/v1/send-otp \
-H "Authorization: Bearer your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"to": "911234567891",
"app": "app_name",
"environment": "live",
"template": "otp_veri"
}'
const response = await fetch('https://otpedge.com/api/v1/send-otp', {
method: 'POST',
headers: {
'Authorization': 'Bearer your_api_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
to: '911234567891',
app: 'app_name',
environment: 'live',
template: 'otp_veri'
})
});
const data = await response.json();
console.log(data);
import requests
url = "https://otpedge.com/api/v1/send-otp"
headers = {
"Authorization": "Bearer your_api_key_here",
"Content-Type": "application/json"
}
payload = {
"to": "911234567891",
"app": "app_name",
"environment": "live",
"template": "otp_veri"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
<?php
$ch = curl_init("https://otpedge.com/api/v1/send-otp");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
"to" => "911234567891",
"app" => "app_name",
"environment" => "live",
"template" => "otp_veri"
]));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer your_api_key_here",
"Content-Type: application/json"
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
func main() {
url := "https://otpedge.com/api/v1/send-otp"
payload := map[string]string{
"to": "911234567891",
"app": "app_name",
"environment": "live",
"template": "otp_veri",
}
jsonPayload, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonPayload))
req.Header.Set("Authorization", "Bearer your_api_key_here")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
fmt.Println("Response Status:", res.Status)
}
Response Examples
{
"success": true,
"req_id": "oe_a1b2c3d4e5f6",
"status": "dispatched"
}
{
"error": "Spam Prevention: Too many requests to this number. Please wait 60 seconds.",
"code": "SPAM_COOLDOWN"
}