> For the complete documentation index, see [llms.txt](https://support.whapi.cloud/help-desk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://support.whapi.cloud/help-desk/channels/get-messages-from-channels.md).

# 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**

1. Open the **Updates** tab in WhatsApp on your primary phone and tap the **Search** icon. You may need to swipe down to see it.
2. Enter the channel name. Matching channels appear under **Other channels**.
3. 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](https://faq.whatsapp.com/630432792316720/).

**Through the API — search by name**

1. Use [Find newsletters by filters](https://whapi.readme.io/reference/findnewsletter), passing the channel name or search phrase in `search`. Optionally, specify a country in `country_code`.
2. Take the ID of the channel you want to follow from the search results.
3. Pass that ID to [Subscribe to newsletter](https://whapi.readme.io/reference/subscribenewsletter).

**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](https://whapi.readme.io/reference/subscribenewsletterinvite). 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](https://whapi.readme.io/reference/getnewsletterbyinvitecode).

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:

1. Set up a server endpoint that can accept POST requests.
2. Add your webhook URL in the channel settings on Whapi.Cloud.
3. 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**](https://whapi.readme.io/reference/getmessagesnewsletter)
* 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](https://whapi.readme.io/reference/getmessagesbychatid)" 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.

```
curl --request GET \
     --url https://gate.whapi.cloud/newsletters/120363352837965002%40newsletter/messages \
     --header 'accept: application/json' \
     --header 'authorization: Bearer YOUR_TOKEN'
```
