Primechat
API DocumentsWebsiteLog in
  • START HERE👋
  • FAQ's
  • Pricing Plans
  • Getting Support
  • PLATFORM
  • Registration
  • Overview
  • Workspace & Members
  • CHATBOT GUIDE FOR BEGINNERS
  • Introduction
  • What is a chatbot
  • Benefits & importance
  • Use cases
  • FLOW BUILDER
  • Flow builder overview
  • Field variable
  • Steps
    • Steps
    • Question Step
    • Variable Operation
    • JSON Operation
    • External Request
    • Send Notification
    • Condition Step
    • Split Step
    • Go to Step
  • Sub Flow
    • Sub Flow
    • Workflow
    • Function Flow
  • CHATBOT CHANNELS
    • Omni+Channel Chabot
    • Webchat Chatbot
    • Facebook Chatbot
      • Facebook Lead Generation
    • Instagram Chatbot
    • Telegram Chatbot
    • Slack Chatbot
    • Wechat Chatbot
    • WhatsApp, SMS & Voice ChatBot
      • WhatsApp Cloud API
      • Set Up Facebook App
      • Get Your Webhook From PrimeChat
      • Start With Test Numbers
      • Build WhatsApp Chatbot With Test WhatsApp Number
      • Supported Message Types
      • Template Message
      • How To Use Template Message
      • WABA: Com Bot
    • Google Business Messenger
  • INTEGRATIONS
    • WooCommerce
    • Stripe
  • OPENAI & PRIMECHAT
    • Create chat completion
    • ChatGPT & PrimeChat Use Cases
    • How to fine-tune ChatGPT for your business
    • Generate the chatbot flow using A.I
    • Power up your live chat with the AI assistant
    • Reply to Facebook and Instagram post comments
    • OpenAI embeddings & building your knowledge base
Powered by GitBook
On this page

Was this helpful?

  1. CHATBOT CHANNELS
  2. WhatsApp, SMS & Voice ChatBot

WhatsApp Cloud API

Facebook announced WhatsApp cloud API on 20th May, and it’s available to any business of any size, big and small.

This documentation will teach you how to set up WhatsApp cloud API with PrimeChat. You will be able to build your WhatsApp chatbot with a free testing number offered by Facebook, and also switch to the live production when your bot is ready to go live!

Please note:

For now, due to the limitations of WhatsApp Cloud API, every business needs to create its own Facebook App to use WhatsApp Cloud API. Once Facebook allows platforms like PrimeChat to create a WhatsApp business account, we will improve the process of using WhatsApp cloud API.

Here is the overview video on how to build your first WhatsApp bot with Cloud API

Part 1:

1. Preliminary Requirements

  • Have a WhatsApp account.

  • Have a Facebook Developer account. If you don't have one, you'll need to create it.

2. Creating a Facebook Developer App

  • Log into your Facebook Developer account.

  • Click on "Create an App".

  • Choose a display name for your app (e.g., "API Demo 2").

  • Enter your contact email.

  • Choose the business account you want to connect this app to.

  • Authorize your Facebook account when prompted.

  • Once the app is created, scroll down to find 'WhatsApp' and click "Setup".

  • If you wish to test the bot, you'll need to verify a phone number with Facebook. This number will be used for testing purposes.

3. Connecting PrimeChat

  • In PrimeChat, navigate to the new channel called "WhatsApp Cloud".

  • When prompted, Authorize your Facebook account, and select the business account connected to the app you just created.

  • In PrimeChat, click "List Business with WhatsApp Numbers". This will display the business accounts available to connect.

  • From the list, select the business account linked to the app you created.

  • You'll be provided with a webhook URL in PrimeChat. Copy it.

4. Linking Webhook to Your Facebook App

  • Return to your app on the Facebook Developer platform.

  • Navigate to the configurations and click "Edit".

  • Paste the copied webhook URL into the "Callback URL" section.

  • Go back to PrimeChat and copy the provided token.

  • Paste this token into the respective field on the Facebook Developer platform and click "Verify and Save".

  • Click "Manage" and choose to listen to the "Messages" event type. Then click "Done".

5. Creating and Testing Your Chatbot

  • In PrimeChat, select the test phone number.

  • Create a new chatbot. For example, name it "Cloud API Demo 2".

  • Define your bot's interaction flow. For a basic test, set it up to send a simple greeting message like "Hello Test".

  • Publish your chatbot.

  • To test, click on "Preview" and open it in WhatsApp. You should be able to interact with your chatbot.

6. Advanced Features

  • You can further enhance your chatbot by adding buttons and asking users for information, such as their email address.

  • PrimeChat allows you to store this information in custom fields.

  • Additionally, message templates are supported. You can create message templates in PrimeChat and sync them back to use in various features like the flow builder, live chat, and broadcasts. (WhatsApp templates need to be approved by Meta before becoming available for use. The process is sometimes immediate, and sometimes take up to 72h to complete)

Note: This guide only covered setting up and testing with a demo number. Once you've successfully tested your chatbot, the next step involves connecting with a real phone number and switching the flow accordingly.

Part 2:

1. Setting Up A Real Phone Number:

  • After building and testing your chatbot, the next step is to push it to live.

  • Remember, the test phone number only works with a list of verified contacts.

  • Do not use a phone number already connected with WhatsApp, either for personal or business purposes. If such a number exists, you need to delete that account or get a new number.

2. Adding the Phone Number:

  • Go to the app you created in Part 1.

  • Scroll down to find the "Add a Phone Number" section.

  • Ensure the display name matches the verified business name; WhatsApp has strict rules about this. For further details, check PrimeChat's documentation.

  • For this guide's demo purpose, we'll use "PrimeChat" as the name. Select your time zone and appropriate categories.

  • On the next page, verify the new phone number. Ensure the number isn't linked to any existing WhatsApp account.

  • After verification, wait for Facebook to process and approve your phone number and display name.

3. Switching to Your Real Phone Number:

  • Navigate to your WhatsApp Business Manager. You'll see all phone numbers linked to this business account.

  • Look for the status of your new phone number. If it's verified and connected, return to PrimeChat.

  • In PrimeChat, sync your numbers. If the new number doesn't appear, disconnect and reconnect to fetch it.

  • To switch your flow from the test to the real number:

    • Unlink the bot from the test number.

    • Navigate to the WhatsApp Cloud section in PrimeChat.

    • Select your new, verified phone number.

    • Link this number to the flow you've previously created.

That completes the switch from test to real number!

4. Additional Tips:

  • Always refer to PrimeChat's help documents regarding the WhatsApp Cloud API. They contain vast information on:

    • Creating template messages.

    • Applying and using template messages.

    • Ensuring compliance with WhatsApp's display name rules.

    • Setting up WhatsApp e-commerce with PrimeChat 360.

Now, Let’s get started by creating your own Facebook App.

PreviousWhatsApp, SMS & Voice ChatBotNextSet Up Facebook App

Last updated 1 year ago

Was this helpful?