Meta Cloud API Guide

Send WhatsApp messages using your secure API key.

Send Message Endpoint

This single API endpoint supports both Meta Cloud API Keys and Personal Device API Keys. Based on your key type, the platform will route the message to the correct WhatsApp infrastructure automatically.

Endpoint:
POST https://www.webwms2u.com/api/send-message.php
Headers:
X-API-KEY: YOUR_API_KEY
Content-Type: application/json
Supported Key Types:
Important Differences
Feature Meta Cloud API Personal Device API
Message Type Templates or within 24h window Free-form messages
Template Required? Yes, unless replying to a user within 24h No template needed
Phone Number Type Business phone number linked with Meta Any WhatsApp-registered mobile number
Quota Limits Subject to Meta tier limits (1K-100K) No official limit (depends on device stability)
Reliability Highly stable, suitable for scale May disconnect if WhatsApp Web is opened elsewhere
Request Body Parameters:
Restrictions for Meta Cloud:
Restrictions for Personal Device:
Example JSON Request:
{
  "message": "Hello from the API!",
  "direct_number": "60123456789"
}
PHP Sample Code:
<?php
$apiUrl = "https://www.webwms2u.com/api/send-message.php";
$apiKey = "YOUR_API_KEY_HERE";

$data = [
  "message" => "Hello from the API!",
  "direct_number" => "60123456789"
];

$options = [
  "http" => [
    "header" => "Content-Type: application/json\r\nX-API-KEY: $apiKey\r\n",
    "method" => "POST",
    "content" => json_encode($data)
  ]
];

$context = stream_context_create($options);
$response = @file_get_contents($apiUrl, false, $context);

if ($response === false) {
    echo "API call failed";
} else {
    echo "Response: " . $response;
}
?>
PHP Sample Code: With Template, Custom Fields & Scheduling
<?php
$apiUrl = "https://www.webwms2u.com/api/send-message.php";
$apiKey = "YOUR_API_KEY_HERE";

$data = [
  "template_id" => "123", // Your template ID
  "direct_number" => "60123456789",
  "send_time" => "2025-06-23 14:30:00",
  "custom_fields" => [
    1 => "John",
    2 => "Promo2025",
    3 => "June"
  ]
];

$options = [
  "http" => [
    "header" => "Content-Type: application/json\r\nX-API-KEY: $apiKey\r\n",
    "method" => "POST",
    "content" => json_encode($data)
  ]
];

$context = stream_context_create($options);
$response = @file_get_contents($apiUrl, false, $context);

if ($response === false) {
    echo "API call failed";
} else {
    echo "Response: " . $response;
}
?>

Download Sample PHP (ZIP)

Success Response:
{
  "success": true,
  "message": "Message queued",
  "cost": 1
}
Error Responses:
Notes: