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
¿Este número ya me escribió? (opt-in para WhatsApp Direct)
Para no enviar por WhatsApp Direct a números que nunca abrieron conversación (el patrón que hace que Meta restrinja la cuenta), pedile a la persona que escriba primero y verificalo antes de habilitarla:
sender = client.get_inbound_sender("+5493411234567")
if sender.has_written:
print(sender.first_inbound_at, sender.inbound_count)
# Batch (máx 200 números por request)
senders = client.lookup_inbound_senders(["+5493411234567", "+5491155551234"])
El dato sobrevive a la retención de mensajes y está disponible en todos los
planes. "Nunca escribió" devuelve has_written=False (no lanza).
Listar mensajes entrantes (plan Pro)
page = client.list_inbound_messages(from_phone="+5493411234567")
for m in page.inbound_messages:
print(m.received_at, m.text)
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
Metadata
Release files for arplyx 0.3.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 | |
|---|---|---|---|---|
| arplyx-0.3.0.tar.gz | 10.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| arplyx-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.9 kB
Release files / arplyx-0.3.0.tar.gz
| Download URL | arplyx-0.3.0.tar.gz |
|---|---|
| Size | 10.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7eff636923ebb83f964098d37228ae6aff40cf6ad4278a4206a4861b2b0558c5
|
|
BLAKE2b-256 checksum How to use checksums |
0fdc7cdd28783fd94be78e345fee9240b7342900552bcbfac2e906983d444e86
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|
Release files / arplyx-0.3.0-py3-none-any.whl
| Download URL | arplyx-0.3.0-py3-none-any.whl |
|---|---|
| Size | 10.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9e50ef272a6cf3292eda88aee4af0da65c766dfd03276a8709f2aa6d60dd152f
|
|
BLAKE2b-256 checksum How to use checksums |
e1bf882c3b963e2d1ae299bcb0364c5dd074dedf21cd685623cdd7a38a7de6e5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|
Security for arplyx 0.3.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.