Help Desk
Ask or search…
K

How to send a post to WhatsApp Channel

Manage WhatsApp Channels via API
Our Cloud API supports WhatsApp Channels, a brand-new feature introduced by WhatsApp. It’s a unidirectional broadcast tool where administrators can send text, photos, videos, stickers, and polls. And users receive push notifications of updates from the channel like a private message.
To send a message to the channel you need to know the channel ID.
In order to find out the identifier use the following method: GET /newsletters
curl --request GET \
--url 'https://gate.whapi.cloud/newsletters?count=100' \
--header 'accept: application/json' \
--header 'authorization: Bearer iB1vpNBhV4sbdSPwVwcczBDCXo2bBmcs'
The channel ID looks like this: 120363171744447809@newsletter
Once you know the channel 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 channel ( 120363171744447809@newsletter ) you want to send the message to. And in the “body”, the text of the message
curl --request POST \
--url https://gate.whapi.cloud/messages/text \
--header 'accept: application/json' \
--header 'authorization: Bearer iB1vpNBhVwc4sbdSPwczBDVCXo2bBmcs' \
--header 'content-type: application/json' \
--data '
{
"typing_time": 0,
"to": "120208836317406034@newsletter",
"body": "Hello, World!"
}
'