Closed eos1d3 closed 2 months ago
Hello and welcome! We're glad to see that you've opened your first issue. We appreciate your contribution and would love to hear more about the problem you're experiencing. Our team is actively monitoring this repository and we will do our best to respond to your issue as soon as possible. Thank you for using our project and we look forward to working with you!
Hello @eos1d3,
From WebHookExample, it does not setup Token or URL.
You should implement the webhook APIs. This library provides an interface for the event received on the webhook from WhatsApp.
You must implement 2 endpoint without authorization
This is an example of verify endpoint:
@GET
@Path("/webhook")
public Response verify(@NotNull @QueryParam("hub.mode") String mode,
@NotNull @QueryParam("hub.challenge") String challenge,
@NotNull @QueryParam("hub.verify_token") String verifyToken);
This is an example of processEvent endpoint:
@POST
@Path("/webhook")
public Response processEvent(@NotNull String payload);
The examples are written with Quarkus and Java 11.
1) The token must be verified from you in business logic. 2) The URL must be in HTTPS and set it into https://developers.facebook.com/apps/{YOUR_APP_ID}/whatsapp-business/wa-settings/?business_id={YOUR_BUSINESS_ID} 3) See this guide to set the webhook.. https://developers.facebook.com/docs/whatsapp/cloud-api/get-started#configure-webhooks 4) To test fastly I recommend you using Glitch or Heroku.
Hope this may be helpful!
Thanks a lot. I will try later with a real test.
Hello,
Thanks @pcomp96 for your contribution.
@eos1d3, as @pcomp96 mentioned, you need to implement the endpoints for the webhook.
You can use this library to deserialize an event received on the webhook:
public void processEvent(@NotNull String payload);
WebHookEvent event = WebHook.constructEvent(payload)
Hi, thanks for your work... I need full sample the webhook ?
Hi,
I am studying how to use this library. The only thing I am confused is how to use WebHook. From WebHookExample, it does not setup Token or URL. Does this library need another web server running to receive WebHook events? And how to link the server to this library?
I also do not find any user callback to get WebHook event, nor any WebHook subscription in this library.
Need further clarifications for this. Thanks!