ZapGate icon

ZapGate

Interaja com a API ZapGate — WhatsApp gateway self-hosted

Actions1511

Autenticação → Conectar Sessão

AI-generated

Summary

Interact with the Cerberus backend via HTTP, supporting both RPC and REST endpoints. Use this client to call backend methods, manage resources, and subscribe to real-time events. Handles authentication, timeouts, and structured errors automatically.

Inputs

  • baseUrl (required) — The Cerberus API endpoint URL.
  • apiToken (required) — The API token for authentication.
  • timeoutMs — Timeout in milliseconds for requests.

Output shape

Typically a JSON object; exact fields depend on the endpoint. On error, throws with status and message.

Returns the parsed JSON response from the Cerberus API, including headers and status code in case of error.

Examples

Example 1: A developer wants to call Cerberus JSON-RPC endpoints from a TypeScript frontend, receive typed responses, and subscribe to real-time events while handling disconnects gracefully.

A stable, type-safe API client for the Cerberus system, focused on RPC-style backend calls and clear error handling. It supports event subscription for real-time updates, with reconnection logic and deduplication.

Example 2: An administrator needs to manage Cerberus users and system configurations via HTTP, using API tokens and receiving consistent error messages.

A REST client for the Cerberus backend, exposing endpoints for CRUD operations and administrative tasks, with token-based authentication and standardized error responses.

Links

Discussion