Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sending a message to whatsapp groups through twilio with asp.net core

I am trying to use whatsapp business api for my application with twilio. I already have read the documentation of whatsapp business api. My question is, can we use twilio to send the messages to different whatsapp group based on id. For example, If I have 3 groups such as Students, Professors, Assistants and based on each different group I want to send a specific message such as Hi to Students, Hello to Professors and Hey to Assistants. What I know till now that Whatsapp differentiate everything with specific id, for instance, chat.whatsapp.com/DeUzzel9O13231

I also have worked with the twilio and whatsapp api where you can send a message from your twilio number to your whatsapp number like below

using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;


class Program 
{
    static void Main(string[] args)
    {
        // Find your Account Sid and Token at twilio.com/console
        // DANGER! This is insecure. See http://twil.io/secure
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";

        TwilioClient.Init(accountSid, authToken);

        var message = MessageResource.Create(
            body: "Join Earth's mightiest heroes. Like Kevin Bacon.",
            from: new Twilio.Types.PhoneNumber("+15017122661"),
            to: new Twilio.Types.PhoneNumber("+15558675310")
        );

        Console.WriteLine(message.Sid);
    }
}

The code above is only for sending a message to a specific number. Can I do the same thing with the groups? If yes, How? Is there any documentation for that?

Thanks.

like image 325
Farrukh Ahmed Khan Avatar asked May 13 '19 14:05

Farrukh Ahmed Khan


People also ask

How do I send a WhatsApp message using Twilio?

Sign up for (or log in to) your Twilio Account and activate the Sandbox. Before you can send a WhatsApp message from your web language, you'll need to sign up for a Twilio account or sign into your existing account and activate the Twilio Sandbox for WhatsApp.

Can WhatsApp API send group messages?

With Twilio's Conversations API, you can implement group chats in WhatsApp, a feature which is not offered natively in WhatsApp's API. With this code sample, you can implement multi-participant chat for up to 50 people that users can opt into and communicate through a single Twilio WhatsApp sender (business profile).


Video Answer


1 Answers

Doesn't look like a supported feature just yet.

"Can I send messages to WhatsApp groups or manage groups?

Currently, our API does not support messaging with or managing WhatsApp groups. We expect to add support for groups in the future."

Source: https://www.twilio.com/docs/sms/whatsapp/best-practices-and-faqs#frequently-asked-questions-on-whatsapp-integrations

like image 178
KingCronus Avatar answered Oct 11 '22 14:10

KingCronus