Reputation: 33455
I'm trying to sketch the design for an app that will let users automate some actions based on received WhatsApp messages, like updating their appointment calendar.
To eliminate complexity irrelevant in this context, let us suppose I'm trying to design an app that lets users sign up to be alerted whenever they receive a WhatsApp message containing the word "elephant".
Twilio seems to be the most likely/mainstream way to do this.
The information I have found so far, can be paraphrased as 'here is how to use the Twilio API to automate actions when you receive a WhatsApp message'.
But that's not quite what I'm looking for. I'm not trying to write an app that alerts me when I receive a message containing the word "elephant". I'm trying to write one that lets many users sign up to each be alerted when they receive such a message. That means Alice signs up with her WhatsApp number, Bob signs up with his WhatsApp number etc., my app would presumably need to supply this list of numbers to the Twilio API, with a request for callback when a message is sent to any of the numbers. (Then my app needs to check my database to associate the number with the user, so that only the correct user is notified. But it's obvious how to do that part.)
How to do this with the Twilio API? I imagine a good answer could consist of any of:
Here is some sample code to do it.
Here is the documentation page that I overlooked.
Twilio doesn't support this use case, but here is an alternative service that does.
Twilio doesn't support this use case, I'm out of luck unless my users are enthusiastic enough to each sign up for their own Twilio account. (Complete with each having to go through a captcha that I swear modern AI could probably have solved in fewer tries than it took me. Humans are going to start needing to use AI assistance to solve these things. But I digress.)
Something else I haven't thought of?
Upvotes: 0
Views: 178
Reputation: 3851
Your idea for automating actions based on specific keywords received in WhatsApp messages sounds interesting. However, there are some significant limitations imposed by the way the WhatsApp API operates that would impact your intended design.
It's important to understand that WhatsApp, by policy, does not allow unrestricted access to messages due to privacy and security reasons. Consequently, their API does not offer the functionality to monitor messages directly for keywords across multiple users.
Twilio’s WhatsApp Business API allows you to send and receive WhatsApp messages to and from numbers that you purchased with Twilio and linked to your Meta Business manager account, but it doesn't facilitate a mechanism to monitor incoming messages for all registered users.
Upvotes: 1