With the Cloud API, hosted by Meta, Meta’s integration of the WhatsApp Business Platform, your apps can use WhatsApp to send and receive messages to create an engaging experience for your customers.
Make sure you do the following before you get started:
- JDK 11 or greater installed
- Register as a developer at Meta for Developers.
- Ensure your Meta account is linked to a Meta Business account.
#Connect cloudAPI to java:
-
Create an app on Meta for Developers. Start by visiting Meta for Developers and clicking My Apps. Then, click Create App and select Business as the app type.
-
Provide the requested details, including the app name and contact email address, and select your business account from the dropdown. Once the app is created, scroll down and click Set up from the WhatsApp card.
-
Now that your app is created in the Meta for Developers console, open VS Code and import the Java project.
-
Some parts of this code need to be replaced with your own details. These are marked with chevrons, like . Make sure the number you’re sending a message to includes the country code and is formatted correctly.
5.On the Getting started page in the Meta for Developers console, there’s an example cURL request that provides details about which URL you need to call, the headers you should provide, and an example payload to include as the body. Copy the phone number id from that url and paste it in your code in the place of
-
Copy the Authorization token in the next line and paste it in the place of .
-
Provide the target mobile number in the place of to send them the messages, make sure to add and validate the target phone number in the getting started page before using it.
Incase of queries, write to paneerselvam1157@gmail.com