Whatsapp API Setup
Last updated
Was this helpful?
Last updated
Was this helpful?
This guide walks you through the process of setting up WhatsApp integration using Meta’s WhatsApp Cloud API.
Before setting up the WhatsApp integration, ensure you have the following:
A Meta Developer Account
A Meta Business Account
A Phone Number registered with WhatsApp
A Meta App with WhatsApp enabled
Go to the .
Click Create App and select Business as the app type.
Enter your App Name and Contact Email.
(Optional) Select a Business Portfolio if you have one.
Click Create App and enter your password for confirmation.
On the "Add Products to Your App" page, locate WhatsApp and click Set Up.
Select your Meta Business Account or create a new one.
Confirm your account via the email link sent by Meta.
In the Meta App Dashboard, go to WhatsApp > Quickstart.
Under Select Business Portfolio, choose an existing portfolio or create a new one.
Navigate to WhatsApp > API Setup.
Copy the Temporary Access Token (expires after 23 hours; we will generate a permanent token later).
Under Step 1: Select Phone Numbers, copy the Phone Number ID.
In the To field, add a recipient phone number for testing.
Click Send Message to test the API. You should receive a message from the configured WhatsApp number.
Under App Settings > Basic, copy the App ID and App Secret.
In the Meta App Dashboard, go to Business Settings.
In the left menu, navigate to Users > System Users.
Click Add and enter a System Username.
Assign the System User Role (Admin or Developer).
Click Create System User.
Under Assigned Assets, click Add Assets.
Select your app, enable Manage App, and save changes.
Click Generate Token and choose your app.
Select the following permissions:
whatsapp_business_messaging
whatsapp_business_management
Click Generate Token and copy the Permanent Access Token.
In the Meta App Dashboard, navigate to WhatsApp > Configuration.
Under Webhook, click Edit.
Set Callback URL to https://app-whpbk.hostelmate.co/webhook
.
Enter a Verify Token (a custom token you create for security).
Click Verify and Save.
Under Webhook Fields, click Manage and enable messages.
Use the following credentials to configure WhatsApp in your system:
WhatsApp Token (Permanent Access Token)
WhatsApp Phone (Your registered phone number)
WhatsApp SID (Your System User ID)
WhatsApp Number ID (Phone Number ID from Meta)
To use WhatsApp messaging effectively, there is a set number of templates that must be predefined. All templates must adhere to the following rules:
Templates need to be in English ("en") for now—other languages aren’t supported just yet!.
It's best to select templates as "Utility" since they're more cost-effective to use.
Templates must not contain any variables, images.
The templates should be predefined and approved for WhatsApp messaging.
List of Required Templates:
new_guest - This message is sent to a guest who is booking your hostel for the first time, welcoming them and providing initial details about their stay.
new_booking - This message is triggered whenever a guest makes a new booking, confirming their reservation details.
extend_booking - Sent when a guest books an additional stay that directly follows an existing reservation, ensuring continuity in their lodging.
canceled_booking - This message is sent when a guest cancels a booking, notifying them that their reservation is no longer active.
arriving_soon - Sent one day before the guest's scheduled check-in date, reminding them of their upcoming stay.
Send a test message via the Meta App Dashboard.
Verify that your backend correctly processes and responds to WhatsApp messages.
Deploy the integration into production.
For further details, refer to the .