Skip to content

WhatsApp Setup

This guide walks you through connecting WhatsApp to MotoRentals so your AI agent can respond to customer messages.

Time Required

First-time setup takes 15-30 minutes. You'll need a Meta (Facebook) Business account.

Overview

MotoRentals uses the WhatsApp Cloud API to send and receive messages. You'll need:

  1. A Meta Business account
  2. A WhatsApp Business phone number
  3. Two credentials from Meta: Phone Number ID and Access Token

Step 1: Create a Meta Business Account

If you don't have a Meta Business account:

  1. Go to business.facebook.com
  2. Click Create Account
  3. Enter your business name, your name, and email
  4. Follow the verification steps

Business Verification

Meta may require business verification for full API access. This can take 1-3 days. You can still test with limited messages while waiting.


Step 2: Create a Meta App

  1. Go to developers.facebook.com
  2. Click My AppsCreate App
  3. Select Business as the app type
  4. Enter an app name (e.g., "Krabi Rentals WhatsApp")
  5. Select your Business Account
  6. Click Create App

Step 3: Add WhatsApp to Your App

  1. In your app dashboard, find Add Products
  2. Find WhatsApp and click Set Up
  3. Select your Business Account when prompted

Step 4: Add a Phone Number

You have two options:

Option A: Use a Test Number (Quick Start)

Meta provides a free test number for development:

  1. Go to WhatsAppAPI Setup in your app
  2. You'll see a test phone number already configured
  3. This works for testing but shows "Meta" as the sender

To use your own number:

  1. Go to WhatsAppAPI Setup
  2. Click Add phone number
  3. Enter your business phone number
  4. Verify via SMS or voice call
  5. Complete the display name review (24-48 hours)

Phone Number Requirements

  • The number cannot be registered with regular WhatsApp
  • You'll need to migrate it to WhatsApp Business API
  • Once migrated, you can't use it with the regular WhatsApp app

Step 5: Get Your Phone Number ID

  1. Go to WhatsAppAPI Setup
  2. Find Phone number ID under your number
  3. Copy this value (looks like: 123456789012345)

Phone Number ID Location


Step 6: Generate an Access Token

Option A: Temporary Token (Testing)

  1. In API Setup, find Temporary access token
  2. Click Generate
  3. Copy the token

Temporary tokens expire in 24 hours

Use a permanent token for production.

Option B: Permanent Token (Production)

  1. Go to Business SettingsSystem Users
  2. Click Add to create a system user
  3. Name it (e.g., "MotoRentals API")
  4. Set role to Admin
  5. Click Generate Token
  6. Select your app
  7. Add these permissions:
    • whatsapp_business_messaging
    • whatsapp_business_management
  8. Click Generate Token
  9. Copy and save the token securely

Save Your Token

The token is only shown once. Store it securely.


Step 7: Configure the Webhook

MotoRentals needs to receive messages from WhatsApp:

  1. Go to WhatsAppConfiguration
  2. Find Webhook
  3. Click Edit
  4. Enter these values:
Field Value
Callback URL https://krabi.yourads.io/whatsapp/webhook
Verify Token motorentals_webhook_verify_2024
  1. Click Verify and Save
  2. Subscribe to these webhook fields:
    • messages
    • message_status (optional)

Step 8: Enter Credentials in MotoRentals

  1. Log in to your MotoRentals Dashboard
  2. Go to Settings or complete the Setup Wizard
  3. Enter your:
    • Phone Number ID
    • Access Token
  4. Click Test Connection
  5. If successful, click Save

Testing Your Setup

Send a WhatsApp message to your business number. You should:

  1. See the message in your MotoRentals dashboard
  2. Receive an AI-generated response on WhatsApp

Test Message

Try sending: "Hi, I want to rent a scooter for tomorrow"


Troubleshooting

"Webhook verification failed"

  • Check the Callback URL is exactly correct
  • Ensure your server is running and accessible
  • Verify the token matches

"Messages not received"

  • Check webhook subscriptions include messages
  • Verify the phone number is active
  • Check the access token hasn't expired

"Messages sent but no response"

  • Verify the AI agent is enabled in settings
  • Check you have bikes in your inventory
  • Review the conversation logs in dashboard

Next Steps