Forums

OTP Sending Error

I am using sendchamp to send otp to users during registration in my DRF API. It worked well on local host. But after deploying, it starts returning proxy error. This is the API for the otp service:

url = "https://api.sendchamp.com/api/v1/verification/create"


def send_otp(phone_number, otp):
    payload = {
        "channel": "sms",
        "sender": "Sendchamp",
        "token_type": "numeric",
        "token_length": 4,
        "expiration_time": 5,
        "customer_email_address": "",
        "customer_mobile_number": phone_number,
        "meta_data": {},
        "token": otp
    }

    headers = {
        'Accept': 'application/json',
        'Content-Type': 'application/json',
        'Authorization': 'Bearer sendchamp_live_$2a$10$SPoBf4VaLDbsxwk2JzKqj.Fvy1ALyPECJokxL1WLoMUhY.llUH7FS'
    }


    response = requests.post(url, headers=headers, json=payload)

This is the error I am getting:

HTTPSConnectionPool(host='api.sendchamp.com', port=443): Max retries exceeded with url: /api/v1/verification/create (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden')))

Free accounts have restricted internet access. You may consider upgrading your account or requesting an allowlist addition.