### Send Message via Node.js Source: https://github.com/hidessh99/wahide-api-docs/blob/main/whatspie-style-preview.html Example implementation using the axios library in Node.js. ```javascript const axios = require('axios'); const response = await axios.post('https://api.wahide.com/api/v1/wa/messages/send', { device_id: 'auto', phone: '628123456789', message: 'Hello! Thank you for reaching out to Wahide.', simulate_typing: true, typing_delay_ms: 2500 }, { headers: { 'Authorization': 'Bearer YOUR_API_TOKEN', 'Content-Type': 'application/json' } }); console.log(response.data); ``` -------------------------------- ### Send Message via Go Source: https://github.com/hidessh99/wahide-api-docs/blob/main/whatspie-style-preview.html Example implementation using the standard net/http library in Go. ```go package main import ( "bytes" "fmt" "net/http" ) func main() { url := "https://api.wahide.com/api/v1/wa/messages/send" payload := []byte(`{ "device_id": "auto", "phone": "628123456789", "message": "Hello! Thank you for reaching out to Wahide.", "simulate_typing": true, "typing_delay_ms": 2500 }`) req, _ := http.NewRequest("POST", url, bytes.NewBuffer(payload)) req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, _ := client.Do(req) defer resp.Body.Close() fmt.Println(resp.Status) } ``` -------------------------------- ### Send Message via Python Source: https://github.com/hidessh99/wahide-api-docs/blob/main/whatspie-style-preview.html Example implementation using the requests library in Python. ```python import requests url = "https://api.wahide.com/api/v1/wa/messages/send" headers = { "Authorization": "Bearer YOUR_API_TOKEN", "Content-Type": "application/json" } payload = { "device_id": "auto", "phone": "628123456789", "message": "Hello! Thank you for reaching out to Wahide.", "simulate_typing": True, "typing_delay_ms": 2500 } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` -------------------------------- ### Send Message via cURL Source: https://github.com/hidessh99/wahide-api-docs/blob/main/whatspie-style-preview.html Example command to send a message using cURL. ```bash curl -X POST "https://api.wahide.com/api/v1/wa/messages/send" \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{ "device_id": "auto", "phone": "628123456789", "message": "Hello! Thank you for reaching out to Wahide.", "simulate_typing": true, "typing_delay_ms": 2500 }' ``` -------------------------------- ### Send Message via PHP Source: https://github.com/hidessh99/wahide-api-docs/blob/main/whatspie-style-preview.html Example implementation using PHP's cURL extension. ```php 'https://api.wahide.com/api/v1/wa/messages/send', CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => json_encode([ 'device_id' => 'auto', 'phone' => '628123456789', 'message' => 'Hello! Thank you for reaching out to Wahide.', 'simulate_typing' => true, 'typing_delay_ms' => 2500 ]), CURLOPT_HTTPHEADER => array( 'Authorization: Bearer YOUR_API_TOKEN', 'Content-Type: application/json' ), )); $response = curl_exec($curl); curl_close($curl); echo $response; ``` -------------------------------- ### Authenticate with Bearer Token Source: https://github.com/hidessh99/wahide-api-docs/blob/main/README.md All protected endpoints require a valid Bearer Token or Fast-Path API Key sent via the HTTP Authorization header. API keys typically start with the prefix hide_. ```http Authorization: Bearer YOUR_API_KEY_OR_JWT_TOKEN ``` -------------------------------- ### Interactive Documentation Logic Source: https://github.com/hidessh99/wahide-api-docs/blob/main/scalar-preview.html JavaScript implementation for the interactive documentation page, including snippet management and live test simulation. ```javascript const snippets = { curl: `curl -X POST "https://api.wahide.com/api/v1/wa/messages/send" \\ -H "Authorization: Bearer hide_live_demo123" \\ -H "Content-Type: application/json" \\ -d '{ "device_id": "auto", "phone": "628123456789", "message": "Hello! Thank you for contacting us.", "simulate_typing": true, "typing_delay_ms": 2500 }'`, js: `const response = await fetch('https://api.wahide.com/api/v1/wa/messages/send', { method: 'POST', headers: { 'Authorization': 'Bearer hide_live_demo123', 'Content-Type': 'application/json' }, body: JSON.stringify({ device_id: 'auto', phone: '628123456789', message: 'Hello! Thank you for contacting us.', simulate_typing: true, typing_delay_ms: 2500 }) }); const data = await response.json(); console.log(data);`, go: `package main import ( "bytes" "fmt" "net/http" ) func main() { url := "https://api.wahide.com/api/v1/wa/messages/send" jsonPayload := []byte(\`{ "device_id": "auto", "phone": "628123456789", "message": "Hello! Thank you for contacting us.", "simulate_typing": true, "typing_delay_ms": 2500 }\`) req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonPayload)) req.Header.Set("Authorization", "Bearer hide_live_demo123") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() fmt.Println("Response Status:", resp.Status) }`, python: `import requests url = "https://api.wahide.com/api/v1/wa/messages/send" headers = { "Authorization": "Bearer hide_live_demo123", "Content-Type": "application/json" } payload = { "device_id": "auto", "phone": "628123456789", "message": "Hello! Thank you for contacting us.", "simulate_typing": True, "typing_delay_ms": 2500 } response = requests.post(url, json=payload, headers=headers) print(response.status_code, response.json())` }; function setLang(lang) { ['curl', 'js', 'go', 'python'].forEach(l => { const btn = document.getElementById('btn-' + l); if (l === lang) { btn.className = "text-xs px-2.5 py-1 rounded bg-[#21262d] text-emerald-400 font-medium"; } else { btn.className = "text-xs px-2.5 py-1 rounded text-gray-400 hover:text-white"; } }); document.getElementById('code-snippet').textContent = snippets[lang]; } function copySnippet() { const text = document.getElementById('code-snippet').textContent; navigator.clipboard.writeText(text); const copyText = document.getElementById('copy-text'); copyText.textContent = "Copied!"; setTimeout(() => { copyText.textContent = "Copy"; }, 2000); } function sendLiveTest() { const btn = document.getElementById('btn-send'); const originalText = btn.innerHTML; btn.innerHTML = ` Sending Request...`; btn.disabled = true; setTimeout(() => { btn.innerHTML = originalText; btn.disabled = false; document.getElementById('live-response').classList.remove('hidden'); }, 700); } ``` -------------------------------- ### Implement Spintax and Typing Simulation Source: https://github.com/hidessh99/wahide-api-docs/blob/main/README.md Use spintax for message randomization and enable simulate_typing to mimic human behavior. Setting typing_delay_ms to 0 triggers automatic delay calculation based on text length. ```json { "device_id": "auto", "phone": "628123456789", "message": "{Hello|Hi|Good day}! {Thank you for contacting us|We are glad to assist you}! Your order is being {processed|prepared}.", "parse_spintax": true, "simulate_typing": true, "typing_delay_ms": 0 } ``` -------------------------------- ### Live Test Response Source: https://github.com/hidessh99/wahide-api-docs/blob/main/scalar-preview.html The JSON response received after executing a real-time request in the interactive sandbox. ```json { "messaging_product": "whatsapp", "contacts": [ { "input": "628123456789", "wa_id": "628123456789" } ], "messages": [ { "id": "3EB09F8182D2E49B" } ] } ``` -------------------------------- ### POST /send-message Source: https://github.com/hidessh99/wahide-api-docs/blob/main/scalar-preview.html Dispatches a real-time WhatsApp message to a specified recipient with optional configuration for typing simulation and device selection. ```APIDOC ## POST /send-message ### Description Dispatches a real-time WhatsApp message, OTP, or Media attachment with optional Anti-Ban typing simulation, Spintax variation, and smart multi-device round-robin pooling. ### Method POST ### Endpoint /send-message ### Parameters #### Request Body - **phone** (string) - Required - Recipient customer phone number in international format (e.g. 628123456789). Min length: 8, Max length: 20. - **message** (string) - Required - The message text body. Supports Spintax syntax if parse_spintax is enabled. - **device_id** (string) - Optional - Specific WhatsApp device slot. Defaults to "auto". - **simulate_typing** (boolean) - Optional - When enabled, simulates a realistic "typing..." indicator. Defaults to false. - **typing_delay_ms** (integer) - Optional - Duration in ms for typing simulation. Defaults to 0. ### Request Example { "phone": "628123456789", "message": "Hello, this is a test message", "device_id": "auto", "simulate_typing": true, "typing_delay_ms": 2000 } ``` -------------------------------- ### Configure Multi-Device Auto-Rotation Source: https://github.com/hidessh99/wahide-api-docs/blob/main/README.md Set device_id to "auto" to distribute outbound messages across multiple connected devices. Requires at least 2 connected devices for round-robin load distribution. ```json { "device_id": "auto", "phone": "628123456789", "message": "Hello! Thank you for reaching out to us." } ``` -------------------------------- ### POST /api/v1/wa/messages/send Source: https://github.com/hidessh99/wahide-api-docs/blob/main/scalar-preview.html Sends an instant message through the WhatsApp gateway. ```APIDOC ## POST /api/v1/wa/messages/send ### Description Sends an instant message using the configured WhatsApp gateway. ### Method POST ### Endpoint /api/v1/wa/messages/send ``` -------------------------------- ### POST /api/v1/v18.0/{{deviceId}}/messages Source: https://github.com/hidessh99/wahide-api-docs/blob/main/README.md Sends a WhatsApp message using the Meta Graph API v18.0 compatible format. ```APIDOC ## POST /api/v1/v18.0/{{deviceId}}/messages ### Description Drop-in replacement endpoint for Meta Graph API integration to send WhatsApp messages. ### Method POST ### Endpoint /api/v1/v18.0/{{deviceId}}/messages ### Request Body - **messaging_product** (string) - Required - Must be "whatsapp" - **recipient_type** (string) - Required - Must be "individual" - **to** (string) - Required - Recipient phone number - **type** (string) - Required - Must be "text" - **text** (object) - Required - Contains the message body and preview settings ### Request Example { "messaging_product": "whatsapp", "recipient_type": "individual", "to": "628123456789", "type": "text", "text": { "preview_url": false, "body": "Hello! Sent via Meta Cloud API compatible gateway." } } ``` -------------------------------- ### Error Response (400 Bad Request) Source: https://github.com/hidessh99/wahide-api-docs/blob/main/whatspie-style-preview.html The structure returned when a request fails, such as missing required parameters. ```json { "error": { "message": "(#100) Invalid parameter: field 'to' or 'phone' is required", "type": "WhatsAppAPIException", "code": 100, "error_data": { "messaging_product": "whatsapp", "details": "field 'to' or 'phone' is required" }, "fbtrace_id": "c546ff5f19e2341be0fd03d15f2daf3e" } } ``` -------------------------------- ### POST /api/v1/wa/messages/send Source: https://github.com/hidessh99/wahide-api-docs/blob/main/whatspie-style-preview.html Sends a WhatsApp message to a specified phone number using the Wahide API. ```APIDOC ## POST /api/v1/wa/messages/send ### Description Sends a WhatsApp message to a recipient. Supports optional typing simulation features. ### Method POST ### Endpoint https://api.wahide.com/api/v1/wa/messages/send ### Request Body - **device_id** (string) - Required - The device identifier to use for sending. - **phone** (string) - Required - The recipient's phone number. - **message** (string) - Required - The text content of the message. - **simulate_typing** (boolean) - Optional - Whether to simulate typing before sending. - **typing_delay_ms** (integer) - Optional - Delay in milliseconds for typing simulation. ### Request Example { "device_id": "auto", "phone": "628123456789", "message": "Hello! Thank you for reaching out to Wahide.", "simulate_typing": true, "typing_delay_ms": 2500 } ### Response #### Success Response (200) - **messaging_product** (string) - Always returns "whatsapp". - **contacts[].wa_id** (string) - WhatsApp verified identity phone number of recipient. - **messages[].id** (string) - Unique WhatsApp message ID. #### Response Example { "messaging_product": "whatsapp", "contacts": [ { "input": "628123456789", "wa_id": "628123456789" } ], "messages": [ { "id": "3EB0A1B2C3D4E5F6" } ] } ``` -------------------------------- ### POST /api/v1/wa/messages/send Source: https://github.com/hidessh99/wahide-api-docs/blob/main/scalar-preview.html Sends a WhatsApp message to a specified phone number. ```APIDOC ## POST /api/v1/wa/messages/send ### Description Sends a WhatsApp message to a target phone number. Supports optional typing simulation. ### Method POST ### Endpoint https://api.wahide.com/api/v1/wa/messages/send ### Request Body - **device_id** (string) - Required - The ID of the device to use (e.g., "auto") - **phone** (string) - Required - The recipient's phone number - **message** (string) - Required - The message content - **simulate_typing** (boolean) - Optional - Whether to simulate typing - **typing_delay_ms** (integer) - Optional - Delay in milliseconds for typing simulation ### Request Example { "device_id": "auto", "phone": "628123456789", "message": "Hello! Thank you for contacting us.", "simulate_typing": true, "typing_delay_ms": 2500 } ### Response #### Success Response (200) - **messaging_product** (string) - The messaging product name - **contacts** (array) - List of contact objects - **messages** (array) - List of message objects containing the ID #### Response Example { "messaging_product": "whatsapp", "contacts": [ { "input": "628123456789", "wa_id": "628123456789" } ], "messages": [ { "id": "3EB0A1B2C3D4E5F6" } ] } ``` -------------------------------- ### Meta WhatsApp Cloud API v18.0 Request Source: https://github.com/hidessh99/wahide-api-docs/blob/main/README.md Use this endpoint as a drop-in replacement for Meta Graph API integrations. Ensure the Authorization header contains your valid bearer token. ```http POST {{baseUrl}}/api/v1/v18.0/{{deviceId}}/messages Content-Type: application/json Authorization: Bearer {{token}} { "messaging_product": "whatsapp", "recipient_type": "individual", "to": "628123456789", "type": "text", "text": { "preview_url": false, "body": "Hello! Sent via Meta Cloud API compatible gateway." } } ``` -------------------------------- ### Send WhatsApp Message cURL Request Source: https://github.com/hidessh99/wahide-api-docs/blob/main/scalar-preview.html A cURL command to send a WhatsApp message using the /api/v1/wa/messages/send endpoint. ```bash curl -X POST "https://api.wahide.com/api/v1/wa/messages/send" \ -H "Authorization: Bearer hide_live_demo123" \ -H "Content-Type: application/json" \ -d '{ "device_id": "auto", "phone": "628123456789", "message": "Hello! Thank you for contacting us.", "simulate_typing": true, "typing_delay_ms": 2500 }' ``` -------------------------------- ### WhatsApp Message Response Structure Source: https://github.com/hidessh99/wahide-api-docs/blob/main/scalar-preview.html The standard JSON response returned by the API upon a successful message request. ```json { "messaging_product": "whatsapp", "contacts": [ { "input": "628123456789", "wa_id": "628123456789" } ], "messages": [ { "id": "3EB0A1B2C3D4E5F6" } ] } ``` -------------------------------- ### POST https://api.wahide.com/api/v1/wa/messages/send Source: https://github.com/hidessh99/wahide-api-docs/blob/main/whatspie-style-preview.html Send rich text messages to WhatsApp contacts using the Wahide REST API with advanced enterprise features. ```APIDOC ## POST https://api.wahide.com/api/v1/wa/messages/send ### Description Send rich text messages to WhatsApp contacts using the Wahide REST API with advanced enterprise features like human typing simulation, message template Spintax, and automatic multi-device round-robin balancing. ### Method POST ### Endpoint https://api.wahide.com/api/v1/wa/messages/send ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.