SDK oficial de Arplyx: enviá mensajes y broadcasts de WhatsApp desde Python.
Project description
arplyx (Python SDK)
SDK oficial de Arplyx para Python: enviá mensajes y broadcasts de WhatsApp y consultá estados con una API tipada.
Instalación
pip install arplyx
Requiere Python 3.8+.
Uso
from arplyx import Arplyx, ArplyxError
client = Arplyx(api_key="ak_live_...")
# Enviar un texto
msg = client.send_message(
external_id="pedido-10045",
to="+5491155551234",
text="Tu pedido fue confirmado.",
channel="whatsapp_direct",
whatsapp_account_id="TU_ACCOUNT_ID",
)
print(msg.message_id, msg.status)
# Consultar estado (por message_id o por tu external_id)
status = client.get_message("pedido-10045")
print(status.status) # pending | queued | sent | delivered | read | failed
Plantillas (Meta Official)
client.send_message(
external_id="pedido-10045",
to="+5491155551234",
channel="whatsapp_meta",
template={"name": "pedido_confirmado", "language": "es_AR", "body": ["Juan", "10045"]},
)
Broadcast a una lista (planes Basic/Pro)
client.send_broadcast(
external_id="promo-junio-2026",
list_id="TU_LIST_ID",
text="Este mes 2x1 en turnos.",
channel="whatsapp_direct",
whatsapp_account_id="TU_ACCOUNT_ID",
)
Listar cuentas de WhatsApp
for acc in client.list_whatsapp_accounts():
print(acc.id, acc.type, acc.status) # acc.id se usa como whatsapp_account_id
Manejo de errores
try:
client.send_message(external_id="x", to="+549...", text="hola")
except ArplyxError as e:
print(e.status) # 400, 401, 409, 422, 429, 500...
print(e.code) # 'validation_error', 'conflict', 'quota_exceeded'...
print(e.details) # detalles por campo si es validation_error
Idempotencia
Todos los envíos usan tu external_id como clave de idempotencia: reintentar con el mismo external_id y payload no duplica el envío. Es seguro reintentar ante timeouts.
Configuración
| Parámetro | Requerido | Default |
|---|---|---|
api_key |
Sí | — |
base_url |
No | https://api.arplyx.com |
timeout |
No | 10.0 |
session |
No | requests.Session() nueva |
Docs de la API: https://docs.arplyx.com/api/ · OpenAPI: https://api.arplyx.com/openapi.yaml
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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
File details
Details for the file arplyx-0.2.0.tar.gz.
File metadata
- Download URL: arplyx-0.2.0.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0d22d641a6ef912d36c17b70dd7807d8cf4c40acb7b8d80315db58050ca5fc13
|
|
| MD5 |
3532128e4a89602e38d3f4a3675dd76d
|
|
| BLAKE2b-256 |
3731392a1eff15f103e6c0d71eed1849fbb9fe6cf0be3afe113ff73e9daf27cf
|
File details
Details for the file arplyx-0.2.0-py3-none-any.whl.
File metadata
- Download URL: arplyx-0.2.0-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
572dbead69b5482c218e554ece5952ddafdef95258fe3ee68cc7ff362382f311
|
|
| MD5 |
a28ea9f6406d3db4ec71f220c61e101d
|
|
| BLAKE2b-256 |
19bcca1fb1176d3e1ba77dcfb346d4ee7256e4dc36d2ffb83982c5e9ce754978
|