Installation

WhatsApp Cloud API Setup

  • Create a Developer account and a new Facebook app as described at https://developers.facebook.com/docs/whatsapp/cloud-api/get-started#set-up-developer-assets.

  • In PSI Bot > Settings > WhatsApp > Cloud API > Secret key enter a random string then go to https://developers.facebook.com/apps and select your app. Click Add product and add WhatsApp, then go to WhatsApp > Configuration and in Webhook URL enter the URL you get from PSI Bot > Settings > WhatsApp > Cloud API > Configuration URL. In Verify token enter the secret key you previously entered in PSI Bot . Click Verify and save, click Webhook fields > Manage, enable the following Webhook fields: messages.

  • In PSI Bot > Settings > WhatsApp > Cloud API > Token enter the test token for testing, and follow the instructions below for getting the permanent access token.

    • Visit https://business.facebook.com and go to Left menu > Settings > More system settings, then go to Users > System Users to view the system user you created, or create a new one. Click on that user and select Add Assets. The system user needs to be an admin.

    • Click Left menu > Apps and under Select Assets and choose your app. Enable Develop App for that app and save.

    • Click Generate Token and select your app, enable the following permissions: whatsapp_business_management, whatsapp_business_messaging, business_management. Click Generate Token and save. Paste the token in PSI Bot > Settings > WhatsApp > Cloud API > Token.

  • To get the Phone ID enter https://developers.facebook.com, select your app and go to Left menu > WhatsApp > Getting started.

  • You can test the integration from https://developers.facebook.com, select your app and go to Left menu > WhatsApp > Getting started.

360dialog Account Setup

  • Go to https://www.360dialog.com/ and create a new account.

  • Enter your dashboard and from Left menu > WhatsApp Accounts generate the API key and copy and paste it in PSI Bot > Settings > WhatsApp > 360dialog settings.

  • Click PSI Bot > Settings > WhatsApp > 360dialog settings > Synchronize now.

  • Done! PSI Bot should start receiving the WhatsApp messages sent to your number, and you can reply to those messages from PSI Bot .

  • Note that you can also use the free sandbox account for testing, more details at https://docs.360dialog.com/whatsapp-api/whatsapp-api/sandbox. The sandbox account has limitations and some features, such as media attachments, will not work.

Twilio Account Setup

  • Go to https://www.twilio.com and create a new account.

  • Verify your phone number.

  • Complete the form and choose WhatsApp, Alerts & Notifications, With no code at all, 3rd party integrations.

  • From the Twilio console copy ACCOUNT SID and AUTH TOKEN and paste them into PSI Bot > Settings > WhatsApp > Twilio settings, save the changes.

  • You will now set up a free test account to run some tests and make sure the integration works with PSI Bot . From the left menu click Messaging > Settings > WhatsApp sandbox settings and enter into WHEN A MESSAGE COMES IN and STATUS CALLBACK URL the URL of PSI Bot , get it from PSI Bot > Settings > WhatsApp > Twilio settings > Get configuration URL. Mind that localhost will not work, you need a public URL and a live server.

  • From the left menu click Messaging > Try it out > Send a WhatsApp message. Follow the instructions and send the message with the code to the WhatApp number provided. Click the next buttons until the configuration is complete.

  • Done! PSI Bot should start receiving the WhatsApp messages sent to the sandbox account, and you can reply to those messages from the PSI Bot .

  • To publicly use the WhatsApp integration with your customers you need to update your account and enable billing, you can do that here. After that you will need to purchase a Twilio number, which will be the phone number of your official WhatsApp Business account. More details here. You cannot use the phone number of your existing WhatsApp Business account, you must use a Twilio number.

Last updated