API Sənədləşdirməsi
WhatsOTP API ilə inteqrasiya edin
Baza URL
https://whatsotp.az/apiDoğrulama
All API requests require the 'secret' parameter.
?secret=YOUR_API_SECRETNü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/creditsGET
/get/subscriptionOTP
POST
/send/otpGET
/get/otpSMS
POST
/send/smsPOST
/send/sms.bulkPOST
/send/whatsappGET
/get/wa.accountsContacts
POST
/create/contactGET
/get/contacts