Send announcement

How to send a message (announcement) to the community via API

To send a message (to post announcement) to a Community, you need to find out the exact ID of the group attached to that community.

Read more about it here: Important aspects of the API Community beta test


Markers that you can use to automatically determine which group you need to use

  1. Find groups with the same name as your community, excluding the community ID you received in the response;

  2. Find a group that has the parameter β€œannouncements”: true

Sending an announcement to a community is completely identical and follows the rules for sending a message to a group. To send this message, use this endpoint

POST https://gate.whapi.cloud/messages/text

curl --request POST \
     --url https://gate.whapi.cloud/messages/text \
     --header 'accept: application/json' \
     --header 'authorization: Bearer {your_token}' \
     --header 'content-type: application/json' \
     --data '
{
  "to": "120363297265854901@g.us",
  "body": "My first announcement"
}
'

We wrote more about how to post to a group here: Send Group message

Last updated