How to setup Whatsapp Cloud API ?
To setup Whatsapp Cloud API follow the Following Steps....
Setup Method are as mentioned below -
Follow STEP BY STEP -
- So we will be setting up the whatsapp cloud api the first step involves going to developers.facebook.com then click on the my apps button on the top right corner.
- Click on Create app.
- Choose business.
- Click on next.
- Enter the display name of the app (It can be anything that you want.)
- If you have a business account you can select it otherwise you can leave as it is.
- Enter the Password.
- Click on Submit.
- Scroll Down to Whatsapp.
- Click on Setup.
- Then Select a Bussiness Account .(If you don't have a bussiness account you can leave as it is and actually Facebook will actually Create a Bussiness Account Automatically for you.)
- Click on Continue.
- It will just take a moment.
- As you will see it has generated a test phone number for us.
- And also provided us with a sample API call for sending a template message.
- We have to add a PHONE NUMBER to which we can send a test message.
- We have to verify that phone number to receive test message as long as it is.
- A test number you actually have to verify it once.
- For receiving the message on this number.
- So i have already verified it.You can click on send message and if you check the phone number whatsapp you will actually receive the message right away.
- Now next i am adding a verification phone number verified phone number so that any messages will be delivered to my own mobile number.
- I am adding my first number which is which already has of whatsapp account and you can see it will give an error because it says this number is registered to existing whatsapp account so you cannot use the same number that is that has an existing whatsapp account.
- So in this case you will have to set up a new mobile number and you will have to use that new mobile number with the whatsapp api.
- So i am entering a entirely new mobile number.
- Clicking on next an sms message will actually arrive on this mobile number to verify production mobile number to send whatsapp message.
- I will be entering the verification code.
- Now I will click on next to add the verification or the verified phone number to my account.
- Now all i need to do is to connect this number to public connect and i can send messages right away.
- You can see the from number is added on the top once the number is verified and added right here i will show you how you can send a message through this number to any whatsapp number.
- All you have to do is just copy this entire request right here and just open up a notepad and paste this request here.
- The first thing that you have to do is you have to remove all the slashes that are appearing right here.
- So what i am going to do is i am going to do a find and replace.
- So i will be doing CTRL+F and replacing all the slashes all the forward slashes with blank so i will just click on replace all so that way my entire slashes will be removed from the data which is shown by the d symbol right here.
- Now what i will do is i will open up the pabli connect dashboard right here.
- I will be creating a new workflow by the name of anything that you really want so whatsapp cloud api.
- The name is whatsapp cloud api and i am clicking the create button.
- You can choose any trigger that you want i am choosing a webhook as a trigger and if you want you can send some message across to what webhook.
- This web book will work in any case when you are receiving any new form entry from anywhere so i am just copying this webhook url and sending some message which happens to be name is equal to niraj.
- Now this is just a sample message you don't have to worry about the trigger here you can use whatever trigger you want to get but essentially what we are interested in we are interested to send a message so i will be using the action step and i will be using the api module right here.
- Click on api module the action event will be custom request the method will be post the endpoint url will be something that you have right here.
- So just copy this endpoint url and paste it here.
- Next you have to choose the authentication as bearer token.
- Go back the bearer token is right here just copy this br token form from the first letter until the last letter without the codes. So just paste it here and lastly you have to paste the data so you just copy this data from right here until the last curly bracket before and after the single quotes so just copy it just paste it here and once pasted what you can do is you will have to mention the number to which you want to send the num message so i am sending this number to +919926465653.
- This is essentially my number and what you can even do is you can just map this number which is coming from the trigger step so if you have the number right here we can just use the trigger step and map the number from the step above all you have to do is click on save and send a test request.
- As soon as you do that you will see that a message has been sent and my whatsapp web has pinged right here i will show you once clicking here and you can see the messages right here which says welcome and congratulations this message demonstrates your ability to send a message notification from Whatsapp Business Platforms Cloud API.
- Now go back to public connect we have successfully tested the api and we were able to send the message one thing i wanted to show you is that the template that we sent right now.
Actually the first conversation that you are doing with the customer will actually happen with a template message.The template message needs to be pre-approved by facebook only the pre-approved messages can be sent to any customer to initiate a conversation okay until and unless the customer does not reply back to your first template message you can't converse with them any further so in this specific case the template by the name of hello world is something that we have sent to the customer and that is the exact same message that is received on whatsapp you can create any number of template message here by clicking this button which which is appearing here you can just click it here these are all the template messages right now the template that we sent was hello world if you click here you can see the message of the body was welcome and congratulation this message demonstrates your ability to send a message notification from whatsapp business platforms cloud api thank you for taking the time to test with us
Now interestingly if you really want to create another template message you all you have to do is click on create message template you can choose the category type of the message template in this case i am choosing an alert update then you can write the name of the template which can be anything that you want so i can write alert update for an order.
So alert update for an order i can choose the language which will be (English US) then i will just click on continue if i want to send some file which might include the invoice of this order. You can include the file as well so in the header you can add a media file and you can see that i want to send a pdf so select document the right side shows you how your message will look once it is getting inside the customers mobile.
And then you can also add a variable by clicking this button you can say hello john thank you for your order your invoice is attached with this whatsapp message thanks. and whatever your company name is and then you can write team so in our case we can write public team if you have any footer that you want to use sent using probably connect you can use a footer as well if you have a call to action you can include a call to action for visiting website you can write visit website it can be static url which can be xyxyz.com so this is something that here is how it will appear once you create your template message you actually have to write a sample message right here you can include a pdf file so just choose a pdf file so diwali wishes one of my message template i am including a pdf so this will be submitted for review along with the message so i'm just writing that this variable will be the name of the person and this variable will be the comp name of the company so i'm just adding two variables right here visit website is as it is you can see the preview of the message and you can just.
And then you can also add a variable by clicking this button you can say hello john thank you for your order your invoice is attached with this whatsapp message thanks. and whatever your company name is and then you can write team so in our case we can write public team if you have any footer that you want to use sent using probably connect you can use a footer as well if you have a call to action you can include a call to action for visiting website you can write visit website it can be static url which can be xyxyz.com so this is something that here is how it will appear once you create your template message you actually have to write a sample message right here you can include a pdf file so just choose a pdf file so diwali wishes one of my message template i am including a pdf so this will be submitted for review along with the message so i'm just writing that this variable will be the name of the person and this variable will be the comp name of the company so i'm just adding two variables right here visit website is as it is you can see the preview of the message and you can just.
Click on done right here.
Once you do that you can submit this message for approval the template id is alert update for an order
Just click submit.
Click confirm and as soon as you confirm it and you can see it is go it has went for a review to facebook and it you can see the status as pending review if you reload it.
Once you do that you can submit this message for approval the template id is alert update for an order
Just click submit.
Click confirm and as soon as you confirm it and you can see it is go it has went for a review to facebook and it you can see the status as pending review if you reload it.
It usually takes about 30 to 40 seconds for the approval to happen because it is all automated and you can see the approval is happening right away and you can see the approved message right here.
So i hope you understand you understood how you can create template message inside the facebook account you understood how you can add a number get the number verified inside facebook to send whatsapp message pretty soon.
We will be adding a new application by the name of whatsapp cloud api inside public connect itself that way you will not even have to write anything yourself and everything will be happen on its own it will be very simple and we will be releasing the integration with public connect for this api pretty soon.
So stay tuned and you will be able to send any kind of messages any kind of whatsapp messages using public connect have a great day.
Thanks.....
0 Comments