Your Devices
No devices yet
Create a new device to get started
| Device ID | Status | Created | Actions |
|---|---|---|---|
| Active |
|
Scan QR Code
Open WhatsApp on your phone → Linked Devices → Link a Device → Scan this QR
Loading QR code...
Create New Device
Send Text Message
Send Media
Bulk Message Blast
Number Preview
Message Preview
Blast Progress
Results
| # | Phone | Status | Time |
|---|---|---|---|
Auto-Reply Rules
No rules yet
Add keyword-reply rules to auto-respond to incoming messages
Add Auto-Reply Rule
Macam Mana COD OTP Ni Berfungsi?
Sistem ni membolehkan customer verify nombor WhatsApp mereka sebelum confirm order COD. Customer masukkan nombor phone kat website, dapat OTP code via WhatsApp, kemudian masukkan code tu untuk verify.
↓
Website call API /cod-api/request-otp
↓
System hantar 6-digit OTP code ke WhatsApp customer
↓
Customer masukkan OTP code kat website
↓
Website call API /cod-api/verify-otp
↓
Verified! Order confirmed.
Setup (Langkah Demi Langkah)
Pastikan WhatsApp Device Dah Connected
Pergi ke tab Devices kat sidebar. Pastikan ada device yang status connected. Kalau belum, create device baru dan scan QR code.
Set Device ID
Pergi ke tab Configuration di atas. Copy Device ID dari tab Devices, dan paste kat ruangan "WhatsApp Device ID". Klik Save Settings.
Copy API Key
Masih kat tab Configuration, klik Show pada API Key, kemudian Copy. API key ni yang Laravel website akan guna untuk call API.
Setup Laravel App
Pergi ke tab Integration di atas. Copy code untuk .env, CodOtpService.php, dan CodController.php ke Laravel project. Masukkan API key yang dah copy tadi dalam .env.
Test!
Cuba request OTP guna nombor phone sendiri. Check WhatsApp untuk terima OTP code, kemudian verify. Boleh monitor semua activity kat tab Statistics.
Quick Test (curl)
Boleh test terus dari terminal. Ganti YOUR_API_KEY dengan API key sebenar:
Step 1 — Hantar OTP
curl -X POST https://wa.wnabeauty.com/cod-api/request-otp \
-H "Content-Type: application/json" \
-H "X-Api-Key: YOUR_API_KEY" \
-d '{"phone": "0123456789"}'
# Response: { "status": "otp_sent", "token": "abc...", "expiresIn": 300 }
Step 2 — Verify OTP
curl -X POST https://wa.wnabeauty.com/cod-api/verify-otp \
-H "Content-Type: application/json" \
-H "X-Api-Key: YOUR_API_KEY" \
-d '{"token": "TOKEN_DARI_STEP_1", "otp": "123456"}'
# Response: { "status": "verified", "phone": "60123456789" }
Security
Setiap request ke public API perlu header X-Api-Key. Tanpa key, request akan ditolak.
Maximum 3 OTP request per nombor phone per jam (boleh tukar kat Configuration).
Kalau salah OTP 3 kali, session tu locked. Customer kena request OTP baru.
OTP code expire selepas 5 minit. Auto-cleanup setiap 60 saat.
OTP code hanya dihantar ke WhatsApp. API response hanya return session token, bukan OTP.
Activity Log
No activity yet
OTP verification activity will appear here
| Time | Type | Phone | Details |
|---|---|---|---|
API Key
COD Settings
{OTP} as placeholder for the 6-digit codeAPI Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /cod-api/request-otp | Generate and send OTP to phone |
| POST | /cod-api/verify-otp | Verify OTP code |
Request OTP
curl -X POST https://wa.wnabeauty.com/cod-api/request-otp \
-H "Content-Type: application/json" \
-H "X-Api-Key: YOUR_API_KEY" \
-d '{"phone": "0123456789"}'
# Response:
# {
# "status": "otp_sent",
# "token": "abc123...",
# "expiresIn": 300
# }
Verify OTP
curl -X POST https://wa.wnabeauty.com/cod-api/verify-otp \
-H "Content-Type: application/json" \
-H "X-Api-Key: YOUR_API_KEY" \
-d '{"token": "abc123...", "otp": "123456"}'
# Response:
# {
# "status": "verified",
# "phone": "60123456789"
# }
Laravel Integration
Add these to your Laravel project:
.env
COD_OTP_URL=https://wa.wnabeauty.com/cod-api COD_OTP_API_KEY=your_api_key_here
app/Services/CodOtpService.php
<?php
namespace App\Services;
use Illuminate\Support\Facades\Http;
class CodOtpService
{
protected string $baseUrl;
protected string $apiKey;
public function __construct()
{
$this->baseUrl = config('services.cod_otp.url', env('COD_OTP_URL'));
$this->apiKey = config('services.cod_otp.api_key', env('COD_OTP_API_KEY'));
}
public function requestOtp(string $phone): array
{
$response = Http::withHeaders([
'X-Api-Key' => $this->apiKey,
])->post("{$this->baseUrl}/request-otp", [
'phone' => $phone,
]);
return $response->json();
}
public function verifyOtp(string $token, string $otp): array
{
$response = Http::withHeaders([
'X-Api-Key' => $this->apiKey,
])->post("{$this->baseUrl}/verify-otp", [
'token' => $token,
'otp' => $otp,
]);
return $response->json();
}
}
app/Http/Controllers/CodController.php
<?php
namespace App\Http\Controllers;
use App\Services\CodOtpService;
use Illuminate\Http\Request;
class CodController extends Controller
{
public function requestOtp(Request $request, CodOtpService $otp)
{
$request->validate(['phone' => 'required|string']);
$result = $otp->requestOtp($request->phone);
// Store token in session for verification
session(['cod_otp_token' => $result['token'] ?? null]);
return response()->json($result);
}
public function verifyOtp(Request $request, CodOtpService $otp)
{
$request->validate(['otp' => 'required|string']);
$token = session('cod_otp_token');
if (!$token) {
return response()->json(['error' => 'No OTP session'], 400);
}
$result = $otp->verifyOtp($token, $request->otp);
if (($result['status'] ?? '') === 'verified') {
session()->forget('cod_otp_token');
session(['cod_verified' => true, 'cod_phone' => $result['phone']]);
}
return response()->json($result);
}
}