Gateway Reference API

The Rumah Coding Gateway API framework delegates endpoints to control and orchestrate the underlying headless nodes. Organized through standard RESTful methodology utilizing JSON structural inputs, the system ensures programmatic routing of WhatsApp protocol integration cleanly devoid of state complexities.

Authentication Protocol

Endpoint authorization dictates a master API signature inside the header logic. Tokens strictly reside on your private panel infrastructure ensuring the secure linkage of outgoing requests.

// HTTP Headers Required
apikey: YOUR_GLOBAL_TENANT_API_KEY
Content-Type: application/json

Binding Node Instance

Commands the engine container to allocate a fresh UUID session, yielding an executable WebSocket connection ready to transmit authorization frames (QR code).

POST /instance/create
JSON Key Definitions
instanceName Required Unique deterministic node name. Alphabets or underscored permitted.
qrcode Force returns a Base64-formatted QR schema string buffer output for clients to scan. Expected value: true.
// Structure Request Layout { "instanceName": "CS_HQ_NODE1", "token": "CLIENT_ID_SECURE_PHRASE", "qrcode": true }

Dispatching Text Payload

Executes an atomic synchronous send operation targeting a distinct peer-to-peer or multiplex group network.

POST /message/sendText/{instanceName}
JSON Pattern Payload Description and Execution Constraint
number Required Phone address node encoded strictly starting with numeric nation code representing the remote JID sequence (e.g. 6281...). Group broadcasts utilize the @g.us appendage indicator.
options.delay Millisecond timing parameter mitigating API throttling constraints naturally. Generates typing state emulation prior to dispatch.
textMessage.text Required Unicode string variables encompassing the transmission packet. Compatible with WhatsApp specific markdown styling (asterisks, tildes).
// Standard Blast Array Payload Reference Structure { "number": "6281234567890", "options": { "delay": 1200, "presence": "composing" }, "textMessage": { "text": "Greetings from the reliable *B2B Gateway API*! \nThis payload is constructed automatically via Node Integration." } }

Dispatching Media Payload

Mengirim dokumen, gambar, atau PDF melalui instance yang sama dengan payload URL atau base64 sesuai konfigurasi node gateway.

POST /message/sendMedia/{instanceName}
{ "number": "6281234567890", "mediaMessage": { "mediatype": "document", "fileName": "proposal.pdf", "media": "https://example.com/proposal.pdf" } }

Webhook Event Mapping

Webhook delivery mengirim perubahan status instance, pesan masuk, pesan terkirim, dan kegagalan queue ke endpoint tenant yang sudah didaftarkan.

Event Use Case
connection.update Memantau QR, connecting, open, dan close untuk health dashboard.
messages.upsert Menerima pesan inbound dan meneruskannya ke sistem CRM atau support.
send.message.status Menyimpan status sent, failed, dan retry untuk audit campaign.

Untuk dokumentasi endpoint enterprise lengkap, hubungi tim Rumah Coding atau masuk ke workspace Dashboard.