To activate WhatsApp on Click-to-Connect, we'll register your Meta application. 3 pieces of information are required:
- Application ID
- Secret Key application
- Temporary Access Token
To do this, we need to prepare the ground on META. Create and configure :
- A business portfolio
- An application
- A WhatsApp Pro account
Things to know :
- To perform these actions on Meta, you must have a META developer account
- To activate the WhatsApp Pro account, you must have a number capable of answering calls and / or text messages
- Using the META service is free up to certain point, you'll need to register a payment method
Useful META URLs :
- Business Settings : https://business.facebook.com/latest/settings
- WhatsApp manager: https://business.facebook.com/latest/whatsapp_manager
- Your applications: https://developers.facebook.com/apps
- Use of APIS Meta: https://developers.facebook.com/tools/explorer
1. Portfolio creation business
- Log on to : https://business.facebook.com/latest/settings
- In the left-hand column, click on Create a business portfolio
Simply configure and use your Meta administrator's email address
- Create > Next > Next > Confirm
2. Application creation
- Always on this page : https://business.facebook.com/latest/settings
- Click on Applications > Add
- Click on Create a new app ID
-
You are now on the page for configuring your applications : https://developers.facebook.com/apps
-
Fill on application details > Next
- Choose your use case, if none fits, select Other > Next
-
Application type ; Enterprise > Next
- Check details > Send
- Your application has been created and you're now on its Dashboard
- If an error has occurred, check whether or not your app has been created on this page : https://developers.facebook.com/apps
- If it's there, click on the name of your app to land on the Dashboard
Add products to your app
- On the right-hand side of the Dashboard, you can configure 3 products: WhatsApp, WebHooks and Facebook Login for Business
- Copy the app ID at the top of the page and keep it
3. Connect your Application to your Business portfolio
- Back to the page: https://business.facebook.com/latest/settings
-
Click on Applications > Add
- Associate an app ID
- Request access to an application ID
- Your application now appears on your business portfolio
- We now need to assign a user to this application
- Left menu > people
- Choose the person to whom you wish to assign rights
- Assign your application to this user and give him full control
- In the Applications section, you'll now see the person you've chosen with full control over your new App
4. Creating a WhatsApp Business Account
- Always on this page : https://business.facebook.com/latest/settings
- Click on WhatsApp Account > Add
- Fill in details
- Add a phone number and choose how you would like to be contacted to receive the verification code > Continue
- Enter your verification code > Next
- Keep this PIN
- Your WhatsApp Business account has been created
- Keep your WhatsApp Business Account ID
5. Registering your WhatsApp number
- Open the Graph API Explorer : https://developers.facebook.com/tools/explorer
- On the right, select your WhatsApp authorization and your Meta Application, then generate an access token.
- Authenticate yourself
- Select your Application
We will now send 2 requests :
- IPHONE_ID retrieval
- GET / <WABA_ID>/phone_numbers
- WABA_ID = your WhatsApp Business Account ID
- Keep id = PHONE_ID
Save phone number on Business wallet :
- POST / PHONE_ID> / register
- This object must also be pasted into the JSON section on the left
{
"messaging_product": "whatsapp",
"pin": "<YOUR_PIN>"
}
6. META Application configuration
- Back to the page : https://developers.facebook.com/apps
- Select your Application
- In the left-hand column, App Settings > Advanced
- Allow API access to app parameters > Save changes
- In the left-hand column, Facebook Login for Business > Settings
- Integrated browser OAuth connection
- In the "Valid OAuth redirection URI" section, enter the URL according to the C2C instance environment :
- RED : https://red-c2c-admin.openrainbow.io/main/settings/global/
- PROD : https://click-to-connect-admin.openrainbow.io/main/settings/global/
- Save Changes
7. Registering and activating your META Application on Click-to-Connect Administration
Remember, 3 pieces of information are required :
- Application ID (you have it)
- Secret Key application
- Temporary Access Token (you can generate a new one in the API Graph Explorer)
Recovering your App Secret Key :
- Back to the page : https://developers.facebook.com/apps
- Select your Application
- App Settings > General
- Secret Key > Show
Log in to Click-to-Connect Admin :
- Settings > WhatsApp
- Fill in the form fields with the required information and save
- You are then redirected to the OAuth Meta > Reassociate
- Then you are redirected to Click-to-Connect Admin
Activation may take few seconds, but you'll eventually see WhatsApp messages that you can personalize
- If there messages do not appear, feel free to reload the page to make sure the activation has worked properly.
- Retrieve the ID of your User Bot connected to Click-to-Connect Admin
- Click on the icon at the top right of the Application to discover it
- Keep this ID
8. Webhooks configuration
- Back to the page : https://developers.facebook.com/apps
- Select your Application
- In the left-hand column, Webhooks
Callback URL :
- RED : "https://red-c2c.openrainbow.io/webhook/meta/whatsapp/<RAINBOW_USER_BOT_ID>
- PROD : "https://click-to-connect.openrainbow.io/webhook/meta/whatsapp/<RAINBOW_USER_BOT_ID>
Check Token :
- Enter the access Token entered in Click-to-Connect Admin
- Check and save
- Then subscribe to all options
We're now going to do the same thing in the WhatsApp section
- In the left-hand column, WhatsApp > Configuration
Callback URL :
- RED : : "https://red-c2c.openrainbow.io/webhook/meta/whatsapp/<RAINBOW_USER_BOT_ID>
- PROD : : "https://click-to-connect.openrainbow.io/webhook/meta/whatsapp/<RAINBOW_USER_BOT_ID>
Check Token :
- Indicate the access token in Click-to-Connect
- Check and save
- Then subscribe to all options
9. Final Check
- On the WhatsApp Manager page : https://business.facebook.com/latest/whatsapp_manager
- In the left-hand column : Account tools > Phone numbers
You can see your WhatsApp Business account number, if it shows a 'Connected' status and high quality, everything went well
This is where you can customize its appearance in the WhatsApp application ( your logo for example)
10. Test your configuration
- All that's left is to test your configuration
- Send a WhatsApp message to your WhatsApp Business Account
- If it responds all is well, if not contact Click-to-Connect support