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 -

  1. 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.
  2.  Click on Create app.
  3.  Choose business.
  4.  Click on next.
  5.  Enter the display name of the app (It can be anything that you want.)
  6.  If you have a business account you can select it otherwise you can leave as it is.
  7. Enter the Password.
  8.  Click on Submit.
  9.  Scroll Down to Whatsapp.
  10. Click on Setup.
  11.   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.)
  12. Click on Continue. 
  13. It will just take a moment.
  14. As you will see it has generated a test phone number for us.
  15. And also provided us with a sample API call for sending a template message.
  16. We have to add a PHONE NUMBER to which we can send a test message.
  17. We have to verify that phone number to receive test message as long as it is.
  18. A test number you actually have to verify it once.
  19. For receiving the message on this number.
  20. 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.
  21. Now next i am adding a verification phone number verified phone number so that any messages will be delivered to my own mobile number.
  22. 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.
  23. 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.
  24. So i am entering a entirely new mobile number.
  25. Clicking on next an sms message will actually arrive on this mobile number to verify production mobile number to send whatsapp message.
  26. I will be entering the verification code.
  27. Now I will click on next to add the verification or the verified phone number to my account.
  28. Now all i need to do is to connect this number to public connect and i can send messages right away.
  29. 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.
  30. All you have to do is just copy this entire request right here and just open up a notepad and paste this request here.
  31. The first thing that you have to do is you have to remove all the slashes that are appearing right here.
  32. So what i am going to do is i am going to do a find and replace.
  33. 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.
  34. Now what i will do is i will open up the pabli connect dashboard right here.
  35. I will be creating a new workflow by the name of anything that you really want so whatsapp cloud api.
  36. The name is whatsapp cloud api and i am clicking the create button. 
  37. 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.
  38. 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.
  39. 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.
  40. 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.
  41. So just copy this endpoint url and paste it here.
  42. Next you have to choose the authentication as bearer token.
  43. 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.
  44. 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.
  45. 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.
  46. 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.
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.

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.....