Salesforce Integration With Whatsapp
Sending message from salesforce to whatsapp
Steps to be followed before sending the message
Login to https://developers.facebook.com/ using your facebook credentials. After login, go to My Apps on the homepage and create an app.
Note- Whatsapp Cloud Api does not require a verified business account to login.
After completing all the login process it will take you to the Meta Dashboard which will look like this-
Scroll Down you’ll see WhatsApp in add product to you app section , that’s the app we want to integrate now
Click on it and it will navigate you to WhatsApp business platform api , where you need to either create or add an existing business account.
After this step basic setup is complete and you will be navigated to the app dashboard where all your business information has been listed down.
Unlike other apis, WhatsApp cloud api provides a temporary access token which will expire after 23 hour. It is also possible to create a permanent access token , that will require a whole lot of new steps.
Select Phone Number- As of now for free users a test number is being provided by the Api . This is nothing but the Sender's number . It is also possible to use your own number or a personalized number but you need to have a premium account . Learn more about pricing.
TO : this number represents the recipient’s number . As of now only 5 numbers are allowed and each of them should be verified after getting added to this list . We can also add more numbers.
After entering the number meta will send you a facebook confirmation code in the inserted number.This will show that your number has been verified .
After entering all these details click on send message . You would have received a hello_world template message from the test number which will be shown on the app dashboard.
This template is available by default once the account has been set up.
Now lets see this functionality in salesforce-
Whatsapp Cloud API uses Meta’s Graph API for integration. Endpoint URL to send message is
https://graph.facebook.com/v13.0/{{Phone-Number-ID}}/messages.
Where PhoneNumberId is nothing but the test phone number ID which was created during app setup.
Add https://graph.facebook.com to remote site settings in order to all callouts.







After deploying, we got this error - {"message":"Unsupported post request. Object with ID '103059885919746' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https:\/\/developers.facebook.com\/docs\/graph-api","type":"GraphMethodException","code":100,"error_subcode":33,"fbtrace_id":"AMDS9FFx1vQDL8o3UsrX-oe"}}
ReplyDeleteradsun have you added object id in your apex controller ? because i think that's why this error is showing
ReplyDelete