Loading . . .
1510 Sector 82, Mohali, Punjab 9.00 am - 9.00 pm
verifyone@bhanguz.com +91 9465434150

Send Message API

Choose between sending messages with OTP or without OTP. Placeholders in the message template are dynamically replaced, and all messages are securely logged for audit.

🔗 Endpoint
POST https://verifyone.bhanguz.com/api/send-otp
🔐 Authentication

Token-based authentication using sid and token from a verified website.

📥 Request Parameters
Parameter Type Required Description
token string Yes Token assigned after website verification.
sid string Yes Secure ID of the verified website.
template_id string Yes ID of the OTP template.
phone string Yes Phone number of the recipient.
send_type string Yes Delivery type: sms.
data object Yes Key-value pairs to replace in the template.
data.name string No Name to embed in the OTP message.
data.otp string Yes One-Time Password value for authentication.
data.time string No Expiry time or validity duration of the OTP (e.g., 5 minutes).
data.button string No Optional button text to include in the email (e.g., "Verify Now").
📤 Sample Request
{
  "token": "e8c9a8c0f2a0d6fabc",
  "sid": "fd0c34b7-fd13-4961-8a75-abcdfd0e2149",
  "template_id": "TEMP12345",
  "phone": "9876543210",
  "send_type": "sms",
  "data": {
    "name": "Prince",
    "otp": "482913"
  }
}
curl -X POST https://verifyone.bhanguz.com/api/send-otp \
-H "Content-Type: application/json" \
-d '{
  "token": "e8c9a8c0f2a0d6fabc",
  "sid": "fd0c34b7-fd13-4961-8a75-abcdfd0e2149",
  "template_id": "TEMP12345",
  "phone": "9876543210",
  "send_type": "sms",
  "data": {
    "name": "Prince",
    "otp": "482913"
  }
}'
<?php
$data = [
  "token" => "e8c9a8c0f2a0d6fabc",
  "sid" => "fd0c34b7-fd13-4961-8a75-abcdfd0e2149",
  "template_id" => "TEMP12345",
  "phone" => "9876543210",
  "send_type" => "sms",
  "data" => [ "name" => "Prince", "otp" => "482913" ]
];

$ch = curl_init("https://verifyone.bhanguz.com/api/send-otp");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, ["Content-Type: application/json"]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
const axios = require('axios');

axios.post('https://verifyone.bhanguz.com/api/send-otp', {
  token: "e8c9a8c0f2a0d6fabc",
  sid: "fd0c34b7-fd13-4961-8a75-abcdfd0e2149",
  template_id: "TEMP12345",
  phone: "9876543210",
  send_type: "sms",
  data: { name: "Prince", otp: "482913" }
})
.then(res => console.log(res.data))
.catch(err => console.error(err));
import requests

url = "https://verifyone.bhanguz.com/api/send-otp"
payload = {
  "token": "e8c9a8c0f2a0d6fabc",
  "sid": "fd0c34b7-fd13-4961-8a75-abcdfd0e2149",
  "template_id": "TEMP12345",
  "phone": "9876543210",
  "send_type": "sms",
  "data": { "name": "Prince", "otp": "482913" }
}

headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
✅ Success Response (With OTP)
{
  "error": 0,
  "message": "OTP sent successfully to user.",
  "data": {
    "template_title": "OTP Verification",
    "body": "Hello Amit, your OTP is 452981. It is valid for 5 minutes.",
    "user_phone": "9876543210",
    "otp": "452981",
    "expires_in": "5 minutes"
  }
}
❌ Error Responses (With OTP)
{
  "error": 1,
  "message": "FCM Token not found."
}

{
  "error": 2,
  "message": "User not found."
}

{
  "error": 3,
  "message": "Website not found."
}

{
  "error": 4,
  "message": "Template not found."
}

{
  "error": 5,
  "message": "Your plan is Over, Expired Time"
}

{
  "error": 6,
  "message": "Your plan is Over, Message limit exceeded"
}

{
  "error": 7,
  "message": "The data field must be an array."
}

{
  "error": 8,
  "message": "OTP generation failed. Please try again."
}

{
  "error": 9,
  "message": "OTP delivery failed due to gateway error."
}
🔗 Endpoint
POST https://verifyone.bhanguz.com/api/send-otp
🔐 Authentication

Token-based authentication using sid and token from a verified website.

📥 Request Parameters
Parameter Type Required Description
tokenstringYesToken assigned after website verification.
sidstringYesSecure ID of the verified website.
template_idstringYesID of the selected message template.
phonestringYesPhone number of the recipient.
send_typestringYesDelivery type: direct.
dataobjectYesKey-value pairs to replace in the template.
data.namestringYesName to embed in the message.

Send Message API

This API is used to send predefined template-based messages to users.

{
  "token": "e8c9a8c0f2a0d6fabc",
  "sid": "fd0c34b7-fd13-4961-8a75-xyz",
  "template_id": "TEMP67890",
  "phone": "9876543210",
  "send_type": "direct",
  "data": { "name": "Rajesh" }
}
curl -X POST https://verifyone.bhanguz.com/api/send-otp \
-H "Content-Type: application/json" \
-d '{
  "token": "e8c9a8c0f2a0d6fabc",
  "sid": "fd0c34b7-fd13-4961-8a75-xyz",
  "template_id": "TEMP67890",
  "phone": "9876543210",
  "send_type": "direct",
  "data": { "name": "Rajesh" }
}'
<?php
$ch = curl_init("https://verifyone.bhanguz.com/api/send-otp");
$data = [
  "token" => "e8c9a8c0f2a0d6fabc",
  "sid" => "fd0c34b7-fd13-4961-8a75-xyz",
  "template_id" => "TEMP67890",
  "phone" => "9876543210",
  "send_type" => "direct",
  "data" => ["name" => "Rajesh"]
];
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type:application/json']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
const axios = require('axios');

axios.post('https://verifyone.bhanguz.com/api/send-otp', {
  token: "e8c9a8c0f2a0d6fabc",
  sid: "fd0c34b7-fd13-4961-8a75-xyz",
  template_id: "TEMP67890",
  phone: "9876543210",
  send_type: "direct",
  data: { name: "Rajesh" }
}).then(res => {
  console.log(res.data);
}).catch(err => console.error(err));
import requests

url = "https://verifyone.bhanguz.com/api/send-otp"
payload = {
  "token": "e8c9a8c0f2a0d6fabc",
  "sid": "fd0c34b7-fd13-4961-8a75-xyz",
  "template_id": "TEMP67890",
  "phone": "9876543210",
  "send_type": "direct",
  "data": { "name": "Rajesh" }
}
response = requests.post(url, json=payload)
print(response.json())
import java.net.*;
import java.io.*;

public class SendMessage {
  public static void main(String[] args) throws Exception {
    URL url = new URL("https://verifyone.bhanguz.com/api/send-otp");
    HttpURLConnection conn = (HttpURLConnection) url.openConnection();
    conn.setRequestMethod("POST");
    conn.setRequestProperty("Content-Type", "application/json");
    conn.setDoOutput(true);

    String jsonInput = "{\\"token\\":\\"e8c9a8c0f2a0d6fabc\\",\\"sid\\":\\"fd0c34b7-fd13-4961-8a75-xyz\\",\\"template_id\\":\\"TEMP67890\\",\\"phone\\":\\"9876543210\\",\\"send_type\\":\\"direct\\",\\"data\\":{\\"name\\":\\"Rajesh\\"}}";

    try(OutputStream os = conn.getOutputStream()) {
      byte[] input = jsonInput.getBytes("utf-8");
      os.write(input, 0, input.length);
    }

    BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"));
    StringBuilder response = new StringBuilder();
    String responseLine;
    while ((responseLine = br.readLine()) != null) {
      response.append(responseLine.trim());
    }
    System.out.println(response.toString());
  }
}
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

class Program {
  static async Task Main() {
    var client = new HttpClient();
    var json = "{\\"token\\":\\"e8c9a8c0f2a0d6fabc\\",\\"sid\\":\\"fd0c34b7-fd13-4961-8a75-xyz\\",\\"template_id\\":\\"TEMP67890\\",\\"phone\\":\\"9876543210\\",\\"send_type\\":\\"direct\\",\\"data\\":{\\"name\\":\\"Rajesh\\"}}";
    var content = new StringContent(json, Encoding.UTF8, "application/json");
    var response = await client.PostAsync("https://verifyone.bhanguz.com/api/send-otp", content);
    var result = await response.Content.ReadAsStringAsync();
    Console.WriteLine(result);
  }
}
require 'net/http'
require 'json'

uri = URI('https://verifyone.bhanguz.com/api/send-otp')
req = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
req.body = {
  token: "e8c9a8c0f2a0d6fabc",
  sid: "fd0c34b7-fd13-4961-8a75-xyz",
  template_id: "TEMP67890",
  phone: "9876543210",
  send_type: "direct",
  data: { name: "Rajesh" }
}.to_json

res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
  http.request(req)
end

puts res.body
package main

import (
  "bytes"
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {
  url := "https://verifyone.bhanguz.com/api/send-otp"
  jsonStr := []byte(`{"token":"e8c9a8c0f2a0d6fabc","sid":"fd0c34b7-fd13-4961-8a75-xyz","template_id":"TEMP67890","phone":"9876543210","send_type":"direct","data":{"name":"Rajesh"}}`)

  req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonStr))
  req.Header.Set("Content-Type", "application/json")

  client := &http.Client{}
  resp, _ := client.Do(req)
  defer resp.Body.Close()

  body, _ := ioutil.ReadAll(resp.Body)
  fmt.Println(string(body))
}
✅ Success Response
{
  "error": 0,
  "message": "Message sent successfully to user.",
  "data": {
    "template_title": "Welcome Message",
    "body": "Hello Rajesh, welcome to our service.",
    "user_phone": "9876543210"
  }
}
❌ Error Responses
{
  "error": 1,
  "message": "FCM Token not found."
}

{
  "error": 2,
  "message": "User not found."
}

{
  "error": 3,
  "message": "Website not found."
}

{
  "error": 4,
  "message": "Template not found."
}

{
  "error": 5,
  "message": "Your plan is Over, Expired Time"
}

{
  "error": 6,
  "message": "Your plan is Over, Message limit exceeded"
}

{
  "error": 7,
  "message": "The data field must be an array."
}
🔖 General Notes
  • API requests must include a valid Authorization header with your vendor API key.
  • All OTPs have an expiry time (default: 5 minutes) unless overridden in template settings.
  • Rate limit: 60 requests/minute per vendor. Excess requests return HTTP 429 Too Many Requests.
  • Error responses include a status, error_code, and message for debugging.
  • Both JSON request body and form-data are supported depending on your client.