API Reference v1.0

Getting Started

Everything you need to start sending WhatsApp messages through the WhatsBizAPI platform in minutes.

Introduction

WhatsBizAPI is a WhatsApp Business API platform that simplifies integration with the WhatsApp Cloud API. Instead of dealing with the complexity of Meta's API directly, you get a clean set of REST API endpoints to send messages, manage templates, handle contacts, run campaigns, and more.

With WhatsBizAPI, you can:

i

WhatsBizAPI wraps the official WhatsApp Cloud API. You need an active subscription and a connected WhatsApp Business phone number on the platform before using the API.

Authentication

All API requests are authenticated using a personal access token (powered by Laravel Sanctum). You must include your API token in every request as a parameter in the request body.

Getting Your API Token

  1. Log in to your WhatsBizAPI dashboard
  2. Navigate to Settings from the sidebar
  3. Find the API Token section
  4. Click Generate Token (or copy your existing token)
!

Keep your API token secret. Do not expose it in client-side code, public repositories, or share it with anyone. If your token is compromised, regenerate it immediately from the dashboard.

Passing the Token

Include the token parameter in the JSON body of every request:

Example - Token in Request Body
{ "token": "your-api-token-here", "phone": "+919876543210", "message": "Hello!" }

If the token is missing or invalid, the API returns an error:

Response - 401 Unauthorized
{ "status": "error", "message": "Invalid token" }

Base URL & Headers

All API endpoints are served from a single base URL:

https://whatsbizapi.com/api/wpbox/

Required Headers

All POST requests must include the Content-Type header:

Header Value Required
Content-Type application/json Yes (for POST requests)
Accept application/json Recommended

For GET requests, pass the token as a query parameter:

GET Request Example
curl -X GET "https://whatsbizapi.com/api/wpbox/getTemplates?token=your-api-token"

Quick Start - Send Your First Message

Follow these three steps to send your first WhatsApp message through the API.

Step 1: Get Your API Token

Log in to the WhatsBizAPI dashboard, go to Settings, and copy your API token. If you do not have one, click Generate Token to create it.

Step 2: Send a Text Message

Use the /sendmessage endpoint to send a simple text message. Replace your-api-token with your actual token, and +919876543210 with the recipient's phone number (including country code).

POST /api/wpbox/sendmessage

Sends a text message (or interactive message with buttons) to a WhatsApp number.

Parameter Type Description
token Required string Your API authentication token
phone Required string Recipient phone number with country code (e.g., +919876543210)
message Required string The text content of the message
cURL
curl -X POST https://whatsbizapi.com/api/wpbox/sendmessage \ -H "Content-Type: application/json" \ -d '{ "token": "your-api-token", "phone": "+919876543210", "message": "Hello from WhatsBizAPI!" }'

Step 3: Check the Response

A successful response returns the internal message ID and the WhatsApp message ID (wamid):

Response - 200 OK
{ "status": "success", "message_id": 12345, "message_wamid": "wamid.HBgLMTIzNDU2Nzg5MAUCABEYEjBFQ..." }

If something goes wrong, the response includes an error status and a description:

Response - 400 Bad Request
{ "status": "error", "errors": { "phone": ["The phone field is required."], "message": ["The message field is required."] } }

That's it! You have sent your first WhatsApp message through the API. The contact is automatically created in your dashboard if it does not already exist.

Available Endpoints

WhatsBizAPI provides 9 endpoints covering messaging, data retrieval, and contact management. All endpoints are relative to the base URL https://whatsbizapi.com/api/wpbox/.

Method Endpoint Description
POST /sendmessage Send a text or interactive message (with optional buttons, header, and footer)
POST /sendtemplatemessage Send a pre-approved template message with dynamic variables
POST /sendmedia Send a media message (image, video, document, or audio)
POST /sendcampaigns Send a campaign message using an existing campaign to a specific contact
GET /getTemplates Retrieve all WhatsApp message templates for your account
GET /getContacts Retrieve all contacts in your account
POST /makeContact Create a new contact or update an existing one, with optional group and custom field assignment
GET /getGroups Retrieve all contact groups (optionally include group members)
GET /getCampaigns Retrieve all campaigns (filterable by type: regular, bot, or api)
i

Each endpoint is documented in detail in its own section. Use the sidebar navigation to jump to any specific endpoint.

Quick Reference Examples

Below are condensed examples for the most common operations. See each endpoint's dedicated page for full parameter details and response formats.

Send a Template Message

cURL
curl -X POST https://whatsbizapi.com/api/wpbox/sendtemplatemessage \ -H "Content-Type: application/json" \ -d '{ "token": "your-api-token", "phone": "+919876543210", "template_name": "order_confirmation", "template_language": "en", "components": [ { "type": "body", "parameters": [ { "type": "text", "text": "John" }, { "type": "text", "text": "ORD-12345" } ] } ] }'
Response - 200 OK
{ "status": "success", "message_id": 12346, "message_wamid": "wamid.HBgLMTIzNDU2Nzg5MAUCABEYEjBFQ..." }

Send an Interactive Message with Buttons

cURL
curl -X POST https://whatsbizapi.com/api/wpbox/sendmessage \ -H "Content-Type: application/json" \ -d '{ "token": "your-api-token", "phone": "+919876543210", "message": "How can we help you today?", "header": "Support", "footer": "Reply within 24 hours", "buttons": [ { "title": "Track Order", "id": "track_order" }, { "title": "Talk to Agent", "id": "talk_agent" }, { "title": "FAQs", "id": "faqs" } ] }'

Create a Contact with Groups

cURL
curl -X POST https://whatsbizapi.com/api/wpbox/makeContact \ -H "Content-Type: application/json" \ -d '{ "token": "your-api-token", "phone": "+919876543210", "groups": [1, 3], "custom": { "1": "Premium", "2": "Mumbai" } }'
Response - 200 OK
{ "status": "success", "contact": { "id": 456, "name": "+919876543210", "phone": "+919876543210", "company_id": 1 } }

List Templates

cURL
curl -X GET "https://whatsbizapi.com/api/wpbox/getTemplates?token=your-api-token"
Response - 200 OK
{ "status": "success", "templates": [ { "id": 1, "name": "order_confirmation", "language": "en", "category": "UTILITY", "status": "APPROVED", "components": "[...]" } ] }

List Groups with Contacts

cURL
curl -X GET "https://whatsbizapi.com/api/wpbox/getGroups?token=your-api-token&showContacts=yes"

List Campaigns by Type

cURL
curl -X GET "https://whatsbizapi.com/api/wpbox/getCampaigns?token=your-api-token&type=regular"

Error Handling

The API uses standard HTTP status codes and returns consistent error responses. Always check the status field in the response body.

HTTP Code Meaning Common Cause
200 Success Request processed successfully
400 Bad Request Missing required parameters or validation failure
401 Unauthorized Invalid or missing API token
402 Payment Required Insufficient message credits (credit-based plans)
403 Forbidden Subscription expired or inactive
!

Subscription required. API access requires an active subscription. If your plan has expired, the API returns a 403 error with instructions to renew. Visit the billing page to manage your subscription.

Next Steps

Now that you have sent your first message, explore the full API:

i

Need help? If you run into any issues, contact our support team through the dashboard or email us. We typically respond within a few hours.