API Sənədləşdirməsi

WhatsOTP API ilə inteqrasiya edin

Baza URL
https://whatsotp.az/api
Doğrulama

All API requests require the 'secret' parameter.

?secret=YOUR_API_SECRET
Nümunə Code
// WhatsOTP API - JavaScript Example
const API_SECRET = 'YOUR_API_SECRET';
const BASE_URL = 'https://whatsotp.az/api';

// Send OTP
async function sendOTP(phone, message) {
  const formData = new FormData();
  formData.append('secret', API_SECRET);
  formData.append('type', 'whatsapp');
  formData.append('phone', phone);
  formData.append('message', message);

  const response = await fetch(`${BASE_URL}/send/otp`, {
    method: 'POST',
    body: formData
  });

  return response.json();
}

// Verify OTP
async function verifyOTP(otp) {
  const response = await fetch(
    `${BASE_URL}/get/otp?secret=${API_SECRET}&otp=${otp}`
  );
  return response.json();
}

// Usage
sendOTP('+994501234567', 'Your OTP is: {{otp}}')
  .then(result => console.log(result));

Account

GET/get/credits
GET/get/subscription

OTP

POST/send/otp
GET/get/otp

SMS

POST/send/sms
POST/send/sms.bulk

WhatsApp

POST/send/whatsapp
GET/get/wa.accounts

Contacts

POST/create/contact
GET/get/contacts