Hello everyone,
I am working on a whatsapp chatbot for my business. I have remixed the whastapp-cloud-api-echo-bot project for the same (for configuring webhooks). Now, I have updated the settings (like callback url, verify token, webhook fields) as described in the project’s steps. Now, I am trying to run a test to see if I can receive messages on glitch via my fb chatbot app. So, I clicked on ‘Test’ for messages field. and then, clicked on ‘Send to server v22.0’. After doing this, I was expecting to see the message in ‘glitch logs’. However, there is no update there. Am I missing something?
are you sure that the code is correctly forwarding the test message to the console?
I’ve seen a few complaints on this forum about whatsapp not being able to communicate with a glitch project. are you using web hooks? I think the conclusion in multiple threads has been that whatsapp does not send a suitable user-agent header and glitch won’t accept those requests and forward them to your project
No, I am not sure of that. I am following “Sample App Endpoints - WhatsApp Business Platform - Documentation - Meta for Developers” guide to set up the webhooks for my chatbot app. After setup, there is a step to send a test notification to the webhook endpoint. I tried the same and did not see anything in console.
My webhook url is: ‘https://slash-brassy-riddle.glitch.me/webhook’.
Please see following screenshot of my meta whatsapp chatbot app configuration.
In this list, there is ‘messages’ field. I clicked on ‘Test’ and it generated a sample data with a button ‘Send to server v22.0’. Upon clicking on the button, I got the notifcation that message has been successfully sent to the server,
However, nothing updated in the logs console of glitch. How do I check if the code is forwarding the message to the console?
@wh0 Yes, I am configuring webhook by following the meta guide for the same. The url: “https://developers.facebook.com/docs/whatsapp/sample-app-endpoints”. lists the steps to configure webhooks. In this guide, after the endpoint is ready, configuration steps are listed which explain how to make the configuration changes in the meta app. After making necessary configuration changes, we have to send sample notification to the glitch endpoint by clicking on ‘Test’ for messages field. This creates a sample payload, which I do not know how to edit. And clicking on ‘Send to Server’ should supposedly send it to the glitch server but I did not receive anything on glitch.
Please explain how can I make suitable changes in the request header?
Hi @Lukew96 , no I am not sure if the test message is correctly forwarding to the console. I am simply following the meta guide to set up webhooks for the whatsapp chatbot in order to receive notifications. It asked me to remix a glitch project “whatsapp-cloud-api-echo-bot”.
After doing the remix, setup and configuration of glitch project, I did the respective configuration changes in the meta app too like editing the callback url, verify token and subscribing to all webhook fields (except for 2: message_echoes and messaging_handovers - which for some reason, keep throwing error “Failed to subscribe to the field”).
Then, as per the guide, I tried to send a notification to my webhook endpoint by clicking on ‘Test’ in the messages row.
This generated a sample data with a button at the end that said: “Send to Server v22.0”. Upon clicking on the button, I got a notification that message has been successfully sent to the server however, I did not get anything in the logs screen.
that’s the sad thing about this, we’re not in control of how WhatsApp sends the request, and we’re not in control of how glitch requires certain headers. and I feel like the other threads about this ended on about the same note.
if you’re interested in building a solution for this problem, maybe you could try setting up a fastly “compute” service to receive the webhook, add the user agent header, and forward it to a glitch project.
p.s. why is the above Issue with Whatsapp Cloud Api Echo Bot Project - #5 from OP hidden
So, I have done some tests (as advised by chatgpt) and was able to check that webhook in itself is running properly. I am able to send a message via powershell curl script however, the meta app is not able to trigger the communication. So, maybe some issue in that path. How do I set up the fastly compute service?
Glitch has flagged my responses because they had hyperlinks and screenshots
looks like they’ve reinstated those posts.
here’s a tutorial on setting up edge compute
if you can get that set up with glitch, then the next thing will be to program it to add a user-agent header
you might also be able to add the header using a fastly deliver service too. here’s a tutorial on that, in case the compute approach is overkill