UBOS Community

Olha
Olha

Posted on

Step-by-Step Guide: Setting Up WhatsApp Bot on Facebook API

To set up a WhatsApp bot, you need to save the phone number ID and access token on your AI Bot application.

Image description

Access WhatsApp Configuration:

  1. Visit Facebook Developers.
  2. Log in to your Facebook account.
  3. Select Your App:
    • In the developer portal, go to "My Apps" and choose the app for which you want to enable WhatsApp. Image description

Navigate to WhatsApp Settings:

  1. On the left-hand menu, find and click on "WhatsApp." Image description
  2. If WhatsApp is not listed, add it by selecting "Add a Product" and choosing WhatsApp. Image description

Generate Temporary Access Token:

  1. Go to the "API Setup" page.
  2. Obtain a temporary access token; keep in mind that it expires in 24 hours. Image description
  3. Considerations for Temporary Token:
    • If testing, the temporary token is sufficient.
    • For production, create a permanent access token.

Generate Permanent Access Token:

  1. Sign in to business.facebook.com.
  2. Navigate to Settings: Image description
  3. Navigate to user system settings: Image description
  4. Press "Generate a New Token": Image description
  5. Choose the app and set the token expiration date: Image description
  6. Under access, choose both "whatsapp_business_messaging" and "whatsapp_business_management."
  7. Click "Generate."

Save Permanent Token on AI Bot App:

Image description

Set Webhook URL:

  1. Choose Messenger on the left-side menu and go to Instagram setting on developers.facebook.com. Image description
  2. In the "Webhook" section, paste your URL.
    • URL from AI bot app: Image description
  3. Provide a verification token.
  4. Click "Verify" and "Save."

Set Up Additional Webhook Functions:

  1. Under "Webhook," press "Manage," select "Messages," and click "Done." Image description

Use your WhatsApp account to send a test message.

Discussion (0)