919834129437 sales@waapi.in

WhatsApp Integration with Python – http.client

Jun 5, 2021 | API Documentation | 0 comments

GET

Login to Waapi

http://192.168.1.36:44442/api/login?from=GKH-UIJ-UGE-FGH-MLV&email=admin@callcenter.in&serverKey=FYE-DKX-PSX-UNV-BAN

login your instance

  PARAMS
  from
  GKH-UIJ-UGE-FGH-MLV
  email
  admin@callcenter.in
  serverKey   FYE-DKX-PSX-UNV-BAN
Example Request                       Login to Waapi
import http.client conn = http.client.HTTPSConnection(“192.168.1.36″, 44442) payload = ” headers = {} conn.request(“GET”, “/api/login?from=GKH-UIJ-UGE-FGH-MLV&email=admin@callcenter.in&serverKey=FYE-DKX-PSX-UNV-BAN”, payload, headers) res = conn.getresponse() data = res.read() print(data.decode(“utf-8”))

GET

Send Text Message

http://192.168.1.36:44442/api/sendmessage?from=GKH-UIJ-UGE-FGH-MLV&message=your message&type=text&to=012138227697&messageId=ab1asas3t2ss4aas1g5&callback=http://your-url.com/get/waapi/status
  PARAMS
  from
  GKH-UIJ-UGE-FGH-MLV
  message
  your message
  type   text
  to
  012138227697
  messageId   ab1asas3t2ss4aas1g5
  callback
  http://your-url.com/get/waapi/status
Example Request                          Send Text Message

import http.client conn = http.client.HTTPSConnection(“192.168.1.36″, 44442) payload = ” headers = {} conn.request(“GET”, “/api/sendmessage?from=GKH-UIJ-UGE-FGH-MLV&message=your%20message&type=text&to=012138227697&messageId=ab1asas3t2ss4aas1g5&callback=http://your-url.com/get/waapi/status”, payload, headers) res = conn.getresponse() data = res.read() print(data.decode(“utf-8”))

GET

Send Image/Video Message

http://192.168.1.36:44442/api/sendMessage?from=GKH-UIJ-UGE-FGH-MLV&caption=test caption&message=https://www.waapi.in/wp-content/uploads/2021/04/WA.png&type=document&to=012138227697&messageId=ab1asas3t2ss4aas1g5&callback=http://your-url.com/get/waapi/status
  PARAMS
  from
  GKH-UIJ-UGE-FGH-MLV
  caption
  test caption
  message
  https://www.waapi.in/wp-content/uploads/2021/04/WA.png
  type   document
  to   012138227697
  messageId
  ab1asas3t2ss4aas1g5
  callback   http://your-url.com/get/waapi/status
Example Request                 Send Image/Video Message
import http.client conn = http.client.HTTPSConnection(“192.168.1.36″, 44442) payload = ” headers = {} conn.request(“GET”, “/api/sendMessage?from=GKH-UIJ-UGE-FGH-MLV&caption=test%20caption&message=https://www.waapi.in/wp-content/uploads/2021/04/WA.png&type=document&to=012138227697&messageId=ab1asas3t2ss4aas1g5&callback=http://your-url.com/get/waapi/status”, payload, headers) res = conn.getresponse() data = res.read() print(data.decode(“utf-8”))

GET

Send Document(PDF,CSV)

http://192.168.1.36:44442/api/sendMessage?from=GKH-UIJ-UGE-FGH-MLV&message=https://www.waapi.in/wp-content/uploads/2021/04/WA.png&type=document&to=012138227697&messageId=ab1asas3t2ss4aas1g5&callback=http://your-url.com/get/waapi/status

Note :
caption could not be sent with file’s , it will be sent as text message while sending pdf
caption is optional parameter

  PARAMS
  from
GKH-UIJ-UGE-FGH-MLV
  caption
  test caption
  message
  https://www.waapi.in/wp-content/uploads/2021/04/WA.png
  type   document
  to   012138227697
  messageId
  ab1asas3t2ss4aas1g5
  callback   http://your-url.com/get/waapi/status
Example Request                             Send Document(PDF,CSV)
import http.client conn = http.client.HTTPSConnection(“192.168.1.36″, 44442) payload = ” headers = {} conn.request(“GET”, “/api/sendMessage?from=GKH-UIJ-UGE-FGH-MLV&message=https://www.waapi.in/wp-content/uploads/2021/04/WA.png&type=document&to=012138227697&messageId=ab1asas3t2ss4aas1g5&callback=http://your-url.com/get/waapi/status”, payload, headers) res = conn.getresponse() data = res.read() print(data.decode(“utf-8”))

GET

Message logs

http://192.168.1.36:44442/api/messagestatus?from=GKH-UIJ-UGE-FGH-MLV&fromdate=01-06-2021&todate=30-06-2021&fomat=json

format : html/json

Extra parameters :

status : Queued , NOT REGISTERED , SUCCESS , FAILED
number : search by customer number

  PARAMS
  from
  GKH-UIJ-UGE-FGH-MLV
  fromdate
  01-06-2021
  todate
  30-06-2021
  fomat   json

Example Request                         Message logs

import http.client conn = http.client.HTTPSConnection(“192.168.1.36″, 44442) payload = ” headers = {} conn.request(“GET”, “/api/messagestatus?from=GKH-UIJ-UGE-FGH-MLV&fromdate=01-06-2021&todate=30-06-2021&fomat=json”, payload, headers) res = conn.getresponse() data = res.read() print(data.decode(“utf-8”))

GET

Check Server Status

http://192.168.1.36:44442/api/serverstatus?from=GKH-UIJ-UGE-FGH-MLV&flag=login

check instance is logged in on server or not

  PARAMS
  from
  GKH-UIJ-UGE-FGH-MLV
  flag   login
Example Request                          Check Server Status

import http.client conn = http.client.HTTPSConnection(“192.168.1.36″, 44442) payload = ” headers = {} conn.request(“GET”, “/api/serverstatus?from=GKH-UIJ-UGE-FGH-MLV&flag=login”, payload, headers) res = conn.getresponse() data = res.read() print(data.decode(“utf-8”))

GET

Logout

http://192.168.1.36:44442/api/logout?from=GKH-UIJ-UGE-FGH-MLV&email=admin@callcenter.in

Logout for your instance , old data may deleted

  PARAMS
  from
  GKH-UIJ-UGE-FGH-MLV
  email   admin@callcenter.in
Example Request                                        Logout

import http.client conn = http.client.HTTPSConnection(“192.168.1.36″, 44442) payload = ” headers = {} conn.request(“GET”, “/api/logout?from=GKH-UIJ-UGE-FGH-MLV&email=admin@callcenter.in”, payload, headers) res = conn.getresponse() data = res.read() print(data.decode(“utf-8”))

GET

Restart Server

http://192.168.1.36:44442/api/restart?from=GKH-UIJ-UGE-FGH-MLV&email=admin@callcenter.in

Restart your instance

  PARAMS
  from
  GKH-UIJ-UGE-FGH-MLV
  email   admin@callcenter.in
Example Request                          Restart Server
import http.client conn = http.client.HTTPSConnection(“192.168.1.36″, 44442) payload = ” headers = {} conn.request(“GET”, “/api/restart?from=GKH-UIJ-UGE-FGH-MLV&email=admin@callcenter.in”, payload, headers) res = conn.getresponse() data = res.read() print(data.decode(“utf-8”))

Other posts you might like

Official WhatsApp API Benefits

Official WhatsApp API Benefits

True, the procedures for obtaining an official API are complex and stringent. Notwithstanding, it is critical for medium to large businesses to demonstrate the enterprise’s authenticity.The official WhatsApp API also provides more stable and efficient services in...

Unofficial WhatsApp API Benefits

Unofficial WhatsApp API Benefits

It is easier and less expensive for small businesses to apply for the unofficial WhatsApp API. For the time being, most smaller businesses do not require a personalized system to meet their customer service needs. In the short term, the unofficial API’s benefits and...

Unofficial WhatsApp API

Unofficial WhatsApp API

Meta (formerly Facebook) has restricted access to the WhatsApp Business API until May 2021, and only well-known brands can use it. As a result, many small and medium-sized businesses obtain unofficial APIs in order to use the API’s extended functions. They accomplish...