0. Ready-made integrations
WordPress & WooCommerce plugin
Floating WhatsApp chat button, [infowave_whatsapp_button] shortcode and automatic order confirmation / completed messages.
MCP server for AI tools
Let Claude, Cursor and other AI assistants send WhatsApp messages and manage contacts with our Model Context Protocol server.
1. Quick start
- Log in to wa.infowaveit.com and connect your WhatsApp Business number (Settings → WhatsApp Setup).
- Open Settings → API Access & Webhook. Click Generate to create your API Access Token, and copy your Vendor UID.
- Send your first message:
curl -X POST "https://wa.infowaveit.com/api/YOUR_VENDOR_UID/contact/send-message" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"phone_number":"919876543210","message_body":"Hello from Infowave!"}'
2. Authentication & base URL
Base URL
https://wa.infowaveit.com/api/{vendorUid}/
Send your API token in one of two ways:
- Recommended: HTTP header
Authorization: Bearer YOUR_API_TOKEN - Query parameter
?token=YOUR_API_TOKEN. Tokens in URLs can end up in server and proxy logs, so use the header wherever you can.
Send request bodies as application/json (form data also works). All endpoints use POST.
Phone numbers are always country code + number, digits only, with no +, leading 0 or spaces. Example: 919876543210.
3. Send a text message
| Field | Type | Description |
|---|---|---|
phone_number required | string | Recipient, e.g. 919876543210. A new contact is created automatically if it doesn't exist yet. |
message_body required | string | Message text. WhatsApp formatting works: *bold*, _italic_, ~strike~. |
from_phone_number_id | string | Optional. Which of your WhatsApp numbers to send from. Your default number is used if this is empty. |
contact | object | Optional. Contact details used when a new contact is created: first_name, last_name, email, country, language_code, groups (comma-separated group names). |
curl -X POST "https://wa.infowaveit.com/api/YOUR_VENDOR_UID/contact/send-message" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"phone_number": "919876543210",
"message_body": "Hi Rahul, your order #1042 has been shipped.",
"contact": { "first_name": "Rahul", "groups": "Customers" }
}'<?php
$ch = curl_init("https://wa.infowaveit.com/api/YOUR_VENDOR_UID/contact/send-message");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("INFOWAVE_WA_TOKEN"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
"phone_number" => "919876543210",
"message_body" => "Hi Rahul, your order #1042 has been shipped.",
]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);const res = await fetch(
"https://wa.infowaveit.com/api/YOUR_VENDOR_UID/contact/send-message",
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.INFOWAVE_WA_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
phone_number: "919876543210",
message_body: "Hi Rahul, your order #1042 has been shipped.",
}),
}
);
const data = await res.json();Successful response (fields inside data):
{
"result": "success",
"data": {
"log_uid": "message log id in the portal",
"contact_uid": "contact id in the portal",
"phone_number": "919876543210",
"wamid": "wamid.HBgM...",
"status": "accepted"
}
}
Keep the wamid. It is WhatsApp's message ID, and the delivery and read updates in the webhook refer to it.
4. Send media (image, video, document, audio)
| Field | Type | Description |
|---|---|---|
phone_number required | string | Recipient number. |
media_type required | string | image, video, document or audio. |
media_url required | URL | Public HTTPS link to the file. WhatsApp downloads it from this link. |
caption | string | Optional caption for an image, video or document. |
file_name | string | Optional file name shown for documents, e.g. Invoice-1042.pdf. |
from_phone_number_id, contact | Same as in send-message. |
curl -X POST "https://wa.infowaveit.com/api/YOUR_VENDOR_UID/contact/send-media-message" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"phone_number": "919876543210",
"media_type": "document",
"media_url": "https://example.com/invoices/1042.pdf",
"file_name": "Invoice-1042.pdf",
"caption": "Your invoice"
}'
WhatsApp size limits: image 5 MB (JPG/PNG), video 16 MB (MP4), audio 16 MB, document 100 MB.
5. Send a template message
Use a template to start a conversation, or for notifications such as OTPs, order updates and reminders. First create the template in the portal (Templates → Create) and wait until Meta approves it.
| Field | Type | Description |
|---|---|---|
phone_number required | string | Recipient number. |
template_name required | string | Exact template name, e.g. order_shipped. |
template_language required | string | Template language code, e.g. en, en_US, hi. |
field_1, field_2, … | string | Body variables {{1}}, {{2}}… in order. |
header_field_1 | string | Variable in a text header. |
header_image / header_video / header_document | URL | Media for a media header. Add header_document_name for the file name. |
location_latitude, location_longitude, location_name, location_address | string | For a location header. |
button_0, button_1, … | string | Dynamic part of URL buttons, in button order (starting at 0). |
copy_code | string | Value for a "copy code" button (coupon or OTP). |
from_phone_number_id, contact | Same as in send-message. |
Dynamic contact values
Any field can use these placeholders. The portal fills them from the contact's saved details:
{first_name} {last_name} {full_name} {phone_number} {email} {country} {language_code}, plus your custom contact fields.
curl -X POST "https://wa.infowaveit.com/api/YOUR_VENDOR_UID/contact/send-template-message" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"phone_number": "919876543210",
"template_name": "order_shipped",
"template_language": "en",
"header_image": "https://example.com/banner.jpg",
"field_1": "{first_name}",
"field_2": "#1042",
"button_0": "track/1042"
}'
6. Create a contact
| Field | Type | Description |
|---|---|---|
phone_number required | numeric | At least 9 digits, with no + or leading 0. It must not already exist in your account. |
first_name, last_name | string | Optional. |
email | Optional. | |
country | string | Optional country name, e.g. India. |
language_code | string | Optional, e.g. en, hi. |
groups | string | Optional. Comma-separated group names, e.g. Leads,Delhi. |
custom_input_fields | object | Optional. Values for custom contact fields, keyed by the field's UID (Contacts → Custom Fields), e.g. {"a1b2c3…": "Gold"}. |
curl -X POST "https://wa.infowaveit.com/api/YOUR_VENDOR_UID/contact/create" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"phone_number":"919876543210","first_name":"Rahul","last_name":"Sharma","email":"rahul@example.com","country":"India","language_code":"en","groups":"Leads"}'
The response data contains contact_uid, first_name, last_name, phone_number, language_code and country.
7. Update a contact
Send only the fields you want to change. The fields are the same as in create, except phone_number, which goes in the URL.
curl -X POST "https://wa.infowaveit.com/api/YOUR_VENDOR_UID/contact/update/919876543210" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"email":"rahul.new@example.com","groups":"Customers"}'
8. Webhook: receive incoming messages and status updates
Turn this on in Settings → API Access & Webhook → Enable Webhook Endpoint and enter your HTTPS URL. The portal then POSTs a JSON payload to your URL whenever a customer messages you, and whenever a sent message's status changes (sent, delivered, read, failed).
{
"contact": {
"status": "existing", // new / updated / existing
"phone_number": "919876543210",
"uid": "contact uid",
"first_name": "Rahul",
"last_name": "Sharma",
"email": "rahul@example.com",
"language_code": "en",
"country": "India"
},
"message": {
"whatsapp_business_phone_number_id": "your number id",
"whatsapp_message_id": "wamid.HBgM...",
"replied_to_whatsapp_message_id": null,
"is_new_message": true,
"body": "Hi, I want a demo",
"status": null, // sent / delivered / read / failed for status updates
"media": null // or { type, link, caption, mime_type, file_name, original_filename }
},
"whatsapp_webhook_payload": { /* original payload from Meta */ }
}
Your endpoint should:
- Reply with HTTP
200within a few seconds. Do slow work (CRM sync, emails) in a background job. - Handle the same
whatsapp_message_idarriving more than once without processing it twice. - Use HTTPS, and put a long secret in the path, e.g.
https://yourapp.com/hooks/wa/8f3k…, so outsiders can't post fake events to it.
9. Errors
Failed requests return "result": "failed" with a message. Validation errors also list the problem fields.
| Message | Meaning and fix |
|---|---|
Invalid Token | The token is wrong or was regenerated. Copy the current token from the API Access page. |
Invalid Vendor | The Vendor UID in the URL is wrong. |
Vendor account is not in active state | The account is inactive or the plan has expired. Contact Infowave support. |
Please complete your WhatsApp Cloud API Setup first | No WhatsApp number is connected yet. Finish WhatsApp Setup in the portal. |
| API / Webhook not available in your plan | Upgrade to a plan that includes API access. |
Meta error 131047 (re-engagement) | More than 24 hours have passed since the customer's last message. Send a template instead. |
Meta error 132001 | Template name or language is wrong, or the template isn't approved yet. |
Meta error 131026 | The number isn't on WhatsApp, or it can't receive the message. |
10. Best practices
- Opt-in first: only message people who agreed to hear from you. Spam reports lower your quality rating and messaging limit.
- Templates: keep them short and useful, use
UTILITYfor transactional messages, and useMARKETINGonly for promotions. They are priced differently. - Rate: for bulk sends, use the portal's Campaigns feature instead of a tight API loop. If you loop over the API, leave a short pause between calls and retry failed calls with backoff.
- Phone format: always
91XXXXXXXXXXfor India. - Security: keep the token in an environment variable on your server, regenerate it if it leaks, and never put it in a website or app.