Official Python client for the ReachFlow public REST API (WhatsApp, OTP)
Project description
reachflow
Official Python client for the ReachFlow public API (REST v1).
Installation
pip install reachflow
Requirements: Python ≥ 3.10.
Configuration
from reachflow import ReachFlow
client = ReachFlow(
api_key="rfl_live_…", # or rfl_test_…
environment="sandbox", # or "live" — default: "sandbox"
timeout_ms=30_000,
max_retries=2,
)
environment |
API host |
|---|---|
sandbox (default) |
sandbox-api.reachflow.me |
live |
api.reachflow.me |
Use a context manager to close the HTTP connection:
with ReachFlow(api_key="rfl_live_…") as client:
...
Examples
Send a message
with ReachFlow(api_key="rfl_live_…") as client:
result = client.messages.send(
provider_id="your-provider-uuid",
to="22996123456",
message="Your order is confirmed.",
)
status = client.messages.wait_for_terminal(result["messageId"])
print(status["status"])
OTP
with ReachFlow(api_key="rfl_live_…") as client:
sent = client.otp.send(
provider_id="your-provider-uuid",
phone_number="22996123456",
brand_name="My App",
)
# Code is delivered on WhatsApp only — never in the JSON response.
verified = client.otp.verify(otp_id=sent["otpId"], code="482910")
print(verified["valid"])
Async client
from reachflow import AsyncReachFlow
async with AsyncReachFlow(api_key="rfl_live_…") as client:
providers = await client.providers.list()
Error handling
from reachflow import ReachFlow, ReachFlowError
try:
client.messages.send(...)
except ReachFlowError as err:
print(err.status_code, err.code, err.message)
if err.retryable:
...
Idempotency
client.messages.send(
provider_id=provider_id,
to=to,
message=message,
idempotency_key="order-12345",
)
Development
pip install -e ".[dev]"
pytest
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
reachflow-0.2.1.tar.gz
(9.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
reachflow-0.2.1-py3-none-any.whl
(12.0 kB
view details)
File details
Details for the file reachflow-0.2.1.tar.gz.
File metadata
- Download URL: reachflow-0.2.1.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5bc8d5bcc6fa58b8b2e8bcbdd09a0df3f587ee908f607dbe920eecfb89cdbb44
|
|
| MD5 |
5be303bd553cc32a73dd01a8f85fe9f9
|
|
| BLAKE2b-256 |
dcbd457ca640c46b441fe69dc199837211a9d3f225a7503a544e56141b6fc555
|
File details
Details for the file reachflow-0.2.1-py3-none-any.whl.
File metadata
- Download URL: reachflow-0.2.1-py3-none-any.whl
- Upload date:
- Size: 12.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
81ddbfdeaf233f311d839e2a782ea5dabfd03a007d13a01bd380237361b7bead
|
|
| MD5 |
1e8653b65b417760bf3d25ea8137f9a9
|
|
| BLAKE2b-256 |
c11002d5ed4e44732e2a91179aa64fb13c4e2cd9a8656f9118b9b369685b37d8
|