Send OTP/PIN by SMS Code Examples

Telecom
POST /api/v1/aws/send_otp-pin Bearer

Ready-to-run Send OTP/PIN by SMS calls. Replace YOUR_API_KEY with the key from your dashboard.

Send OTP/PIN by SMS — Code Samples

cURL
PHP
Fetch
jQuery
Axios
Python
curl -X POST https://app.way2api.com/api/v1/aws/send_otp-pin \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"value":"5289","number":"919876543210","content":"OTP","purpose":"login","share_with":"no_one"}'

Expected Response — 200

{
    "status": "SUCCESS",
    "status_code": 200,
    "charged": true,
    "success": true,
    "message": "",
    "message_code": "OK",
    "order_id": "W2A1739512345abcdef01",
    "data": {
        "order_id": "W2A1739512345abcdef01",
        "result": {
            "phone": "+919876543210",
            "content_type": "OTP",
            "purpose": "login",
            "share_with": "no_one",
            "sms_status": "sent"
        }
    }
}