Bot request

Legacy APIs - WhatsApp
Legacy WhatsApp API We only offer this type of WhatsApp API to customers who specifically request it. We have now moved to the official WhatsApp. To use official WhatsApp, contact us on WhatsApp +265992026866.
Starting a new integration? This is a legacy API. It stays available for existing integrations, but new integrations should use the SMS V3 APIs.

For a WhatsApp bot, we send every message of the user to your server and your server replies with the message to send back.

We call your server. Your server must be reachable from the internet.

POSThttps://YOUR_SERVER/your_application_url_end_point

We send a JSON body to your server, and your server replies with a JSON body.

What we send

Parameter Required Description
body YES The text of the request.
sessionid YES The session id.
msisdn YES The phone number with the country code, without the plus sign.
key YES A security key known by our server and your server.

Example

{
  "body": "text of the request",
  "sessionid": "session id",
  "msisdn": "phone_number_with_country_code_without_plus",
  "key": "security_key_known_by_our_server_and_your_server"
}

Response

Reply from your server

{
  "msisdn": "phone_number_in_session",
  "sessionid": "session_id_in_session",
  "type": 1,
  "body": "Message to be \ndisplayed on user\n screen"
}

Fields explained

FieldDescription
msisdnThe phone number of the session.
sessionidThe id of the session.
type1 or "continue" to continue the session: the message is shown and we wait for the reply of the user. 2 or "end" to end the session: the message is shown and the session closes.
bodyThe message to display on the screen of the user.

Good to know

  • This works like a bot: every request we send to your server gets a reply from your server.
  • Reply with type 1 (or "continue") to continue the session, or type 2 (or "end") to end it.
  • Your server must be reachable from the internet, and it should check the key before it replies.