Help Desk
  • Getting Started
    • πŸ™ŒWelcome to Whapi.Cloud
    • πŸ’°Pricing
    • β˜•Partners
    • πŸš€Getting started
    • πŸ‘¨β€πŸ’»API Docs
      • Developer hubs
      • Swagger environment
      • Postman collection
  • Sending
    • Introduction
    • Send text message
      • Whatsapp API send message PHP
      • Whatsapp API send message Python
      • Whatsapp API send message Node JS
      • Whatsapp API send message Π‘#
      • Whatsapp API send message Java
      • API integration with VB6
      • Whatsapp API send message GO (Golang)
    • Send video, audio, image, document
    • Send Group message
    • Send post to WhatsApp Channel
    • Send message with Buttons
    • Send Emoji
    • Overview of other methods for sending
      • Send Voice message
      • Send contact (vCard)
      • Send message reactions
  • Receiving
    • Introduction
    • Webhooks
      • Our webhooks (Tracked events)
      • Where to Find the Webhook URL?
      • Set the webhook link to the channel
      • Detailed webhook settings
      • How to check the webhook?
      • Incoming webhooks format
        • Incoming message
        • Sent message
        • Chats
        • Groups
        • Account and device status
        • Other
          • Presences
          • Views of stories (statuses)
          • Story (status) from your contacts
          • Calls
      • Receive messages
        • Receive WhatsApp messages using PHP
        • Receive WhatsApp messages using Node js
        • Receive WhatsApp messages using Python
    • HTTP API
      • Retrieve a Specific User's Chat History
      • Get a full-size picture in the response
      • Get order items
      • Get a profile picture of a chat or user
    • File expiration period
  • Groups
    • Send Group message
      • Mentioning all participants in a WhatsApp group
    • Get list of group members
    • Add new member to Group
  • Channels
    • Send post to WhatsApp Channel
    • Get messages from Channels
    • Get votes from polls in the Channel
  • Communities
    • Introduction
    • Create a community
    • Add a member to a community
    • Send announcement
    • Get info on community participants
    • Add a group / Exclude a group from the community
  • Account
    • Setting "Auto Download"
    • Customizable Webhook Headers
    • How to find out the IP channel
    • How to Delete a Channel
    • Add Business Info to Invoice
  • Source code
    • WhatsApp ChatBot
      • WhatsApp Python Bot
      • WhatsApp PHP Bot
      • WhatsApp Node JS Bot
      • WhatsApp Java Bot
    • WhatsApp API Google Sheets
    • WhatsApp Phone Number Checker
    • Request Distributor (Balancer)
  • FAQ
    • Chat ID. What is it and how to get it?
    • Current status of Buttons on WhatsApp
    • How to send a paragraph (line break)
    • Inactive Links in WhatsApp Messages
    • WhatsApp Text Formatting
    • Checking if the number has Whatsapp
    • Specifics of sending messages to numbers of different countries
    • Why aren't participants being added to the group?
  • Does WhatsApp API Work with the Phone Turned Off?
  • Hints
    • Android Emulators
    • Virtual Numbers for WhatsApp
    • How to use polls as buttons?
    • How to check who blocked you in Whatsapp?
    • Setting up a WhatsApp proxy
  • Integrations
    • Make.com
      • Ready-Made Scenarios
        • WhatsApp & Whisper API: Voice-to-Text Integration
        • Automated WhatsApp Group Message Forwarding in Make.com
      • Request Scenario Setup
    • Pabbly Connect
    • Google Contacts
    • DialogFlow
    • n8n
  • Tools
    • WhatsApp Number Checker
    • Automatic warm-up module
    • WhatsApp Activity Safety Meter
    • Residential Proxies from Whapi.Cloud
  • Troubleshooting
    • Couldn't Link Device – WhatsApp QR Code or Pairing Code Fails
    • Channel status β€œSYNC_ERROR”
    • Not getting a READ status on webhook
    • 429 (Too Many Requests) - Soft Ban
    • β€œWaiting for this message. This may take a while” – WhatsApp Message Error
    • Missing push notifications after connecting to API
  • Blocking
    • How to not get Banned?
    • How to do mailings without the risk of being blocked?
    • If My Number Is Banned, Can It Be Restored?
    • Unlocking Your WhatsApp Number
    • Connecting a New WhatsApp Number After a Ban: Steps and Recommendations
    • Warming Up New Phone Numbers for WhatsApp API
  • Partner Documentation
    • Introduction
    • Partner Dashboard Overview
    • Partner Program Guidelines
      • Workflow: Step-by-Step
      • Billing for Partners
      • Allocating Days to Customer Channels: Best Practices & Guide
      • Interface for channel management
    • Partner Documentation
      • Channel creation
      • Changing channel mode
      • Channel extension
      • Channel deletion
      • Getting the list of channels
      • Notices of end of days on balance
Powered by GitBook
On this page

Was this helpful?

  1. Sending

Send Group message

How to create a WhatsApp group or send messages to the group

PreviousSend video, audio, image, documentNextSend post to WhatsApp Channel

Last updated 11 months ago

Was this helpful?

To send a message to a group you need to know the group ID.

You can get the group ID in several ways:

  • When you create a group, the group ID will be specified in the response from the API;

  • Get a list of groups (method: );

  • Get a list of all chats (method: );

Once you know the group ID, you can use the method to send any message. For example, a text message

In the β€œto” parameter you insert the ID of the group you want to send the message to. And in the β€œbody”, the text of the message

How to create a group via API

Example usage for WhatsApp API using PHP

Send your first WhatsApp message in group.

For a detailed breakdown of the messaging method, including a comprehensive description of all parameters, additional examples, and options for testing, please visit our Developer Hub at:

const BASE_URL = 'https://gate.whapi.cloud/';
$token = 'bg3FeZJ6jWGw32goN02PRnkKO7k03GtX'; // Specify your channel token here
$data = array (
    'to' => '120363194020948049@g.us',
    'body' => 'Hello, world!',
    'typing_time' => 0,
    'view_once' => true,
);
$data = json_encode($data);
$url = BASE_URL . 'messages/text';
$options = array('http' => array(
    'method'  => 'POST',
    'header' => 'Authorization: Bearer '.$token,
    'content' =>  json_encode($data)
));
$context  = stream_context_create($options);
$response = file_get_contents($url, false, $context);
  • 'to': The recipient’s WhatsApp number with international format e.g., 14409416972 or chatID for contact or group e.g 14409416972@s.whatsapp.net or 120363194020948049@g.us

  • 'body' : Message text.

We offer a convenient service for testing requests and using ready-made code fragments in any programming language. You will only need to transfer the saved API-token and fill in the required parameters:

Save the PHP script and run it on your server. The specified message will be sent to the specified WhatsApp number. Remember to replace variables with your actual details.

Please note that this is a basic example and doesn't include any error handling. For a production environment, ensure to add appropriate error and exception handling.

Enjoy communicating with your users on a platform they love and use daily! Please don't hesitate to reach out to share your experiences or pose any questions you might have.

The group ID looks like this: . This information cannot be seen in the application or Web version!

Now that your group is up and running, it's time to acquire its unique identifier. Make a quick call to /and you'll have what you need.

With the identifier in your grasp, you're all set to spread the word! Use POST /to shower your group with your initial messages.

120363194020948049@g.us
getgroup
sendmessagetext
Get Started Free
https://whapi.readme.io/reference/getgroups
https://whapi.readme.io/reference/getchats
LogoπŸ’¬ Send text messageWhapi Cloud - Whatsapp API for developers
Send private messages or group messages
LogoπŸ’¬ Send text messageWhapi Cloud - Whatsapp API for developers
LogoCreate groupWhapi Cloud - Whatsapp API for developers
Paste your API token and parameters, then copy code snippet