Metadata-Version: 2.4
Name: messaging-api
Version: 1.1.0
Summary: Client for the Messaging API v1 (SMS, WhatsApp, voice, email, Verify). Brand-neutral: pass your provider's API host.
License: MIT
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# Messaging API — Python SDK

Python 3.9+, standard library only.

```python
from messaging_api import Client, verify_webhook, ValidationError
client = Client(os.environ['API_KEY'], 'https://api.your-brand.com')  # your provider's API host

m = client.send({'to': '+573001234567', 'from': 'SHOP', 'text': 'Your order shipped', 'conversion_tracking': True})
client.report_conversion(m['id'], event='purchase', value=49.90, currency='USD')

v = client.start_verification('+573001234567')
client.check_verification(v['id'], code_typed_by_the_user)['result']  # approved | invalid | expired | max_attempts

event = verify_webhook(request.get_data(), request.headers['Webhook-Signature'], os.environ['WEBHOOK_SECRET'])  # raw body

# email (1.1.0)
e = client.send_email('ana@example.com', subject='Your receipt', html='<p>Thanks</p>', idempotency_key='receipt-1001')
client.get_email(e['id'])['events']  # accepted, sent, delivered / bounced, opened, clicked…
```

Any endpoint: `client.request('GET', '/pricing/countries')`. Options: `Client(key, base, max_retries=3, timeout=30.0)`.
Errors: `AuthenticationError` (401), `PermissionError` (403), `NotFoundError` (404), `ValidationError` (400/422),
`RateLimitError` (429), `ApiError` (others: `status`, `code`, `param`, `request_id`), `ConnectionError` (after retries).

**Tests**: `python3 -m unittest discover -s tests`; against a sandbox:
`SDK_BASE_URL=https://… SDK_API_KEY=test_… SDK_SENDER=<approved sender> python3 -m unittest discover -s tests`.
**Install from the tarball**: `pip install messaging_api-1.1.0.tar.gz`.
**Publishing (brand)**: change `name` in pyproject.toml (e.g. `yourbrand-sms`), optionally the package folder, and the
`User-Agent` in `client.py`; then build and upload to PyPI.
