Message API Integration with BSP
dennyabrain opened this issue · comments
Overview
We'll create a web server to process messages coming in from the BSP and sending messages to the BSP.
The API documentation is here
Incoming Messages
We'll provide an webhook /gupshup
(tentative name) to handle all incoming messages from Gupshup. Our API needs to process incoming messages right away and respond with 200 OK. If our response time times out their request, they will throttle their outgoing requests (think exponential backoff) which will affect responsiveness of the tipline for the users. We'll have to scale up our web server and postgres server accordingly (needs strategy)
Outgoing Messages
There are two ways to send messages to users - Session Messages and Template Messages. Read Documentation.
All messages sent to a query after 24 hours will use a whatsapp feature called "Template Messages". User's need to have opted in before they can be sent Template Messages. From following this guide on how to opt-in users, I learnt that if users text your number, they are already opted in. So this might not be a problem for our use case. Regardless, we might have to look into the template message related APIs to handle opt-in opt-out scenarios.
I was confused by what this means
The webhook should accept user events: sandbox-start.
But I think it is just a field name in the post request as seen here
So I think our webhook for gupshup (/gupshup/message
) should be usable as is.