WhatsApp Cloud API Integration
What is WhatsApp Cloud API?
WhatsApp Cloud API allows businesses to send and receive messages using cloud hosted version of it's WhatsApp Business API. By offering free, secure and cloud-based hosting, businesses can scale their customer communication and reduce the go-live time.
WhatsApp Cloud API feature?
- Businesses and developers can build on top of WhatsApp reducing the onboarding time substantially.
- Hosting cost is eliminated.
- Managing the message is possible across devices, up to 10 right now.
- New feature are available as soon as they are released.
Sandbox Setup
Sandbox is for testing. It is easy to use. You need to have an app created in Meta for Developers myapps. Here are the steps to create a new app if not already created.
Go to Meta for Developers. If you are visiting for the first time, you will see get started button. Click on "Get Started". Else, go to step 2.
Navigate to MyApps buttons on the top right corner.
Click on create app and choose "Business" as app type and click on next.
Enter the display name for the app.
If you have business account then select it or leave it as it is and click on submit button.
Scroll down on the page and select WhatsApp for setup.
Now create a meta business account by selecting "Create a business account" and click on continue.
Now you will see the get started page where you can see the temporary access token. Copy this token to paste it in the sandbox setting page on Kommunicate Integration.
Here a temporary phone number(phone number id) is generated for testing purpose. Copy this temporary phone number id and update on the sandbox setting page on Kommunicate integration.
Copy the WhatsApp Business Account Id and update the same in the integration page on Kommunicate.
Add a recipient (To) phone number and verify it with the code which WhatsApp will send on the number. Update the same number at the time of WhatsApp Cloud API Integration on the Kommunicate and click on save button.
Now click on test button, for testing and getting the messages on the "Phone Number" mentioned in the sandbox page. Test the flow with the API which is given and see how messages are flowing from test number to the recipient number.
After testing, you can add a phone number and verify it using a code which WhatsApp sends. This is actual business number which you want to use for messaging your customer. This number will get added to the from number on the get started page.
Check the API version from the configuration section from the left panel in the setting->advanced tab as shown below. You will need to enter it on the Kommunicate Dashboard at the time of integration.
Setup the Webhook
You will need to create a webhook entry for getting messages in Kommunicate. This can be done from the MyApps → webhooks from the left side panel. User should add the below given entry for Kommunicate and save the same.
Enter the URL: https://omni-channel.kommunicate.io/whatsapp/cloud-api/webhook
Verify Token: kommunicate_private_access_token
Once you have saved the webhook, click on manage and give the messaging permissions shown in the below given screen shot as “messages”.
Subscribe to "messages"
Once you have given the permission it will show as “subscribe” as shown in the screen shot below.
Go Live
You should follow the below given instruction to generate the permanent app token and update the same on the go live tab. Here are the steps and fields values to be added/update to complete the setup.
Go to the apps and click on the app name which is showing on the tile on the landing page "MyApps". This will bring the user to the setting page.
Navigate to the system user menu item from the left panel. Click on "Add" for adding a new user which will have "Admin" role. This step is valid when admin user is not already created. If it is already created then you should be logged in as admin.
Now add asset to this system user by clicking on "Add asset" button. Click on "apps" from the window that opens.
Select your app name radio button, and give full control by clicking on the slider button next to "full control", manage app and save changes
Now generate a permanent token by clicking on the "Generate token" button for the selected app.
Ensure that "WhatsApp_business_messaging" & "WhatsApp_business_management" is selected in available permission before clicking on generate token on the modal window.
Now copy the generated token. This token needs to be updated in the integration go live tab to complete the setup and start sending the messages to your users.
Rate and plans
Customer is not charged for first 1000 conversation per month. After the 1000 conversation user is charged accordingly to region and county they are located in. Conversation are changed and calculated based on 24 hours session for any conversation. We as Kommunicate need not handle the payment parts of the WhatsApp cloud API. For more details refer the links give below.