This is how to set up a meta account for Whatsapp (Whatsapp Business)
To deploy a chatbot on WhatsApp Messenger, all you need is:
1. Sign up for a Meta Developer Account: First, you need to sign up for a Meta Developer Account by going to https://developers.meta.com/ and clicking the "Login" button.You can use your facebook account associated with your company or you can follow the instructions to create a new account to login.
2. After you have created a meta developer account.
Select Create an app >> Business
You need to add an app name, contact email and connect it with your business account.If your facebook account is connected to the business account you would be able to find it in the dropdown menu.
3. Add whatsapp to your app , you can create a test number for which Meta will provide you with a temporary token that needs to be refreshed every 24 hours.If you already have a business account,you can add that from the drop down menu and a new test phone number will be created by Meta. To set up a permanent token see Setting up a permanent token.In the callback url , you need to add the Blitzico url(See step 5 to get details on setting up blitzico). Verify token is a token setup by the user.The user can add any text/number here.
5. During the setup of WhatsApp webhook for the first time in Blitzico,Meta sends a parameter named "hub.challenge" as part of the request. To confirm that Blitzico has successfully set up the webhook, it should respond with only the value of the "hub.challenge" parameter. Therefore, Blitzico must ensure that its response to the initial GET request only includes the value of "hub.challenge" and nothing else.To set up Blitzico , Add a Trigger Via Api with Get request , a function node and a response node , Copy the below code to function node
msg.payload = msg.query["hub.challenge"]
return msg;
Copy the trigger via api URL and add it to the Callback url on whatsapp , add some text or numbers to verify token(Please save it somewhere) then click on verify and save.
6. To get all the events from whatsapp to Blitzico , you need to subscribe to messaging on webhooks.Click on Manage(Webhook fields) and subscribe to messages.
7. After you have subscribed and set up the webhook, Change the Blitzico flow to something like this.Since Whatsapp uses webhook we need to send an api response for all the events we receive on Blitzico.
8. Go to Whatsapp>>Getting Started.You can add your number here and test if you are receiving a message from whatsapp.
To test if you are receiving the webhook properly, You can send a reply to the Hello Message you got from this.You should be able to see the json in blitzico logs.
To set up a permanent token you need a Meta Business Account.You will need to create a system user and connect that user to your Meta developer app.
2. Go to Settings >>Business Settings>>System users>>Add. Enter system username and System user role.
3. Now you will need to associate that user with the Meta App.For that go to Add Assets >>App. Select your app.You can give partial access and full access to the user.After giving the access click on Save changes.
4. Click on generate new token >> Select your app from the drop down menu.Make sure whatsapp_business_messaging,whatsapp_business_management are turned on.Click on generate token.
Please save the Access Token somewhere as it is not saved in facebook.This is a permanent token that can be used for this meta developer app.
To migrate a number, you must first delete the WhatsApp Messenger or WhatsApp Business App account.
Navigate to the Meta App that is set-up for WhatsApp by going to developers.facebook.com > My Apps > Select your App.
View this for more information
Migrate an Existing WhatsApp Number to a Business Account - Cloud API
Add a Phone Number - Cloud API
WhatsApp Business Platform - Documentation - Meta for Developers
Using Authorization Tokens for the WhatsApp Business Platform