### Example API Endpoint URLs Source: https://docs.whatsloop.net/docs/versioning Examples of how to append endpoint paths to the base URL for different HTTP methods and parameters. ```text POST https://api.whatsloop.net/v1/messages/send-text GET https://api.whatsloop.net/v1/messages/list?channel_id=1 GET https://api.whatsloop.net/v1/instance/account-health?channel_id=1 ``` -------------------------------- ### Get Order Details using JavaScript Source: https://docs.whatsloop.net/docs/catalog This JavaScript example shows how to make a GET request to retrieve order details. It uses the fetch API. Remember to substitute your specific token and order ID. The token_base64 parameter is mandatory and sourced from the incoming webhook. ```javascript const orderId = "ORDER_ID"; const token = "wl_YOUR_TOKEN"; const channelId = 1; const tokenBase64 = "TOKEN_FROM_WEBHOOK"; const headers = { "Authorization": `Bearer ${token}`, "Content-Type": "application/json" }; const data = { "channel_id": channelId, "token_base64": tokenBase64 }; fetch(`https://api.whatsloop.net/v1/catalog/orders/${orderId}`, { method: "GET", headers: headers, body: JSON.stringify(data) }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); ``` -------------------------------- ### Account Info Response Example Source: https://docs.whatsloop.net/docs/sessions This is an example of a successful response when retrieving account information. It includes the WhatsApp JID, phone number, display name, and platform. ```json { "success": true, "message": "Account info retrieved", "data": { "jid": "966500000001@s.whatsapp.net", "phone": "966500000001", "name": "My Store", "platform": "smba" } } ``` -------------------------------- ### HTTP Request Example Source: https://docs.whatsloop.net/docs/webhooks An example of an incoming HTTP POST request to a webhook endpoint, including the necessary headers like X-Webhook-Signature. ```http POST /your/webhook/endpoint HTTP/1.1 Host: your-server.com Content-Type: application/json User-Agent: WhatsLoop-Webhook/2.0 X-Webhook-Signature: sha256=6f3b...c19a {"event":"MessageUpsert","sessionId":"sess_01H8XYZ", ... } ``` -------------------------------- ### Instance - Get Info Source: https://docs.whatsloop.net/docs/api-reference Retrieves information about the instance. ```APIDOC ## GET /instance ### Description Retrieves information about the WhatsLoop instance. ### Method GET ### Endpoint /instance ### Response #### Success Response (200) - **instance_id** (string) - The ID of the instance. - **name** (string) - The name of the instance. - **status** (string) - The status of the instance. ``` -------------------------------- ### Settings - Get General Source: https://docs.whatsloop.net/docs/api-reference Retrieves general settings. ```APIDOC ## GET /settings ### Description Retrieves the general settings. ### Method GET ### Endpoint /settings ### Response #### Success Response (200) - **settings** (object) - An object containing various general settings. ``` -------------------------------- ### Example Catalog Product Response Source: https://docs.whatsloop.net/docs/catalog This is an example of a successful response when listing products from the catalog. Product IDs in the response are used for updating and deleting products. ```json { "success": true, "message": "Catalog retrieved", "data": { "products": [ { "id": "7213456789012345", "name": "Ethiopian Coffee 250g", "price": 4500, "currency": "SAR", "availability": "in stock" } ] } } ``` -------------------------------- ### List Messages Response Example Source: https://docs.whatsloop.net/docs/api-reference/message-management Example of a successful response when listing messages. Includes items, next cursor for pagination, and a flag indicating if more items are available. ```JSON { "success": true, "message": "Messages retrieved", "data": { "items": "string", "next_cursor": "string", "has_more": true } } ``` -------------------------------- ### Check Phone Response Example Source: https://docs.whatsloop.net/docs/contacts This is an example of a successful response from the check-phone endpoint. It indicates if the number exists on WhatsApp and provides the corresponding JID. ```json { "success": true, "message": "Number verified", "data": { "exists": true, "jid": "966500000000@s.whatsapp.net" } } ``` -------------------------------- ### Send Reaction Response (Error Example) Source: https://docs.whatsloop.net/docs/api-reference/reactions-and-forwarding This is an example of a generic error response for sending a reaction. It indicates a failure with null data. ```JSON { "success": true, "message": null, "data": null, "code": null } ``` -------------------------------- ### Message Not Found Response Example Source: https://docs.whatsloop.net/docs/api-reference/message-management Example of a response when the requested message is not found. The message field is in Arabic. ```JSON { "success": true, "message": "الرسالة غير موجودة", "data": [ "string" ] } ``` -------------------------------- ### Message Status Response Example Source: https://docs.whatsloop.net/docs/api-reference/message-management Example of a successful response when retrieving message status. Includes message ID, engine ID, direction, status, and timestamps. ```JSON { "success": true, "message": "Message status retrieved", "data": { "id": "string", "engine_id": "string", "direction": "string", "status": "string", "sent_at": "string", "delivered_at": "string", "read_at": "string", "updated_at": "string" } } ``` -------------------------------- ### Successful Response Example Source: https://docs.whatsloop.net/docs/messages/interactive/send-template Example of a successful HTTP 200 OK response when sending a template message. It includes a message ID, status, and timestamp. ```json { "success": true, "message": "Template message sent", "data": { "message_id": "3EB0XXXXXXXXXXXXXXXX", "status": "sent", "timestamp": "2026-07-02T09:15:22Z", "to": "9665XXXXXXXX@s.whatsapp.net", "chat_id": "9665XXXXXXXX@s.whatsapp.net" } } ``` -------------------------------- ### Response Example for Adding Label Source: https://docs.whatsloop.net/docs/api-reference/labels This is a successful response example when a label is added to a message. It confirms the operation's success and provides a data field, which may contain a string. ```json { "success": true, "message": "Label added to message", "data": "string" } ``` -------------------------------- ### Successful Response Example Source: https://docs.whatsloop.net/docs/messages/interactive/send-native-flow This is an example of a successful HTTP 200 OK response when sending a native-flow message. It includes standard fields like message_id and status. ```json { "success": true, "message": "Interactive form sent", "data": { "message_id": "3EB0XXXXXXXXXXXXXXXX", "status": "sent", "timestamp": "2026-07-02T09:15:22Z", "to": "9665XXXXXXXX@s.whatsapp.net", "chat_id": "9665XXXXXXXX@s.whatsapp.net" } } ``` -------------------------------- ### Response for Business Profile Update (Success) Source: https://docs.whatsloop.net/docs/api-reference/instance Example of a successful response after updating the business profile. ```json { "success": true, "message": "Business profile updated", "data": "string" } ``` -------------------------------- ### API Response Example (Success) Source: https://docs.whatsloop.net/docs/api-reference/contact-and-location This is a sample success response for sending contacts or location. It indicates that the operation was successful. ```json { "success": true, "message": "Contact cards sent", "data": "string" } ``` ```json { "success": true, "message": "Location sent", "data": "string" } ``` -------------------------------- ### Example Button Array Shape Source: https://docs.whatsloop.net/docs/messages/interactive/send-buttons Defines the structure for the 'buttons' array, specifying 'id' and 'text' for each button. ```json "buttons": [ { "id": "yes", "text": "Yes, confirm" }, { "id": "no", "text": "No, cancel" }, { "id": "later", "text": "Ask me later" } ] ``` -------------------------------- ### Get Account Health using JavaScript Source: https://docs.whatsloop.net/docs/sessions This JavaScript example shows how to make an API call to get account health. It uses the 'fetch' API and requires your API token. ```javascript const url = "https://api.whatsloop.net/v1/instance/account-health?channel_id=1"; const token = "wl_YOUR_TOKEN"; fetch(url, { method: "GET", headers: { "Authorization": `Bearer ${token}` } }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); ``` -------------------------------- ### Instance - Create Source: https://docs.whatsloop.net/docs/api-reference Creates a new instance. ```APIDOC ## POST /instance ### Description Creates a new WhatsLoop instance. ### Method POST ### Endpoint /instance ### Request Body - **name** (string) - Required - The name for the new instance. ### Response #### Success Response (200) - **instance_id** (string) - The ID of the created instance. - **status** (string) - The status of the creation. ``` -------------------------------- ### Get Failed Webhook Count Success Response Source: https://docs.whatsloop.net/docs/api-reference/webhooks Example of a successful response when retrieving the count of failed webhooks. ```json { "success": true, "message": "Failed webhook count retrieved", "data": "string" } ``` -------------------------------- ### Bulk Batch Status Response (200 OK) Source: https://docs.whatsloop.net/docs/api-reference/bulk-messages Example response for a successful retrieval of bulk batch status. ```json { "success": true, "message": "Batch status retrieved", "data": { "batch_id": "string", "channel_id": "string", "type": "string", "status": "string", "total": 1, "sent": 1, "delivered": 1, "read": 1, "failed": 1, "pending": {}, "created_at": "string", "updated_at": "string" } } ``` -------------------------------- ### Create a product Source: https://docs.whatsloop.net/docs/api-reference/catalog Add a new product to the WhatsApp Business catalog. The price is required by the engine (set to 0 for free products). ```APIDOC ## Create a product ### Description Add a new product to the WhatsApp Business catalog. price is required by the engine (set to 0 for free products). ### Method POST ### Endpoint https://api.whatsloop.net/v1/catalog/products ### Parameters #### Request Body - **channel_id** (integer) - Required - **name** (string) - Required - **description** (string | null) - Optional - **price** (integer) - Required - **currency** (string | null) - Optional - **image_url** (string | null) - Optional - **images** (array | null) - Optional ### Request Example ```json { "channel_id": 1, "name": "string", "description": "string", "price": 1, "currency": "string", "image_url": "https://docs.whatsloop.net/app/docs-samples/whatsloop-welcome.jpg", "images": [ "https://docs.whatsloop.net/app/docs-samples/whatsloop-welcome.jpg" ] } ``` ### Response #### Success Response (200) - **success** (boolean) - **message** (string) - **data** (string) #### Response Example ```json { "success": true, "message": "Product created", "data": "string" } ``` ``` -------------------------------- ### Get WhatsApp Business Profile using JavaScript Source: https://docs.whatsloop.net/docs/contacts This JavaScript example retrieves a business profile using the Fetch API. It encodes the JID and sets the channel ID as a URL search parameter. ```javascript const jid = encodeURIComponent("966500000000@s.whatsapp.net") const url = new URL(`undefined/users/${jid}/business`) url.searchParams.set("channel_id", "1") const res = await fetch(url, { headers: { Authorization: "Bearer wl_YOUR_TOKEN" }, }) console.log((await res.json()).data) ``` -------------------------------- ### Read Contact About Text with JavaScript Source: https://docs.whatsloop.net/docs/contacts This JavaScript example demonstrates how to use the fetch API to get a contact's About text. It sends a POST request with necessary headers and JSON body, then logs the status from the response. ```javascript const res = await fetch("undefined/users/status", { method: "POST", headers: { Authorization: "Bearer wl_YOUR_TOKEN", "Content-Type": "application/json", }, body: JSON.stringify({ channel_id: 1, jid: "966500000000@s.whatsapp.net", }), }) console.log((await res.json()).data.status) ``` -------------------------------- ### Call a WhatsLoop Tool Source: https://docs.whatsloop.net/docs/mcp To execute a tool, send a POST request to the MCP endpoint with the method set to 'tools/call', specifying the tool name and its arguments. This example calls the 'reports_summary' tool. ```json { "jsonrpc": "2.0", "id": 2, "method": "tools/call", "params": { "name": "reports_summary", "arguments": { "period": "last_7_days" } } } ``` -------------------------------- ### Create Product using cURL Source: https://docs.whatsloop.net/docs/api-reference/catalog Use this cURL command to add a new product to your WhatsApp Business catalog. Ensure you replace 'wl_YOUR_TOKEN' with your actual API token and adjust the product details as needed. The 'price' field is required and can be set to 0 for free products. ```curl curl -X POST "https://api.whatsloop.net/v1/catalog/products" \ -H "Authorization: Bearer wl_YOUR_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "channel_id": 1, "name": "string", "description": "string", "price": 1, "currency": "string", "image_url": "https://docs.whatsloop.net/app/docs-samples/whatsloop-welcome.jpg", "images": [ "https://docs.whatsloop.net/app/docs-samples/whatsloop-welcome.jpg" ] }' ``` -------------------------------- ### Conversation Not Found Response Example Source: https://docs.whatsloop.net/docs/api-reference/message-management Example of a response when the conversation is not found or does not belong to the channel. The message field is in Arabic. ```JSON { "success": true, "message": "المحادثة غير موجودة أو لا تتبع هذه القناة", "data": [ "string" ] } ``` -------------------------------- ### List Endpoint with Pagination and Filters Source: https://docs.whatsloop.net/docs/pagination Demonstrates how to fetch a paginated list of resources, including filtering by channel_id and controlling the page size. ```APIDOC ## GET /v1/groups/list ### Description Fetches a list of groups, supporting pagination and filtering. ### Method GET ### Endpoint /v1/groups/list ### Query Parameters - **limit** (integer) - Optional - Page size, default 50, maximum 100. - **cursor** (string) - Optional - Opaque cursor for the next page, omit it to get the first page. - **channel_id** (string) - Required on channel-scoped lists - Filters the list to a single connected channel. ### Request Example ```bash curl "https://api.whatsloop.net/v1/groups/list?channel_id=1&limit=50" \ -H "Authorization: Bearer YOUR_TOKEN" ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **message** (string) - Status message. - **data** (object) - Contains the paginated results. - **items** (array) - The records for the current page, up to `limit` of them. - **next_cursor** (string) - The opaque cursor for the next page, or null when there are no more pages. - **has_more** (boolean) - True when another page exists, false on the last page. #### Response Example ```json { "success": true, "message": "OK", "data": { "items": [ /* up to `limit` records */ ], "next_cursor": "NTA", "has_more": true } } ``` ``` -------------------------------- ### Accept a Community Invite Source: https://docs.whatsloop.net/docs/api-reference/communities Join a community by accepting an invite using the provided invite code and channel ID. Replace 'wl_YOUR_TOKEN' with your API token. This is a live request and will be logged. ```cURL curl -X POST "https://api.whatsloop.net/v1/communities/accept-invite" \ -H "Authorization: Bearer wl_YOUR_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "channel_id": 1, "invite_code": "string" }' ``` ```json { "success": true, "message": "Invite accepted", "data": "string" } ``` ```json { "success": true, "message": null, "data": null, "code": null } ``` -------------------------------- ### Successful Response Example Source: https://docs.whatsloop.net/docs/messages/send This is an example of a successful response when sending a contact card. It indicates the message was sent and provides a message ID and status. ```json { "success": true, "message": "Contact card sent", "data": { "message_id": "3EB01C89DE01FA23", "status": "sent" } } ``` -------------------------------- ### Send Live Location (Python) Source: https://docs.whatsloop.net/docs/api-reference/contact-and-location Example of sending a live location using Python. This requires the 'requests' library. Replace placeholders with your actual token and recipient details. ```python import requests url = "https://api.whatsloop.net/v1/messages/send-live-location" headers = { "Authorization": "Bearer wl_YOUR_TOKEN", "Content-Type": "application/json" } data = { "channel_id": 1, "to": "string", "latitude": 1, "longitude": 1, "name": "string", "address": "string", "caption": "string" } response = requests.post(url, headers=headers, json=data) print(response.json()) ``` -------------------------------- ### Create a WhatsApp Community Source: https://docs.whatsloop.net/docs/api-reference/communities Use this endpoint to create a new WhatsApp community. Ensure you replace 'wl_YOUR_TOKEN' with your actual API token and provide valid channel ID, subject, and description. ```curl curl -X POST "https://api.whatsloop.net/v1/communities" \ -H "Authorization: Bearer wl_YOUR_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "channel_id": 1, "subject": "string", "description": "string" }' ``` ```json { "success": true, "message": "Community created", "data": "string" } ``` ```json { "success": true, "message": null, "data": null, "code": null } ``` -------------------------------- ### List Products in Catalog (cURL) Source: https://docs.whatsloop.net/docs/catalog Use this cURL command to retrieve all products from a connected channel's WhatsApp Business catalog. This is useful for syncing your catalog or displaying live products on your storefront. Requires the `catalog.read` scope. ```bash curl "https://api.whatsloop.net/v1/catalog?channel_id=1" \ -H "Authorization: Bearer wl_YOUR_TOKEN" ``` -------------------------------- ### Send Template Message with Buttons (Python) Source: https://docs.whatsloop.net/docs/messages/interactive/send-template Python example demonstrating how to send a template message with various button types. This requires the 'requests' library. ```python import requests url = "https://api.whatsloop.net/v1/messages/send-template" headers = { "Authorization": "Bearer wl_YOUR_TOKEN", "Content-Type": "application/json" } payload = { "channel_id": 1, "to": "9665XXXXXXXX", "text": "Your order #4821 has shipped.", "footer": "WhatsLoop Store", "template_buttons": [ { "type": "url", "text": "Track order", "url": "https://shop.example/track/4821" }, { "type": "call", "text": "Call us", "phone_number": "9665XXXXXXXX" }, { "type": "quickReply", "text": "Contact support" } ] } response = requests.post(url, headers=headers, json=payload) print(response.json()) ``` -------------------------------- ### Example Response for List Posted Statuses Source: https://docs.whatsloop.net/docs/status This is a sample successful response when listing posted statuses. It includes details like status message ID, content, view count, and timestamps. ```json { "success": true, "message": "Statuses retrieved", "data": [ { "id": 42, "status_message_id": "3EB0ABC123", "type": "text", "content": "Weekend sale is live!", "background_color": "#0D7C5F", "media_url": null, "audience": null, "view_count": 37, "posted_at": "2026-07-02T09:20:00Z", "expires_at": "2026-07-03T09:20:00Z", "is_expired": false } ] } ``` -------------------------------- ### Product Creation Success Response Source: https://docs.whatsloop.net/docs/api-reference/catalog This is a sample success response when a product is created. It confirms the operation and provides a message. ```json { "success": true, "message": "Product created", "data": "string" } ``` -------------------------------- ### Labels - Get All Source: https://docs.whatsloop.net/docs/api-reference Retrieves all available labels. ```APIDOC ## GET /labels ### Description Retrieves a list of all labels. ### Method GET ### Endpoint /labels ### Response #### Success Response (200) - **labels** (array) - A list of labels, each with an ID and name. ``` -------------------------------- ### Order Details Response Structure Source: https://docs.whatsloop.net/docs/catalog This is an example of a successful response when retrieving order details. It includes the order status, total amount, creation timestamp, and a list of products with their details. Note that the 'total' is in the smallest currency unit. ```json { "success": true, "message": "Order details retrieved", "data": { "order_id": "ORDER_ID", "status": "pending", "total": 9000, "currency": "SAR", "created_at": "2026-07-02T09:14:00Z", "products": [ { "id": "7213456789012345", "name": "Ethiopian Coffee 250g", "quantity": 2, "price": 4500 } ] } } ``` -------------------------------- ### Privacy - Get Settings Source: https://docs.whatsloop.net/docs/api-reference Retrieves privacy settings. ```APIDOC ## GET /privacy ### Description Retrieves the current privacy settings. ### Method GET ### Endpoint /privacy ### Response #### Success Response (200) - **settings** (object) - An object containing various privacy settings. ``` -------------------------------- ### List all communities (PHP) Source: https://docs.whatsloop.net/docs/api-reference/communities Use this endpoint to retrieve a list of all communities. Pass `?refresh=1` to force a live engine pull. The request counts against your credit and appears in your request log. ```php response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); ``` -------------------------------- ### Iterate Through All Results with Node.js Source: https://docs.whatsloop.net/docs/pagination This Node.js example demonstrates how to loop through all paginated results by repeatedly fetching pages until `next_cursor` is null. The cursor is passed back as-is without parsing. ```javascript let cursor = null do { const url = new URL("https://api.whatsloop.net/v1/groups/list") url.searchParams.set("channel_id", "1") url.searchParams.set("limit", "50") if (cursor) url.searchParams.set("cursor", cursor) const res = await fetch(url, { headers: { Authorization: "Bearer YOUR_TOKEN" } }) const { data } = await res.json() process(data.items) cursor = data.next_cursor // opaque — pass back as-is } while (cursor) ``` -------------------------------- ### Get admin count Source: https://docs.whatsloop.net/docs/api-reference/newsletters Retrieves the count of administrators for a newsletter. ```APIDOC ## GET /newsletters/{id}/admins ### Description Retrieves the count of administrators for a newsletter. ### Method GET ### Endpoint /newsletters/{id}/admins ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the newsletter. ``` -------------------------------- ### Get invite info Source: https://docs.whatsloop.net/docs/api-reference/communities Retrieves information about a community invitation. ```APIDOC ## POST /communities/invite-info ### Description Gets information related to a community invite. ### Method POST ### Endpoint /communities/invite-info ``` -------------------------------- ### Webhooks - Get List Source: https://docs.whatsloop.net/docs/api-reference Retrieves a list of registered webhooks. ```APIDOC ## GET /webhooks ### Description Retrieves a list of all registered webhooks. ### Method GET ### Endpoint /webhooks ### Response #### Success Response (200) - **webhooks** (array) - A list of webhooks, each with an ID, URL, and subscribed event types. ``` -------------------------------- ### Calls - Initiate Source: https://docs.whatsloop.net/docs/api-reference Initiates a call. ```APIDOC ## POST /calls/initiate ### Description Initiates a call to a specified number. ### Method POST ### Endpoint /calls/initiate ### Request Body - **to** (string) - Required - The phone number to call. ### Response #### Success Response (200) - **call_id** (string) - The ID of the initiated call. - **status** (string) - The status of the call initiation. ``` -------------------------------- ### User Lookup - Get User Source: https://docs.whatsloop.net/docs/api-reference Retrieves user information. ```APIDOC ## GET /users/lookup ### Description Looks up user information by phone number. ### Method GET ### Endpoint /users/lookup ### Query Parameters - **phone_number** (string) - Required - The phone number of the user to look up. ### Response #### Success Response (200) - **user_id** (string) - The ID of the user. - **name** (string) - The name of the user. - **phone_number** (string) - The phone number of the user. ``` -------------------------------- ### Subscribe Response Source: https://docs.whatsloop.net/docs/api-reference/newsletters Example of a successful response when subscribing to newsletter updates. ```json { "success": true, "message": "Subscribed to newsletter updates", "data": "string" } ``` -------------------------------- ### List all communities (JavaScript) Source: https://docs.whatsloop.net/docs/api-reference/communities Use this endpoint to retrieve a list of all communities. Pass `?refresh=1` to force a live engine pull. The request counts against your credit and appears in your request log. ```javascript fetch("https://api.whatsloop.net/v1/communities", { "method": "GET", "headers": { "Authorization": "Bearer wl_YOUR_TOKEN" } }) .then(response => { return response.json(); }) .then(json => { console.log(json) }) .catch(err => { console.error(err) }); ``` -------------------------------- ### Sample Success Response Source: https://docs.whatsloop.net/docs/api-reference/catalog This is a sample JSON response indicating that the order details were successfully retrieved. ```json { "success": true, "message": "Order details retrieved", "data": "string" } ``` -------------------------------- ### Participants Response Source: https://docs.whatsloop.net/docs/api-reference/groups Example of a successful response when retrieving group participants. ```JSON { "success": true, "message": "Participants retrieved", "data": "string" } ``` -------------------------------- ### Claude Desktop MCP Server Configuration Source: https://docs.whatsloop.net/docs/mcp Add this JSON configuration to your claude_desktop_config.json file to connect Claude Desktop to WhatsLoop as an MCP server. Ensure your developer token is correctly formatted. ```json { "mcpServers": { "whatsloop": { "url": "https://api.whatsloop.net/v1/mcp", "headers": { "Authorization": "Bearer wl_xxxxxxxxxxxxxxxxxxxx" } } } } ``` -------------------------------- ### Get newsletter details Source: https://docs.whatsloop.net/docs/api-reference/newsletters Retrieves the details of a specific newsletter by its ID. ```APIDOC ## GET /newsletters/{id} ### Description Retrieves the details of a specific newsletter. ### Method GET ### Endpoint /newsletters/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the newsletter. ``` -------------------------------- ### Get community details Source: https://docs.whatsloop.net/docs/api-reference/communities Retrieves the details of a specific community by its ID. ```APIDOC ## GET /communities/{id} ### Description Gets the details of a specific community. ### Method GET ### Endpoint /communities/{id} ``` -------------------------------- ### Successful Link Preview Response Source: https://docs.whatsloop.net/docs/api-reference/text-messages This is a sample successful response when sending a link preview. It confirms the message was sent and provides a data string. ```json { "success": true, "message": "URL message sent", "data": "string" } ``` -------------------------------- ### Status (Stories) - Get Latest Source: https://docs.whatsloop.net/docs/api-reference Retrieves the latest status story. ```APIDOC ## GET /status_stories/latest ### Description Retrieves the latest status story. ### Method GET ### Endpoint /status_stories/latest ### Response #### Success Response (200) - **story_id** (string) - The ID of the latest story. - **media_url** (string) - The URL of the story media. - **timestamp** (string) - The timestamp of the story. ``` -------------------------------- ### Send Buttons Message (PHP) Source: https://docs.whatsloop.net/docs/messages/interactive/send-buttons PHP example for sending a message with quick-reply buttons. This uses cURL to make the HTTP POST request. ```php 1, "to" => "9665XXXXXXXX", "text" => "Confirm your order #4821?", "footer" => "WhatsLoop Store", "buttons" => [ ["id" => "yes", "text" => "Yes, confirm"], ["id" => "no", "text" => "No, cancel"] ] ]; $headers = [ "Authorization: Bearer " . $token, "Content-Type: application/json" ]; $ch = curl_init($url); c_setopt($ch, CURLOPT_RETURNTRANSFER, true); c_setopt($ch, CURLOPT_POST, true); c_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); c_setopt($ch, CURLOPT_HTTPHEADER, $headers); $response = curl_exec($ch); if (curl_errno($ch)) { echo 'Curl error: ' . curl_error($ch); } curl_close($ch); echo $response; ?> ``` -------------------------------- ### Bulk Messages - Get Status Source: https://docs.whatsloop.net/docs/api-reference Retrieves the status of bulk messages. ```APIDOC ## GET /bulk_messages/{batch_id} ### Description Retrieves the status of a bulk message batch. ### Method GET ### Endpoint /bulk_messages/{batch_id} ### Parameters #### Path Parameters - **batch_id** (string) - Required - The ID of the bulk message batch. ### Response #### Success Response (200) - **status** (string) - The status of the batch. - **details** (object) - Detailed status for each recipient. ``` -------------------------------- ### Create a group Source: https://docs.whatsloop.net/docs/api-reference/groups Create a new WhatsApp group with an optional list of participants. ```APIDOC ## POST /v1/groups ### Description Create a new WhatsApp group with an optional list of participants. ### Method POST ### Endpoint https://api.whatsloop.net/v1/groups ### Request Body - **to** (array) - Required - List of participants to add to the group. - **subject** (string) - Optional - The subject of the group. - **message** (string) - Optional - An initial message to send to the group. ### Request Example ```json { "to": ["+1234567890"], "subject": "My New Group", "message": "Hello everyone!" } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the operation was successful. - **message** (string) - A message describing the result of the operation. - **data** (string) - The ID of the created group. #### Response Example ```json { "success": true, "message": "Group created", "data": "group_id_12345" } ``` ``` -------------------------------- ### Get account info Source: https://docs.whatsloop.net/docs/api-reference/instance Retrieve the connected WhatsApp account information. ```APIDOC ## GET /instance/me ### Description Retrieve the connected WhatsApp account information. ### Method GET ### Endpoint /instance/me ### Parameters #### Query Parameters - **channel_id** (integer) - required - ### Request Example ```curl curl -X GET "https://api.whatsloop.net/v1/instance/me" \ -H "Authorization: Bearer wl_YOUR_TOKEN" ``` ### Response #### Success Response (200) - **success** (boolean) - - **message** (string) - - **data** (string) - #### Response Example ```json { "success": true, "message": "Account info retrieved", "data": "string" } ``` ``` -------------------------------- ### Demote Admin Response Source: https://docs.whatsloop.net/docs/api-reference/newsletters Example of a successful response when a newsletter admin is demoted. ```json { "success": true, "message": "Admin demoted", "data": "string" } ``` -------------------------------- ### Get Order Details using Python Source: https://docs.whatsloop.net/docs/catalog This Python snippet demonstrates how to fetch order details. It requires the 'requests' library. Replace placeholders with your actual token and order ID. The token_base64 is essential and must be obtained from the webhook payload. ```python import requests order_id = "ORDER_ID" token = "wl_YOUR_TOKEN" channel_id = 1 token_base64 = "TOKEN_FROM_WEBHOOK" headers = { "Authorization": f"Bearer {token}", "Content-Type": "application/json" } data = { "channel_id": channel_id, "token_base64": token_base64 } response = requests.get(f"https://api.whatsloop.net/v1/catalog/orders/{order_id}", headers=headers, json=data) print(response.json()) ``` -------------------------------- ### Group Info Response Source: https://docs.whatsloop.net/docs/api-reference/groups Example of a successful response when retrieving group metadata. ```JSON { "success": true, "message": "Group metadata retrieved", "data": "string" } ```