waiaconnect

Documentación / Esencial

Autenticación

GET /v1/connections

Toda llamada a /v1 lleva el header Authorization: Bearer <tu API key>. La key tiene el formato wclive y se crea en el panel (API keys). Se muestra UNA sola vez al crearla — guardala. Si falta o es inválida, la API responde 401 con code APIKEYMISSING (header ausente/malformado, bug de integración) o APIKEYINVALID (key inválida o revocada → rotala en el panel).

# Every /v1 request needs: Authorization: Bearer <your API key>.
# A missing/invalid key → 401 { "error": { "code": "API_KEY_MISSING" | "API_KEY_INVALID" } }
curl https://api.waiaconnect.com/v1/connections \
  -H "Authorization: Bearer wc_live_YOUR_API_KEY"
const res = await fetch("https://api.waiaconnect.com/v1/connections", {
  headers: { "Authorization": "Bearer wc_live_YOUR_API_KEY" }
});
if (res.status === 401) throw new Error("Check/rotate your API key in the panel");
console.log(await res.json()); // { connections: [ { id: "conn_…", … } ] }
<?php
$ch = curl_init("https://api.waiaconnect.com/v1/connections");
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => ["Authorization: Bearer wc_live_YOUR_API_KEY"],
]);
$body = curl_exec($ch);
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($code === 401) { throw new Exception("Check/rotate your API key in the panel"); }
echo $body;
import requests
res = requests.get("https://api.waiaconnect.com/v1/connections",
  headers={"Authorization": "Bearer wc_live_YOUR_API_KEY"})
res.raise_for_status()  # 401 → check/rotate your API key in the panel
print(res.json())  # {"connections": [{"id": "conn_…", ...}]}

El code es el contrato (para tu switch); el message en inglés es ayuda para humanos.

La API key nunca aparece en esta pantalla: está hasheada del lado del servidor. Copiá la tuya desde API keys.