Blog

Official WhatsApp Business API  A Quick Overview of API & How it Works

Official WhatsApp Business API - A Quick Overview of API & How it Works

After the massive acquisition of Whatsapp by Facebook in 2014 for $19 billion now its time to show their stakeholders how facebook going to make money using Whatsapp Business Solutions.

Few months back WhatsApp had launched a separate application called WhatsApp business in few countries for helping small and medium companies to manage their business more effectively through WhatsApp. Currently Whatsapp Business have 3 Million Active Business Customers and growing.

After the launch of Whatsapp Business App they have recently started monetize their platform by offering messaging service to medium and large companies through an API who want to connect and engage their customer through WhatsApp, The closed testing has started few months ago with 20 companies and gradually rolling out to new companies.

The Whatsapp Statistics

  • WhatsApp currently has 1.5 Billion active customers across 170+ Countries
    90% of smartphone owners use WhatsApp.
  • 80% of messages sent to WhatsApp are seen within 5 minutes compared to the traditional SMS
  • A user spends 30 minutes average in a day with Whatsapp.

Getting Started

There are 2 ways to get started with Whatsapp Business API ;

Using a Solution Provider

Solution Providers are partners who have prior approval to activate a telephone number within WhatsApp, but even then one-to-one approval of the solution is still required, which is likely to be done in “6 hands” among Company teams that want WhatsApp, and the Solution Provider.

We act as a Solution Provider to deploy Whatsapp Quickly, keep reading for more details.

Run your own Infra and solution

In this case, you’ll need to run a WhatsApp Client in an instance of your own, and build your solutions like webhooks and node Web calls yourself. You can find offical developers guide here https://developers.facebook.com/docs/whatsapp/overview

You can directly apply for a developers account here https://www.whatsapp.com/business/api

Now Lets explain in simple for developers how technical it works with your application / server

WhatsApp used a very interesting and completely different solution from other messenger like Messenger or Telegram.

To have a bot in the WhatApp you need to rotate a Node (node) in an instance of your own. This node maintains connectivity to WhatsApp over a long-lived TCP connection.

Your backend is attached to this node and not directly to the WhatsApp servers. Below I will explain a little better this architecture.

Instance / Node

You will need a specific machine to run the WhatsApp client. One thing that caught my attention was the size of the machine they suggest as minimal installation:

If you are using a single server, we recommend a server with at least 250 GB SSD, 16 GB RAM, and 4 core CPU. HDD is not recommended as the I / O speeds will become bottlenecks under load.

On this machine you will run in docker 3 separated processes:

  • MySQL
  • CoreApp
  • WebApp

This daemon / client solution is pretty cool and these nodes could be a step towards developing a decentralised messaging app.

Important information:

You can run a single account per instance. If you need a second test account make sure to use a different number for that second instance.

If you have or need 10 different bots, you will need 10 instances like this.

Client general architecture (node)

CoreApp

CoreApp is the application that does all the magic. It will connect to the WhatsApp servers, it will keep the encryption keys (do not forget that WhatsApp is encrypted end-to-end , the node keeps all these keys in MySQL probably ), it will manage the messages coming and going, backup contacts, etc.

WebApp / APIs

WebApp is the application that interfaces between your backend and CoreApp. Basically it is a web service authenticated by tokens for sending messages out.

Some available client endpoints:

Contacts : Check your customer base numbers
Groups : Creates and manages groups
Health : Check the health / status of your Client (CoreApp and WebApp)
Media : Media management (photos / videos / documents)
Messages : * This one I’ll detail below
Registration : Registering your WhatsApp account
Settings : Application Settings
Stats : Statistics
Support : Direct support endpoint on client
Users : Client tokens / client management

Messages

This is the endpoint of sending messages, probably the main one among all others.

Going straight to the subject, the types of messages that can be sent are:

Audio
Document
Image
Text
HSM — Message Template, where you can dynamically set some type of text from predefined variables.

We can notice that there are no features similar to what we have today in Messenger and even Telegram : buttons, webviews, Carousels, inline keyboard among others, and for that reason, I see something very similar to what is already done via SMS.

https://developers.facebook.com/docs/whatsapp/api/messages

Webhooks

By the famous Webhooks that your backend will receive the messages sent by your users to the bot. This Webhook is configured directly on the client, nothing is done directly on the WhatsApp servers.

There is not much to write about webhooks, they are simple JSON text, audio or document. In the case of text, they can also be a response to some user interaction bot (the JSON of input comes with a field context )

https://developers.facebook.com/docs/whatsapp/api/webhooks

Cost

Incoming messages to your business number is free of cost and replies within 24 hours from the last user message is also free of cost i.e you will be charged by Whatsapp only if you want to send messages after 24 hours from the last message received from a whatsapp user.

After the 24 hours window per outgoing messages are likely to charge $0.0473 (may vary from client to client as per the annual messaging volume )

WhatsApp Business API is part of the Facebook Ad and managed through Facebook Business Manager Account https://business.facebook.com

To run your Whatsapp Instance (Nodes) you require to setup a high availability SSD Based dedicated servers for IO free operations which could cost $200 to $300 per month per instance.

General Informations

Please note WhatsApp Business API dont allow you to send Marketing, Promotional Contents to your customers after 24 hours of a user interaction with your business number.

Your customers should be opted through a 3rd party page like Your Website , Mobile App , Offline Forms clearly mentioning WhatsApp optin as a method.

In order to prevent sending marketing contents after the 24 hours window WhatsApp use business templates i.e all your message stricture should be approved by WhatsApp Ad compliance team. It can be done through the Facebook Business Manager.

Our Role — How We Can Help You ?

With more than 13 years of experience in Telecommunication field we work as a Solution Provider to help companies to enrol and comply with WhatsApp Policies and help them to roll out WhatsApp business quickly.

We have complete ready made solution for Whatsapp Business API like Nodes, Core App, High Scalable & Availability Servers , Artificial Intelligence powered Chatbot Builder , Simplified API Similar to SMS

UI Based Solution

  • Broadcaster
  • Subscription Management
  • Smart Replies (AI & ML Powered)
  • Chatbot Builder
  • Workflows & Automations
  • Multi Agent LIVE Chat
  • Analytics & Reports

If you would like to apply an Whatsapp Business API through us, then please provide the following details to support@pickyassist.com

Your Company Name
Type of Company
Business Segment (Industry)
Brief about your business
Use Case for sending messages
How many employees working
Average Number of Messages in a Day
Few Sample messages you would like to send

Please note we dont have any control over WhatsApp 6 step screening process, based on our experience of onboarding many companies with whatsapp and facebook we can help you to ease the process and GO LIVE with less time.

For further discussion on Whatsapp Business API Integration & Development of AI Powered Chatbot or Innovative solutions based on Whatsapp or other messaging platforms please connect me through support@pickyassist.com

Leave a Reply


Your email address will not be published. Required fields are marked *

Related Posts


September 22, 2018

Sample Broadcast API Code in PHP

Sample Broadcast API Code in PHP Below is the sample broadcast API code is PHP, please replace the JSON data with your own data and submit

 

September 22, 2018

Picky Assist Partner Program

Picky Assist Partner Program At Picky Assist we believe in building great communication products and solutions for all the industries around the globe, we are a group of hardcore professionals having 13+ years of solid expertise in Chat Bot, Artificial Intelligence, Machine Learning, Advance Robotics, Internet of Things (IOT), Web & Mobile Technologies. Founded in