Skip to main content

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
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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

arplyx-0.1.0.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

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

arplyx-0.1.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file arplyx-0.1.0.tar.gz.

File metadata

  • Download URL: arplyx-0.1.0.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for arplyx-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d04a38ac6d869d65d3368583216074cacd8794036346a79b458d1d13a56a5730
MD5 71571b54d70b4979fc8cd0085ce09493
BLAKE2b-256 ad3f07850df8cf43350881415e1aff865c2ac0c71f39956e81774fcb525be0b0

See more details on using hashes here.

File details

Details for the file arplyx-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: arplyx-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for arplyx-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 575d6be2a15f18ab09578092af28cecb51cd8aeb9c27ef3609131af7d868ccf7
MD5 1511f6c44a02fd1944b4def62e3bc969
BLAKE2b-256 d6f5c6cd9594f7cec7ce0518b08baff30ba07054514518cd477c9abf629855a3

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