If you already have a Meta app
If you do not have a Meta app
After creating your Meta app, you need to connect it to a WhatsApp Business Account. This connection allows your app to access the WhatsApp Cloud API and send messages on behalf of your business.
Note: If you created a new Meta Business Portfolio during app creation, a WhatsApp Business Account may have been automatically created for you. Verify the connection in the API Setup section before proceeding.
hello_world template message to a phone number of your choosing.
{
“object”: “whatsapp_business_account”,
“entry”: [
{
“id”: “215589313241560883”,
“changes”: [
{
“value”: {
“messaging_product”: “whatsapp”,
“metadata”: {
“display_phone_number”: “15551797781”,
“phone_number_id”: “7794189252778687”
},
“contacts”: [
{
“profile”: {
“name”: “Jessica Laverdetman”
},
“wa_id”: “13557825698”
}
],
“messages”: [
{
“from”: “17863559966”,
“id”: “wamid.HBgLMTc4NjM1NTk5NjYVAGHAYWYET688aASGNTI1QzZFQjhEMDk2QQA=”,
“timestamp”: “1758254144”,
“text”: {
“body”: “Hi!”
},
“type”: “text”
}
]
},
“field”: “messages”
}
]
}
]
}
The temporary access token you created to send the hello_world template message expires quickly and is not suitable for development purposes. So you should create a permanent token for use across the WhatsApp Business Platform.
When you responded to your earlier test message, you triggered what is known as a customer service window. This 24-hour window allows you to send non-template messages to users on WhatsApp. With the customer service window now open, you can send a non-template message to yourself. To do this, insert your test phone number ID, the system user access token, and your phone number in the code sample below, then paste the code into your terminal and run it.
curl ‘https://graph.facebook.com/v23.0/<TEST_BUSINESS_PHONE_NUMBER_ID>/messages’ \
-H ‘Content-Type: application/json’ \
-H ‘Authorization: Bearer <SYSTEM_USER_ACCESS_TOKEN>’ \
-d ‘
{
“messaging_product”: “whatsapp”,
“recipient_type”: “individual”,
“to”: “<WHATSAPP_USER_PHONE_NUMBER>”,
“type”: “text”,
“text”: {
“body”: “Hello!”
}
}’
After successfully sending your message, check your test webhook application to view the webhook event confirming the message receipt.
The WhatsApp Cloud API enables you to send messages and receive webhooks—these are the fundamental building blocks for messaging integration. Beyond these basics, the API offers additional features such as group creation and management, as well as support for calling.