Whatsapp cloud API enable Whatsapp_business_messaging permission
I have been trying to send Whatsapp messages using cloud API, but its expecting to enable Whatsapp_business_messaging permission which is by default disabled when associating with any app that has been created.
https://developers.facebook.com/docs/whatsapp/cloud-api/get-started#get-access-token.
I didn't find any documentation pertaining to enable the above mentioned permission. Kindly assist.
In order to enable the permission you need to follow these steps:
1. Sign into the Meta Business Suite. 2. Locate your business account in the top-left dropdown menu and click its Settings (gear) icon. 3. Click Business settings. 4. Navigate to Accounts > WhatsApp Accounts. 5. Select the appropriate WhatsApp Business Account. 6. Select the WhatsApp Account Access tab. 7.Click the +Add people button. 8.Select the appropriate system user and assign appropriate access levels on the WhatsApp Business Account.Make sure you generate your system token after updating the permissions so it is generated with the new permissions you need.
More details can be found at https://developers.facebook.com/docs/whatsapp/business-management-api/get-started/#whatsapp-business-account-control
Yes, WhatsApp Cloud API is now public.
With the Cloud API, businesses can directly get access to WhatsApp Business API from Facebook, in minutes.
For more info check out this WhatsApp Cloud API Guide.
I recently made an open-source python wrapper for newly WhatsApp Cloud API to help developers easily get started, You really wanna have a look at it https://github.com/neurotech-HQ/heyoo.
Installation
pip install --upgrade heyooHere is the sample code to send a message ;
>>>from heyoo import WhatsApp >>>messenger = WhatsApp('TOKEN', phone_number_id='104xxxxxx') >>>messenger.send_template('hello_world', 'your number')For Javascript developers please have a look into Heyhooh
Installation
npm install heyoohHere how sending to send messages;
import WhatsApp from heyhooh let messenger = new WhatsApp('TOKEN', phone_number_id='104xxxxxx') messenger.send_template("hello_world", "255757xxxxxx")For PHP Developers whatsappcloud-php
Installation
composer require zepson/whatsappcloud-phpHere how the code to send a message;
<?php require_once 'vendor/autoload.php'; use zepson\Whatsapp\WhatsappClass; $token = 'YOUR_META_WHATSAPP_APP_ACCESS_TOKEN'; $phone_number_id = '10726082513218961'; //send message $tsap = new WhatsappClass( $phone_number_id, $token); $sendtsap = $tsap->send_template('hello_world', '255654485755'); print_r($sendtsap);Edited
WhatsApp cloud API is Now Public!
According to their docs,
To start using it for development prepose
Register as a Meta Developer Enable two-factor authentication for your account Create a Meta App: Go to developers.facebook.com > My Apps > Create App. Select the "Business" type and follow the prompts on your screen. From the App Dashboard, click on the app you would like to connect to WhatsApp. Scroll down to find the "WhatsApp" product and click Set up. the onboarding process performs the following actions: our App is associated with the Business Manager that you chose A WhatsApp test phone number is added to your business. You can use this test phone number to explore the WhatsApp Business Platform without registering or migrating a real phone number.for more info please refer to whatsapp cloud getting started docs