whatsapp cloud api enable whatsapp_business_messaging permission - api

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

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

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 heyoo
Here 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 heyooh
Here 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-php
Here 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);

Related

WhatsApp messaging webhook does not work in production mode

I am trying to create a connection between our WhatsApp Business account and our website where we gather all messages sent to our business on different channels (through our own app, text, WhatsApp, ...).
I've followed this tutorial (https://developers.facebook.com/docs/whatsapp/cloud-api/get-started) and have everything set up: our WhatsApp Business is working correctly, I've added a Meta App and I've set up the webhooks with a connection to my node.js backend.
When I click Test next to the "Messaging" webhook, I receive the message on my node.js backend and website. So I know this side is working as it should.
I've then used the Graph API to subscribe my Meta app to the messages with the business id of the WhatsApp with the correct permissions. When checking the subscribed apps with the {business_id}/subscribed_apps endpoint, I can see my Meta app. So I believe everything is set up correctly.
My Meta app is also set to "production".
However, when I try to send a message with my personal WhatsApp to my business WhatsApp, I receive nothing on the webhook.
I checked the logs on my server and nothing is being received, so I know it's not an issue in my node.js backend.
Is there something else I need to do to make this work? Does the Meta app need to be verified to use the webhook in production? If so, how can I do this? The guide for verification says I need a platform and login insctructions, but the Meta app is really only a webhook without an interface.
Thanks in advance.

nodeJS connection with Google API

I am trying to connect hangouts chat API with NodeJS but did not find any documentation related to Oauth in NodeJS, without which I can not connect to APIs. There is a code in Python but is there any thing in Node so that we can do the API call from front end it self.
The Oauth flow is the same for all Google APIs
If there is a quickstart for a specific API in a specific language missing, you can use one from another API.
For example, there is a Node.js quickstart for the Drive API
You can take it as a base and have to modify only 2 things:
Modify
const SCOPES = ['https://www.googleapis.com/auth/drive.metadata.readonly'];
by specifying the scopes you are going to use, for example
https://www.googleapis.com/auth/chat
For building the service, modify
const drive = google.drive({version: 'v3', auth});
to
const chat = google.chat({version: 'v1', auth});
Mind that depending on the application, you might need to use a service account
The documentaiton about implementing a service account in node.js can be found here

Need Whatsapp api for sending messages from my PHP project

i want to know if there is any whatsapp api that can help me to send messages from my php project because after some research i found that whatsapp doesn't have any api for developers..
someone can help me please?
I used Google :
A quick google search with the proceeding query : "WhatsApp PHP API" gives us many results , the first result is a github page made by mgp25 a well known member of the github dev community.
Good luck!
You are absolutely right that whatsapp does not published the api for the such chatting using php .
By the way you can use the sharing uri to share text messages who have whats appp installed in their device or web chat option for whatsapp
Chat API: https://api.whatsapp.com/send?phone=15551234567
Custom URL: Scheme whatsapp://send?text=hello world
First one is used to open chat with the desired phone number and the second one is used to share some test as custom url format.
Whatsapp is now maintain by facebook and it has created a api for business to communicate with customers .
This it has launched api for whatsapp as well as for Facebook instagram .
You can have a look on the documentation portal for whatsapp api for more details
https://developers.facebook.com/docs/whatsapp/api/reference
Also there are partners of Facebook who give ready made solution to the productivity.

Quickblox for android and web using PHP as backend

I was thinking of using the quickblox for my chat requirement.
We want to build a 1-1 chat between a user and admin. User will be logged in from the android and admin will be logged in from the web. We want the functionality for the user to chat with an admin person. Our backend code base is in PHP and both the android and web talks to the backend with rest APIs.
Some can please help me out on where should I start my development from. Can you share any sample code or tutorial to get me started with, it would be really helpful?
It may be solve like this
For PHP admin side
First you need to create the dialog for all the user
Then for selected user you will call the Retrieve_messages api for getting all the user
For sending the message you have to call Create_message
Ref : QuickBlox
For android they have their own SDK for sending and getting the message
Android SDK

How to do Google Sign-In in Meteor

I've tried various tutorials and links on how to get Google Sign-In to work in Meteor to no avail. How can I create a google sign in button on my login page that redirects to my user dashboard--using iron:router perhaps (and shows the persons name in the corner), and restrict the google emails to only .edu accounts?
Also as the admin of the page how would I be able to see the emails/names of all the people who have logged into my website? Is this done through Google Analytics?
Try adding the accounts-google package. You'll need to configure the Google sign in with the application key and secret. The easiest way to do this is to also add the accounts-ui package and using
{{> loginButtons}}
which will display detailed instructions on the steps to follow on the Google page. It will also save your app key and secret tokens appropriately.
Once this is done you'll be okay using the method
Meteor.loginWithGoogle()
as explained in the docs. It takes an optional array of options and a callback function
e.g
Meteor.loginWithGoogle({}, function(error){
if(error)
//Couldn't log in
else
Router.go('/dashboard');
})
Good luck
For Google Sign-in, I would recommend installing the accounts-entry package and configuring it from your browser:
install with latest meteor version
meteor add joshowens:accounts-entry
and for meteor version before 0.9 use
mrt add accounts-entry
For your dashboard redirection, review the documentation for that package on atmospherejs.com which demonstrates how to configure your dashboardRoute:
dashboardRoute: '/dashboard'
The iron-router package is a dependency of accounts-entry, so it will be installed as well.
Access the data by launching the MongoDB shell (after starting your app):
meteor mongo
Query for the accounts using the MongoDB shell:
db.users.find()
This is not handled via Google Analytics