Skip to main content

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.0.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

reachflow-0.2.0-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file reachflow-0.2.0.tar.gz.

File metadata

  • Download URL: reachflow-0.2.0.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for reachflow-0.2.0.tar.gz
Algorithm Hash digest
SHA256 3c43ab82b8de266f1ebbe1f2de4588e2dba4ffe983312f5dc373368952943ee4
MD5 b84ee99f27264d4b2484fbe4f38ad45c
BLAKE2b-256 20b19ea909dbbda76d92c72a16d17b06d43a833b324986a81f4a2cf2513a1dd0

See more details on using hashes here.

File details

Details for the file reachflow-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: reachflow-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for reachflow-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ef1827d738b885643aa0bad2ad29a5e7dae9c8774825f75d5b8954df403a6e79
MD5 745b64b20821288a9ffe9f28cf498eef
BLAKE2b-256 f75c20737587e91acd958549b2dda9349e82a6f81c2f08730d4b7f2acc9a66da

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page