Get messages from Channels
How to Retrieve Messages from WhatsApp Channels
Many of our clients use Whapi.Cloud to extract messages from WhatsApp channels, whether to duplicate posts into other systems or parse competitor or personal channels for real-time updates. In this article, we’ll cover the best ways to retrieve channel messages using webhooks and API endpoints, and explain how to get the most complete data.
How to find and subscribe to a WhatsApp Channel (newsletter)
Whapi.Cloud supports subscribing to third-party public WhatsApp Channels (newsletters) and receiving their posts through webhooks. Follow the channel with the WhatsApp account connected to Whapi.Cloud. You can follow a channel from your phone or through the API.
From your phone
Open the Updates tab in WhatsApp on your primary phone and tap the Search icon. You may need to swipe down to see it.
Enter the channel name. Matching channels appear under Other channels.
Open the channel and tap Follow.
You can also browse the directory from Updates → Explore, or open a direct channel link. See WhatsApp's guide to finding and following channels.
Through the API — search by name
Use Find newsletters by filters, passing the channel name or search phrase in
search. Optionally, specify a country incountry_code.Take the ID of the channel you want to follow from the search results.
Pass that ID to Subscribe to newsletter.
Through the API — using a channel link
If you have a channel link such as https://whatsapp.com/channel/<invite_code>, pass the part after /channel/ to Subscribe to newsletter by invite code. You do not need to know the Newsletter ID in advance.
To get the channel information and ID before following it, use Get newsletter info by invite code.
After following the channel, configure webhooks as described below. Channel posts arrive in messages.post events with a chat_id ending in @newsletter. To process posts from one specific channel, compare the full chat_id.
1. Webhook listeners for public WhatsApp Channels (newsletters)
To receive new posts from a public newsletter in real time, subscribe to the channel and configure a webhook listener for messages.post.
Webhooks allow you to automatically receive real-time notifications whenever a new message is posted in a channel. This ensures that you get the most up-to-date content without repeatedly querying the API.
To configure a webhook:
Set up a server endpoint that can accept POST requests.
Add your webhook URL in the channel settings on Whapi.Cloud.
Subscribe to the relevant event types (
POST messages).
Each time a message is posted in the channel, Whapi.Cloud will send a webhook event to your server with all relevant details about the message.
2. Get Newsletter Messages
Endpoint: Get Newsletter Messages
This endpoint provides a more complete solution for retrieving messages from channels, including details that may not be available through other methods (e.g., message reactions).
Why is this better? Unlike the standard "Get Messages by Chat ID" this endpoint captures additional metadata and ensures that you receive a more comprehensive view of the channel’s activity.
When to use:
You need the most accurate and detailed data, including reactions.
You want to ensure that no relevant information is missed when processing messages.
Last updated