Airbox Python SDK
WhatsApp and Instagram messages through one REST API, from Python.
Early release (0.1.0): sending and reading messages. Media, templates, consent and channels come next.
Install
pip install airboxhq
Python 3.9 or newer. No dependencies.
Send a message
import os
from airboxhq import Airbox
client = Airbox(api_key=os.environ["WHATSAPP_API_KEY"])
data = client.messages.send(
to="+77011234567",
channel="whatsapp",
type="text",
text={"body": "Your order is ready"},
idempotency_key="order-1042",
)
print(data)
A test key sends to the simulator, so you can try every call before connecting a number.
Read a message back
message = client.messages.get(data["id"])
print(message["status"])
With asyncio
import asyncio
import os
from airboxhq import AsyncAirbox
async def main():
async with AsyncAirbox(api_key=os.environ["WHATSAPP_API_KEY"]) as client:
data = await client.messages.send(to="+77011234567", channel="whatsapp", type="text", text={"body": "Hi"})
print(data)
asyncio.run(main())
Errors
A refused request raises airboxhq.AirboxError with the API's own code and the request id:
from airboxhq import AirboxError
try:
client.messages.send(to="+77011234567", channel="whatsapp", type="text", text={"body": "Hi"})
except AirboxError as error:
print(error.code, error.request_id)
License
MIT
Metadata
Release files for airboxhq 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| airboxhq-0.1.0.tar.gz | 3.8 kB | Without provenance | Details for airboxhq-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| airboxhq-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for airboxhq-0.1.0-py3-none-any.whl |
Total release size: 8.6 kB
Release files / airboxhq-0.1.0.tar.gz
| Download URL | airboxhq-0.1.0.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ea2c281f473097b323c776df68674270ac153b217e4b9e4564cdf0ee2365157e
|
|
BLAKE2b-256 checksum How to use checksums |
dc5a5349622c1db54028410528f9b9d509deed5f4c572c2d759bc5bc2bc0eb9a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.3
|
Release files / airboxhq-0.1.0-py3-none-any.whl
| Download URL | airboxhq-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2308f8639e6487b7ac64b981c5dcd30dc9d8b12def47f45fe462096506e265d1
|
|
BLAKE2b-256 checksum How to use checksums |
11e29d7a14ee2bf12517e330c0f63a5b04cb5509d0af8037e3805065dc7370ae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.3
|
Security for airboxhq 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.