New Way to Send & Receive WhatsApp Messages (Business Cloud API)
Summary
TLDRIn this tutorial, Juan Estefan Garcia demonstrates how to send and receive WhatsApp messages using the new WhatsApp Business API, specifically the cloud version. He guides viewers through the process of setting up a Meta developer account, creating an app, and integrating WhatsApp. The video covers the use of message templates, sending test messages, and receiving notifications via webhooks. Juan also mentions an upcoming video for non-technical users and emphasizes the need for a business account and production phone number to go live and send messages globally.
Takeaways
- 😀 Juan Estefan Garcia introduces a tutorial on using the WhatsApp Business API, specifically the cloud version, for sending and receiving messages.
- 🔗 He encourages viewers to watch a previous video for context on the new WhatsApp Business API, which clarifies many concepts.
- 💻 For non-technical viewers, a future video will demonstrate how to use the API without coding, making it accessible to a broader audience.
- 🌐 The WhatsApp Business API documentation is a valuable resource, especially for developers looking to integrate the API into apps.
- 📝 To get started, one must be registered as a Meta developer, which involves creating a developer account on Facebook and setting up an app.
- 📱 The tutorial covers the process of setting up a WhatsApp integration, including creating a test phone number and adding recipient numbers for testing.
- 🔑 The script explains the importance of having a business account and a production phone number to go live and send messages globally.
- 📬 The video demonstrates how to send a 'Hello World' message using a template, which is a crucial step for testing message delivery.
- 🔄 Receiving messages is facilitated through the setup of a webhook, which allows for real-time notifications when messages are received.
- 🌐 The use of Postman is highlighted as a tool for testing APIs, and the script guides viewers on how to set up and use it with the WhatsApp API.
- 🔒 Security measures like two-factor authentication and verification tokens are emphasized to ensure the integrity of message notifications.
- 🚀 To go live with the API, one must transition from a test environment to a production environment by setting up a production phone number.
Q & A
What is the main topic of the video by Juan Estefan Garcia?
-The main topic of the video is how to send and receive WhatsApp messages using the new WhatsApp Business API, specifically the cloud version.
Why should viewers watch Juan's previous video before this one?
-Viewers should watch Juan's previous video to understand various concepts about the new WhatsApp Business API, as it provides context and clarifies concepts that might be confusing.
What is the advantage of using the cloud version of the WhatsApp Business API according to the video?
-The advantage of using the cloud version is that users can leverage the infrastructure provided by WhatsApp, eliminating the need to set up, install, or maintain any servers themselves.
What is the first step to start using the WhatsApp Business API as described in the video?
-The first step is to register as a Meta developer by creating a developer account on Facebook at developers.facebook.com.
Why is a business account necessary for using the WhatsApp Business API?
-A business account is necessary to go live and send WhatsApp messages to any number globally, along with a production phone number.
How can viewers test the WhatsApp Business API without writing code?
-Viewers can test the WhatsApp Business API without writing code by using the test account created for them or by following a future video prepared by Juan that demonstrates how to use the tool in a business without coding.
What is a webhook as mentioned in the video?
-A webhook is a method of receiving notifications and alerts when a specific event occurs, such as receiving a message on WhatsApp.
How can users receive notifications when a message is sent to their WhatsApp Business API?
-Users can receive notifications by configuring a webhook in the WhatsApp Business API settings, which sends alerts to a specified URL when a message is received.
What is the purpose of the 'verify token' in the webhook configuration?
-The 'verify token' is used by WhatsApp to authenticate that notifications are genuinely coming from Facebook and not from an unauthorized source.
What is required to send messages to any number using the WhatsApp Business API?
-To send messages to any number, users need to set up a production phone number, which allows them to send messages beyond the limited test numbers.
Outlines
📘 Introduction to WhatsApp Business API Cloud Version
Juan Estefan Garcia introduces the tutorial on using the WhatsApp Business API, specifically the cloud version. He references a previous video for context on the new API and assures viewers that a non-technical video is forthcoming. Juan emphasizes the benefits of the cloud version, such as not needing to manage servers, and guides viewers to the WhatsApp Business API documentation. He explains the necessity of being a Meta developer and walks through the process of creating a developer account on Facebook, selecting a business use type, and setting up a test app.
📝 Setting Up WhatsApp Integration and Testing Messages
The video continues with setting up the WhatsApp integration, which includes creating a test phone number and adding recipient numbers for testing purposes. Juan demonstrates how to verify a phone number and send a test message using a 'Hello World' template. He also introduces Postman, a tool for API development and testing, and shows how to configure it with the necessary environment variables. The tutorial includes sending a text message and receiving it, highlighting the immediate feedback mechanism.
🔔 Receiving Messages and Setting Up Webhooks
Juan explains how to receive messages by configuring a webhook, which provides notifications for specific events, such as receiving a message. He introduces Glitch, a tool for testing APIs, and guides viewers through setting up a webhook on the Glitch platform. The tutorial covers verifying the webhook with a token to ensure the notifications are legitimate. Juan demonstrates receiving a message and getting a notification, showing how the system can be used to monitor incoming messages in real-time.
🚀 Going Live with Production Phone Numbers
The final part of the tutorial focuses on going live with the WhatsApp Business API by setting up a production phone number. Juan outlines the steps for transitioning from testing to production mode, emphasizing that a production phone number is required to send messages to any number globally. He provides instructions on how to set up a production phone number and reminds viewers of the limitations of the testing mode, which restricts message sending to a maximum of five verified phone numbers.
Mindmap
Keywords
💡WhatsApp Business API
💡Cloud API
💡Meta Developer
💡Facebook Graph API
💡Postman
💡Webhook
💡Message Template
💡Production Phone Number
💡Glitch
💡Read Receipt
Highlights
Introduction to sending and receiving WhatsApp messages using the new WhatsApp Business API Cloud version.
Explanation of previous video on different concepts of the WhatsApp Business API.
Offer to prepare a video for non-technical users on leveraging the tool without coding.
Visiting the WhatsApp Business API documentation and exploring the Cloud API documentation.
Advantages of the Cloud API version, such as using Facebook's infrastructure without needing to set up servers.
Instructions on registering as a Meta developer and creating a developer account on Facebook.
Process of creating a new app and choosing the business app type.
Requirement of a business account and a production phone number to go live and send messages globally.
Setting up the WhatsApp integration and creating a test phone number for development purposes.
Adding and verifying recipient phone numbers for testing the API.
Demonstration of sending a test message using the 'hello world' template.
Using Postman for API testing and setting up sample endpoints.
Explanation of message templates and the necessity of using them to initiate conversations.
Procedure to send a custom text message after a conversation has been initiated.
Setting up a webhook for receiving notifications when messages are sent to the WhatsApp number.
Using Glitch to test the API and configure the webhook.
Demonstration of receiving a notification when a message is sent to the WhatsApp number.
Instructions on setting up a production phone number to send messages to any number globally.
Conclusion and call to action for viewers to subscribe for more upcoming videos.
Transcripts
hey i'm juan estefan garcia and in this
video i will be showing you how to send
and receive whatsapp messages using the
new whatsapp business api more
specifically the cloud version
in my previous video i explained a lot
of different concepts about this new
whatsapp business api because i know
that there's still a lot of confusion
out there and some of the concepts were
not very clear and so i encourage you to
watch that video because it will put you
into context and it will explain a lot
of things that we will be discussing in
this video however if you're ready to
get started let's dive right into this
oh and one thing before i forget
i know that some of you are not
technical and so for those of you who
are not developers or do not have any
experience writing code i will be
preparing another video in which i will
be showing you how to leverage this new
tool in your business and how to start
sending text messages without having to
write a single line of code
so without further ado let's get started
okay so let's start by visiting the
whatsapp business api documentation and
you can see that that here i'm looking
at the cloud api documentation and there
are actually a lot of useful links that
you will find here so i encourage you to
check it out if you are developing any
kind of app
using the whatsapp business api
so if i go to the overview page
you see that well it tells you a lot of
different things
and it tells you for example that they
use the facebook graph api for all of
this and the first thing that i want you
to know is that the good news is that in
this cloud api version
you actually can use their
infrastructure and you don't have to
worry about setting up or installing any
servers yourself or maintaining them no
you can just use the cloud version and
it will do everything for you using
their own infrastructure which is
definitely a lot more robust than ours
so if i click here where it says get
started
let's start
by looking at this first item and you
see that in order to follow
along in order to
do what i'm going to show you in this
video you need to be registered as a
meta developer
and
it's very simple to create an account
on facebook i mean a developer account
you just go to developers.facebook.com
and this is what you are going to see if
you don't have a developer account it
should be pretty easy to set that up you
just need to
accept some terms of services and it
will also ask you to enable to factor
authentication for your account which
should be pretty easy to do
and once you do that you just go to the
my apps page
and we're going to create a new app
and the first thing that you have to do
is uh choose
the business up type
and we're going to
enter here a name so it's going to be
binx
code
youtube app let's call it like this i
mean it can be anything you want to be
honest and you see that a business
account is optional but one thing that
you should know is that in order to go
live and in order to be able to send any
whatsapp messages to any number in the
planet you need to have a business
account and also well you need to have a
production phone number those are
basically the two things that you will
need but
for the sake of this video you should be
able to follow along just using the the
test account that it will create for you
in my case since i already have a a a
business set up i'm just going to use
mine
but again you can if you don't select
any business it will simply create one
for you all right so
let's go to the next page it will take a
few seconds while it sets up your
account
in their servers and the first thing
that you're going to see is that we are
going to set up the whatsapp integration
and so you see that out of the box by
the way
if you don't see
a temporary access talking here
it may be because you recently created a
developer account and it takes at least
60 minutes to set it up
and like to set up everything that you
need in order to use this developer
account so just keep that in mind if you
don't see anything here
and
all right so you see that it creates a
phone a test phone number for you so in
this case this is actually the one that
i am going to use
and also
you can add recipient phone numbers
and
it's pretty easy so
let's actually start doing this the
first thing that you're going to need is
a recipient phone number because well
that would be a number that you will use
for testing purposes in this case since
we haven't
gone live yet since this is not in
production mode we have up to five
numbers that we can add
for testing purposes and if you're going
to add a number you have to verify it
first so how do you do that well in this
case if i click here i will just
type my phone number in my cases i
already verified it i don't have to do
it again but
basically you just verify your number
you put it here
you will then get a text message such as
this one i mean a whatsapp message with
a code and then you just put the code
and it will let you
start sending and receiving text
messages from that number so i'm not
going to do that as you can see i
already verified it so i'm just going to
choose this one
and you see that it's as simple as that
if i let let me actually open what's up
here and if i click here where it says
send text message you see that
it sends me a message immediately and it
says welcome congratulations hello world
this message demonstrates your ability
to send a message notification from
pretty cool and
you see that here in this case it is
using a template called hello world and
that's why it already has like all these
all these texts in place
now uh
if i also take this command
and i run it here
you see that it also works and let me
actually double check yeah you see
that i see the message twice which means
that that i was able to receive it but
for our purposes it will be a lot easier
to use postman so i'm just going to
click where it says run in postman
and the first thing that i will do is
well if you don't have a postman account
it will ask you to create one in my case
i'm already logged in
in my
in my account and so i'm just going to
choose any label here i'm actually going
to use this one it doesn't really matter
and i'm going to pick this workspace
and for those of you who do not know
postman it's a very useful tool
that you can use for like developing
apis or for testing apis and so this is
definitely something that you will be
using quite frequently if you are
using whatsapp business api
okay so as you can see
facebook took the time to set up a lot
of different sample endpoints in example
requests and so this is definitely going
to save us a lot of time which is pretty
cool
so i don't want to use i mean as you can
see i'm using the web version but quite
frankly i like the desktop version
better so let me actually close all
these steps
don't save anything and as you can see i
have three cloud apis i mean it's only
because i was also
recording a spanish version of this api
so let's focus on this one
all right so
if i go to environments you will see
that that there there are three
environments in my case there are three
because i have three apis
and so here is where you will tweak
this value so for example i don't know
let's say
let's say that i want to change let me
actually go back to where i was
here
and if i want to copy let's say
this phone number id then this is the
one that i would put here
yeah i'm going to put this one no
actually i'm going to use the test
number
because you see that i already validated
another number uh and so i mean i can
use that one but for this video i'm just
going to use this one
so i'm going to leave it like this and
i'm also going to grab this temporary
access code and put it here
awesome and the recipient phone number
i'm going to use this one so i'm just
going to paste the number here as you
can see it was already there
i'm going to hit save
and now
if i go to get started send a text
message
you will see well you will see that this
is red and by the way as soon as you
come back to environment and enable this
environment that i just created you see
that it turns orange
and now
well let's do the same experiment
awesome so you see that that it does
work pretty cool
and
one thing that i want you to know is
that we're using a template and so if i
come here to where it says create your
own message template you will see that
we have different versions of this
hello world and also like for example if
we if we were to use sample chipping
confirmation i'm not going to use any of
those i'm just going to stick to
to the one that you're seeing here and
you see that you can create like even
different
uh translations of the same message
and one thing that i want you to keep in
mind is that in order to start a
conversation with someone that said that
we haven't received any
messages from a particular user if you
want to initiate a conversation with
that person you'll have to use a message
template so that's something that you
will have to keep in mind however after
that person replies to you you are able
to send any kind of message that you
want and so let's let me actually show
you if i try to send a text message and
let me actually go here to reference
messages
and
um
let me go here to examples
if i grab this payload
i put it here
you are going to see that well let me
actually do this
let me copy this variable
put it here
then i'm also going to remove
the rest
and
so i'm going to try to send a text
message
and the thing is that i mean actually
like in my case it will work because i
already like i i already was using this
number for testing purposes prior to
this video but if you try to send this
kind of message without the user having
first send you any message then you're
just going to get an error so in this
case let's actually do this
hey
how's it going
pretty casual
now if i send this it'll work and you
see how it lets you send a text message
but again if you try to do it without
the user
sending a sending you a message first
it's not gonna work so i do want you to
keep that in mind
all right so
let's talk now about
receiving text
messages because we know now how to send
text messages but let's focus on
receiving them because it will be pretty
cool if we can get any kind of
notification every time someone sends us
a message so how do you do that
so you just come here to where it says
configuration and we're going to
configure something called a web hook
and in case you don't know what a web
hook is is simply like a fancy way of
getting alerts and notifications when a
specific event happens so let's say that
for example i have an e-commerce store
and someone placed an order in my system
then it would be pretty cool if i get a
notification saying hey someone just
place an order or hey someone just made
a payment or hey someone requested a
refund or your order was already chipped
stuff like that and so
we want to enable notifications and we
want to enable webhooks when someone
sends a text when someone sends us a
text message so i'm going to click here
in the help icon
and it is going to take me to this page
and we're going to use a very cool tool
called glitch
and basically glitch lets you test
your api and so i'm going to click here
where it says remix on glitch
and you will see
that well in order to to do what i'm
going to do you will probably need to
have an account and so well it's pretty
easy to
uh to set up an account
and once you have your account you'll
see the first thing that you will
encounter is this code that is basically
a very simple api it has two endpoints
and one is a post
endpoint
under slash web hook and the same thing
with a get
endpoint on their slash web hook so
pretty easy and one thing that you will
need to do is you'll have to set up an
environment variable and actually as you
can see i have to click
first where it says remix because i need
to create
a my own copy of this server
not of the server of this code
and you see that that here i have the
option to change these two tokens in
this case we're going to update the
verify token and by the way this token
is just a way for what's up i mean for
you to know that
the notifications that you are getting
are actually coming from facebook
because if someone finds out about this
url they will be able to make manual
notifications and then your servers will
be confused thinking that someone is
sending you messages when in reality
you're just being attacked by someone
and so
let's put some random talking here
something like phoenix code
youtube
a349
exclamation mark this is what i'm going
to use
because as you can see i am very
creative
and
and not funny
and also what i'm going to do now is
i'm going to configure the web hook
and i'm going to paste
the verify talking first
and then what i'm gonna do is
i'm going to click here where it says
share and i'm going to grab this link
and put it here and i'm going to add a
slash webhook
so if i do this let me actually
here click where it says webhooks
and
if i click here verify and save
you'll see that it says webhook verified
because that basically means that that
facebook made a request to this url and
pass this verify token and it worked
so it's as simple as that and now what
we're gonna do is click here where it
says web hooks and i'm going to
subscribe to these notifications to this
event so basically every time something
related to a message happens you are
going to get a web hook
in the url that we provided facebook
before so i'm going to click you here
where it says subscribe
and we should be all set so let's
actually give this a try
if i come here let me clear they lock
the lock so i'm going to click here
and now i'm going to send a text message
so
hey
it's me
and you see that i immediately get a
notification and you see that there's a
message the message has a
a message id
and here's the body it says hey it's me
and so at this point like we can
literally have like some app that will
display all the messages that we are
receiving and then any person will be
able to reply to those messages so it's
pretty cool and you see that for example
if i send a text message let me send
a text message times two
all right and now i'm going to clear the
logs
and i want you to know that if i click
here
where it says well if i open my whatsapp
conversation
as soon as i open it
it in
i get a notification that says that the
message was read so this is basically
the way
you can like tell whether or not someone
has read your message so you you also
get a notification when that happens and
if i
reply okay cool
you see that i also get the other
notification with the text message so as
you can see we are able to send and
receive whatsapp messages using this new
api
okay so at this point you know full well
how to send and receive text messages
but the last thing that i want to tell
you is that in order to
go live in order to go to production you
will need to set up
a
production phone number and so basically
the way you do that is that
as you can see here it says when you're
ready to use your app for production use
case you need to use your own phone
number to send messages to your users
and here it has the instructions on how
to do that it's pretty easy to do it i
already tested it myself it works really
well and only when you have a production
phone number you are you have the
ability to
send messages to any number in the
planet so i just want you to keep that
in mind because while you are in testing
mode you are only able to send messages
to up to five
confirmed and verified phone numbers but
if you want to send messages to any
number you will have to use a production
phone number
so that's it for now and i want to thank
you for sticking till the end of this
video i will be showing you a lot of
different things during the next few
days so i want you to subscribe to this
channel because i will be posting more
videos very soon thank you so much
浏览更多相关视频
How to Send Bulk WhatsApp Messages using the official WhatsApp Cloud APIs
WhatsApp Cloud API - Automatizza WhatsApp e integra con altri Tool!
The Future of Real Estate Marketing is Here: WhatsApp Automation Secrets
Integrando Evolution API com ChatWoot
How To Build Your Own AI With ChatGPT API
AUTOMAÇÃO - COMO TRANSCREVER ÁUDIO DO WHATSAPP PARA TEXTO - MAKE INTEGROMAT
5.0 / 5 (0 votes)