Test the OTP API key and read the app's settings
The reference for the ping address of ArabyBot's OTP API: the app settings the response returns, and the key refusals.
On this page 6
The short answer
With a GET request to the ping address and the public key in the header. The response returns the app's name, the brand name shown in the message, the default language, the code length, its validity and the app's state. It sends nothing and costs nothing, so start with it.
Also asked as: «اختبر مفتاح otp الواتساب» · «test whatsapp otp api key»
The address and authentication
GET https://app.arabybot.com/wa_otp_api/ping
Send the OTP app's public key in the header X-Public-Key: ab_otp_…. You create the app in the OTP section of the dashboard, which gives you the public key and a secret shown once. If you switched request signing on for the app, add the header X-Signature: sha256=…, an HMAC-SHA256 of the raw request body keyed with the app secret.
An example request
cURL
curl https://app.arabybot.com/wa_otp_api/ping \ -H "X-Public-Key: ab_otp_YOUR_PUBLIC_KEY"
PHP
$ch = curl_init('https://app.arabybot.com/wa_otp_api/ping');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['X-Public-Key: ab_otp_YOUR_PUBLIC_KEY'],
]);
$answer = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch); Python
import requests
r = requests.get(
'https://app.arabybot.com/wa_otp_api/ping',
headers={
"X-Public-Key": "ab_otp_YOUR_PUBLIC_KEY",
},
timeout=30,
)
print(r.status_code, r.json()) Node.js
// Node.js 18+
const r = await fetch('https://app.arabybot.com/wa_otp_api/ping', {
headers: {"X-Public-Key": "ab_otp_YOUR_PUBLIC_KEY"},
});
console.log(r.status, await r.json());
The response
200
{ "success": true, "app_name": "My Shop login", "brand_name": "My Shop",
"platform_type": "…", "default_lang": "ar",
"code_length": 6, "expiry_seconds": 300, "status": "…" } code_lengthandexpiry_secondsare the app's settings used when you send no value in the send request.
The refusals
Every refusal comes back as JSON with "success": false, an error_code and a message, plus retry_after in seconds when the cause is a rate limit:
- 401
missing_key / invalid_key: The public key is missing or wrong. - 429: You passed the per-minute request limit.
The limits
This address sends no message and costs nothing, and it has a per-minute request limit.
The OTP API guide · All APIs for developers
Frequently asked questions
Where do I get the public key and the app secret?
Create an OTP app in the OTP section of the ArabyBot dashboard. It gives you a public key starting with ab_otp_ and a secret starting with sk_otp_ that is shown once.
Can I put the public key in the browser?
The public key identifies the app, but the secret must never be put in a browser. The safest course is for every request to leave from your server.
Read next
Try the agent before you pay anything
The agent that will answer your customers is the one answering you now: ask it from the chat button here or on WhatsApp. Your account is free with no credit card, and the free trial on your own number or page is activated after you contact our team on customer-service WhatsApp.