20

I know about send message to any number using WhatsApp official API using

https://api.whatsapp.com/send?phone=

But is there any way to send message to WhatsApp Group is user is joined that group. I have a form and want this form data to be shared in our whatsapp group on click.

vela
  • 147
  • 10

5 Answers5

11

The WhatsApp Business API Client supports a subset of the features provided by the WhatsApp applications you already know from Android, iOS, Web and other platforms including end-to-end encryption. The difference is that this application can be deployed on a server, providing a local API that allows you to programmatically send and receive messages and integrate this workflow with your own systems (CRMs, customer care, etc.).

So in Business API its possible to send messages to the group also. You can check here. The following are the sample command for sending group message :

POST /v1/messages   
{
    "preview_url": false | true,
    "recipient_type": "group",
    "to": "whatsapp-group-id",
    "render_mentions": true | false,
    "type": "text",
    "text": {
        "body": "your-text-message-content"
    }
}
joe
  • 365
  • 1
  • 5
  • 16
  • 7
    notice that the WhatsApp group API is being deprecated on July 2020. https://developers.facebook.com/docs/whatsapp/api/groups/ – Maoritzio Jun 24 '20 at 18:08
  • 8
    Why are they even doing this? Its a feature that Is perfect for my needs and they're removing it? Jeez. – Max Jun 24 '20 at 20:31
  • 2
    I think due to some security issues. May be within months it will be returned back !! – joe Jun 25 '20 at 10:08
  • 2
    The business API isn't really what you want to just send an automated message to a WhatsApp group. I also noticed recipient_type MUST be individual now, so it looks like they don't support sending messages to groups now. https://developers.facebook.com/docs/whatsapp/api/messages#parameters – Phil Aug 13 '21 at 22:40
  • 6
    Hello, is there any update on this now? I need to send a message with pdf document to a WhatsApp group, I didn't find any working solution and the research got me here. Can anyone please let me know if this is possible now? – Aamir Khan Maarofi Apr 19 '22 at 02:55
  • 1
    looking for same thing :) – MUHAMMAD ILYAS Jun 12 '22 at 07:33
  • Still same. Now WhatsApp is available in Graph API. Hopefully, we can expect more APIS – joe Jun 13 '22 at 13:12
  • I contacted Meta about this API, and indeed it does not work anymore: " Hi Eyal We previously supported Group for OnPrem API but have however stopped it. You will not be able to add API numbers to group. Hope this clarifies. " @joe - Maybe you can update your answer, and write that this does not work anymore? – pinkasey Dec 06 '22 at 06:33
  • 1
    As per Meta's comments, they are working on group messaging functionality. Anyway group is not available right now. – joe Dec 06 '22 at 12:11
3

Currently, this is not possible with WhatsApp. Other messenger have an open API (e.g. Facebook messenger) which allow such features. See here.

Molitoris
  • 935
  • 1
  • 9
  • 31
1

from the alternatives here is what i found that might help: whatsmate -> only can send messages to group, no api to list existing groups

twilio whatsapp group messaging -> only can send invite to join group and join group api

maytapi -> allows creating and fetching whatsapp group api, send message as dm as well as to a group supported

0

WhatsApp does not provide an official API for interacting with group chats. However, there are some third-party options that allow you to programmatically send messages to a WhatsApp group. These solutions typically involve using a web version of WhatsApp or a headless browser to simulate a user interacting with the app.

Here are some steps you can follow to use a third-party solution to send messages to a WhatsApp group:

Find a third-party service or library that provides access to the WhatsApp API. Some options include Yowsup, Chat-API, and WhatsApp Web API.

Sign up for the service and obtain any necessary API keys or credentials.

Follow the instructions provided by the service to set up the API and send messages to a group chat. This may involve installing a library, setting up a webhook, or making HTTP requests to the API.

Write code to use the API to send messages to the group chat. This will typically involve constructing a message payload and making an HTTP request to the API endpoint.

It's important to note that the use of unofficial APIs to access WhatsApp is against the app's terms of service and may not be allowed. Use of these APIs is also generally less reliable and secure than using an official API.

neeraj sharma
  • 135
  • 2
  • 4
  • AI-generated answers are not accepted on this site. See https://meta.stackoverflow.com/questions/421831/temporary-policy-chatgpt-is-banned – Eric Aya Aug 24 '23 at 08:50
0

Of the current options for year 23, the official solutions are no longer suitable. Meta has refused to interact with groups and, as far as I know, they are not even testing this direction. Therefore, there is only hope for alternative providers that work on the basis of web api (ultramsg, whapi cloud, maytapi). Some are more stable, some are faster, some are more convenient, but it's nice that it's cheap, although there is a security nuance. Too bad Meta has abandoned group messaging, it was very convenient.

Hafiz
  • 39
  • 3