# Send SMS with Python | VeloBotix

> Python requests example for VeloBotix SEND_SINGLE with Basic Auth.

Source: https://www.velobotix.app/docs/python

Languages

# Python

## Prerequisites

Python 3 with the requests package (pip install requests). Portal email, API key, and approved senderID.

## Authentication

Pass auth=(email, api\_key) to requests.post.

## SEND\_SINGLE example

Equivalent to the documented curl POST:

```
import requests

email = 'YOUR_EMAIL'
api_key = 'YOUR_API_KEY'
url = 'https://portal.velobotix.app/api.php?FUN=SEND_SINGLE'

r = requests.post(
    url,
    auth=(email, api_key),
    headers={'Content-Type': 'application/json'},
    json={
        'senderID': 'VeloBotix',
        'to': '0701234567',
        'msg': 'Your OTP is 483920. Valid for 5 minutes.',
    },
    timeout=30,
)
print(r.status_code, r.text)
```

## Common mistakes

Using data= instead of json= and forgetting Content-Type.

Hard-coding secrets in notebooks that get shared.

Not checking r.status\_code before parsing the body.

## Create account

Sign up in the portal and get your API key — username is your email, password is the key.

[Open portal — get API key](https://portal.velobotix.app)
