Mobile Chatbot Development for WhatsApp

TRUETECH is engaged in the development, support and maintenance of iOS, Android, PWA mobile applications. We have extensive experience and expertise in publishing mobile applications in popular markets like Google Play, App Store, Amazon, AppGallery and others.
Development and support of all types of mobile applications:
Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1 servicesAll 1735 services
Mobile Chatbot Development for WhatsApp
Medium
from 4 hours to 2 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    756
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    624
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1054
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    947
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    862
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    445

WhatsApp Chatbot Mobile Development

WhatsApp Business API is the only official way to automate WhatsApp. Unofficial libraries (whatsapp-web.js and similar) violate ToS and lead to account bans. The official path: register with Meta Business Suite, gain access to Cloud API or On-Premises API, verify your phone number.

Two WhatsApp Business API Options

Cloud API (Meta-hosted) — Meta's infrastructure, no need to deploy your own server. Limit: 1000 free business-initiated conversations per month. Suits most use cases.

On-Premises API — server on your infrastructure. More costly to maintain, but data never leaves your control — critical for healthcare and finance in regulated markets.

For both options — register via Meta for Developers, create a WhatsApp Business App, and verify your business account.

Webhooks and Message Processing

Cloud API sends updates to your HTTPS endpoint:

from fastapi import FastAPI, Request
import httpx

app = FastAPI()
VERIFY_TOKEN = "your_verify_token"
WHATSAPP_TOKEN = "your_permanent_token"
PHONE_NUMBER_ID = "your_phone_number_id"

@app.get("/webhook")
async def verify_webhook(hub_mode: str, hub_challenge: str, hub_verify_token: str):
    if hub_verify_token == VERIFY_TOKEN:
        return int(hub_challenge)
    return {"error": "Invalid verify token"}, 403

@app.post("/webhook")
async def receive_message(request: Request):
    body = await request.json()
    for entry in body.get("entry", []):
        for change in entry.get("changes", []):
            value = change.get("value", {})
            for message in value.get("messages", []):
                await handle_message(message, value.get("contacts", [{}])[0])
    return {"status": "ok"}

The first POST to /webhook during setup is verification: a GET request with hub.challenge that you must return verbatim. Without this, Meta won't activate the webhook.

Message Types and Templates

WhatsApp distinguishes two conversation types:

  • User-initiated — user messages first, bot can reply with any text for 24 hours
  • Business-initiated — bot sends first, only via approved templates

A template (message_template) must be created and approved by Meta (typically 1–2 days). Template with variables:

{
  "messaging_product": "whatsapp",
  "to": "79001234567",
  "type": "template",
  "template": {
    "name": "order_confirmation",
    "language": { "code": "en" },
    "components": [
      {
        "type": "body",
        "parameters": [
          { "type": "text", "text": "John" },
          { "type": "text", "text": "ORD-12345" }
        ]
      }
    ]
  }
}

Interactive messages (buttons, lists) are available within the 24-hour window and don't require templates:

{
  "type": "interactive",
  "interactive": {
    "type": "button",
    "body": { "text": "Choose an action" },
    "action": {
      "buttons": [
        { "type": "reply", "reply": { "id": "confirm", "title": "Confirm" } },
        { "type": "reply", "reply": { "id": "cancel", "title": "Cancel" } }
      ]
    }
  }
}

Media: Images, Documents, Audio

WhatsApp supports sending and receiving images, documents, audio, and video. For incoming media — download using media_id:

async def download_media(media_id: str) -> bytes:
    # Step 1: get URL
    async with httpx.AsyncClient() as client:
        r = await client.get(
            f"https://graph.facebook.com/v18.0/{media_id}",
            headers={"Authorization": f"Bearer {WHATSAPP_TOKEN}"}
        )
        media_url = r.json()["url"]

        # Step 2: download file
        r2 = await client.get(media_url, headers={"Authorization": f"Bearer {WHATSAPP_TOKEN}"})
        return r2.content

Media URL lifetime is 5 minutes after the first request. Download and cache immediately.

Limitations and Platform Specifics

No ability to edit sent messages (unlike Telegram). Cannot retrieve user contact lists. One phone number = one WABA (WhatsApp Business Account). Delivery statuses (sent, delivered, read) arrive via the same webhooks.

Rate limits: 80 messages per second per number by default. For bulk template distribution — gradually increase volume (warm-up).

Development Process

Registering Meta Business App and verifying business account. Setting up WABA and phone number. Developing webhook server. Creating and submitting templates for approval. Implementing dialog flows. CRM or internal system integration. Testing via Meta's official test number.

Timeline Estimates

A basic bot with templates and incoming message handling — 2–3 weeks. A full conversational bot with CRM integration, media, and multi-language support — 5–10 weeks.