« Go back to wazaap.co

Wazaap.co API v1

SessionManagement

createSession

Create a new session

Create a new session. It will timeout in 600 seconds.


/create-session

Usage and SDK Samples

curl "https://api.wazaap.co/create-session?apikey=API_KEY&phone=PHONE_NUMBER"

Parameters

Query parameters
Name Description
apikey*
String
Your API key
Required
phone*
Integer
Phone number of the session
Required

Responses

status: "LOGGED_IN" is returned when existing cookies are used.

status: "SCAN_QR" with qrCode and qrCodeUrl is returned when cookies don't exist.

status: "ERROR" and code is returned when an error is occured.


listSessions

List sessions

List available sessions.


/list-sessions

Usage and SDK Samples

curl "https://api.wazaap.co/list-sessions?apikey=API_KEY"

Parameters

Query parameters
Name Description
apikey*
String
Your API key
Required

Responses

status: "SUCCESS" is returned with sessions array.

status: "ERROR" only occurs when API details are invalid.


deleteCookies

Delete session cookies

Deletes authentication cookies from server. You must scan QR code again on next session creation.


/delete-cookies

Usage and SDK Samples

curl "https://api.wazaap.co/delete-cookies?apikey=API_KEY&phone=PHONE_NUMBER"

Parameters

Query parameters
Name Description
apikey*
String
Your API key
Required
phone*
Integer
Phone number of the session
Required

Responses

status: "SUCCESS" is returned.

status: "ERROR" is returned.


isLoggedIn

Get login status

Gets login status and QR codes if not logged in.


/is-logged-in

Usage and SDK Samples

curl "https://api.wazaap.co/is-logged-in?apikey=API_KEY&phone=PHONE_NUMBER"

Parameters

Query parameters
Name Description
apikey*
String
Your API key
Required
phone*
Integer
Phone number of the session
Required

Responses

status: "SUCCESS" is returned.

status: "ERROR" is returned.


closeSession

Close session

Close session & disconnect from WhatsApp.


/session/close

Usage and SDK Samples

curl "https://api.wazaap.co/session/close?apikey=API_KEY&phone=PHONE_NUMBER"

Parameters

Query parameters
Name Description
apikey*
String
Your API key
Required
phone*
Integer
Phone number of the session
Required

Responses

status: "SUCCESS" is returned.

status: "ERROR" is returned.


UserInformation

getDetails

Get device details & last chats

Returns device details and last chats (up to 30).


/session/get-details

Usage and SDK Samples

curl "https://api.wazaap.co/session/get-details?apikey=API_KEY&phone=PHONE_NUMBER"

Parameters

Query parameters
Name Description
apikey*
String
Your API key
Required
phone*
Integer
Phone number of the session
Required

Responses

status: "SUCCESS" is returned.

status: "ERROR" is returned.


getRemoteDetails

Get another user's details

Returns an user's publicly accessible information.


/session/get-remote-details

Usage and SDK Samples

curl "https://api.wazaap.co/session/get-remote-details?apikey=API_KEY&phone=PHONE_NUMBER&recipient=18501234568"

Parameters

Query parameters
Name Description
apikey*
String
Your API key
Required
phone*
Integer
Phone number of the session
Required
recipient*
Integer
Phone number of target
Required

Responses

status: "SUCCESS" is returned.

status: "ERROR" is returned.


changeProfilePic

Change own profile picture

Changes your profile picture.


/session/change-profile-pic

Usage and SDK Samples

import requests
import base64

with open('file.png', 'rb') as f:
	encodedMedia = base64.b64encode(f.read())

requests.post("https://api.wazaap.co/session/change-profile-pic?apikey=API_KEY&phone=PHONE_NUMBER", data=encodedMedia)

Parameters

Query parameters
Name Description
apikey*
String
Your API key (GET)
Required
phone*
Integer
Phone number of the session (GET)
Required
media*
String
Base64 encoded media (POST data)
Required

Responses

status: "SUCCESS" is returned.

status: "ERROR" is returned.


Chats

sendMessage

Sends a text/location message

recipient isn't always verified. Wrong values might crash the session. lat and long must be used together.


/session/send

Usage and SDK Samples

curl "https://api.wazaap.co/session/send?apikey=API_KEY&phone=PHONE_NUMBER&recipient=18501234568&text=hello"

Parameters

Query parameters
Name Description
apikey*
String
Your API key
Required
phone*
Integer
Phone number of the session
Required
recipient*
Integer
Phone number of target
Required
text
Integer
Message contents
lat
BigDecimal
Latitude
long
BigDecimal
Longitude
noresp
Boolean
Doesn't wait for WhatsApp response, immediately returns
nocompose
Boolean
Doesn't mark status as composing, saves time

Responses

status: "SUCCESS" is returned.

status: "ERROR" is returned.


sendMediaMessage

Sends a media message

recipient isn't always verified. Wrong values might crash the session.


/session/send

Usage and SDK Samples

import requests
import base64

with open('file.png', 'rb') as f:
	encodedMedia = base64.b64encode(f.read())

requests.post("https://api.wazaap.co/session/send?apikey=API_KEY&phone=PHONE_NUMBER&recipient=18501234568&type=png", data=encodedMedia)

Parameters

Query parameters
Name Description
apikey*
String
Your API key (GET)
Required
phone*
Integer
Phone number of the session (GET)
Required
recipient*
Integer
Phone number of target (GET)
Required
text
Integer
Caption (GET)
type*
String
Media type (GET) (can be: jpg,png,pdf,webp-sticker for now)
Required
media*
String
Base64 encoded media (POST data) (max: 64MB)
Required
noresp
Boolean
Doesn't wait for WhatsApp response, immediately returns (GET)
nocompose
Boolean
Doesn't mark status as composing, saves time (GET)

Responses

status: "SUCCESS" is returned.

status: "ERROR" is returned.


loadMessages

Load chat messages

Loads last 50 messages of a chat. [Example project](https://github.com/sh4dowb/whatsapp-media-decrypt) to decrypt media files.


/session/load-messages

Usage and SDK Samples

curl "https://api.wazaap.co/session/load-messages?apikey=API_KEY&phone=PHONE_NUMBER&recipient=18501234568"

Parameters

Query parameters
Name Description
apikey*
String
Your API key
Required
phone*
Integer
Phone number of the session
Required
recipient*
Integer
Phone number of target or group ID
Required

Responses

status: "SUCCESS" is returned.

status: "ERROR" is returned.


createGroup

Creates a group

Title must be between 1-20 chars. Recipients are separated with a comma (,)


/session/create-group

Usage and SDK Samples

curl "https://api.wazaap.co/session/create-group?apikey=API_KEY&phone=PHONE_NUMBER&title=test&recipients=18501234568,18501234569"

Parameters

Query parameters
Name Description
apikey*
String
Your API key
Required
phone*
Integer
Phone number of the session
Required
title*
String
Title/name of the group. Length between 1-20
Required
recipients*
String
Phone numbers of targets, seperated with a comma ,
Required

Responses

status: "SUCCESS" is returned.

status: "ERROR" is returned.


markChatAsRead

Mark chat as read

Mark chat as read


/session/mark-read

Usage and SDK Samples

curl "https://api.wazaap.co/session/mark-read?apikey=API_KEY&phone=PHONE_NUMBER&recipient=18501234568"

Parameters

Query parameters
Name Description
apikey*
String
Your API key
Required
phone*
Integer
Phone number of the session
Required
recipient*
Integer
Phone number of target or group ID
Required

Responses

status: "SUCCESS" is returned.

status: "ERROR" is returned.


Webhooks

addWebhook

Adds a webhook

Adds a webhook with optional filters. Webhooks aren't persistent, they must be added again when session is closed and created later.
Webhook message is sent as JSON encoded in POST variable data. Message structure is same as loadMessages response.


/session/add-webhook

Usage and SDK Samples

curl "https://api.wazaap.co/session/add-webhook?apikey=API_KEY&phone=PHONE_NUMBER&webhookid=hello&webhookurl=https://example.com/webhook.php&messagecontains=hello"

Parameters

Query parameters
Name Description
apikey*
String
Your API key
Required
phone*
Integer
Phone number of the session
Required
webhookid*
String
Unique Webhook ID, can be any string
Required
webhookurl*
String
Publicly accessible URL of webhook. Must start with https:// or http://
Required
messagefrom
Integer
Filters messages from this number/ID. Requires exact match
messagecontains
String
Filters messages containing this text

Responses

status: "SUCCESS" is returned.

status: "ERROR" is returned.


deleteWebhook

Delete webhook

Delete webhook by ID.


/session/delete-webhook

Usage and SDK Samples

curl "https://api.wazaap.co/session/delete-webhook?apikey=API_KEY&phone=PHONE_NUMBER&webhookid=hello"

Parameters

Query parameters
Name Description
apikey*
String
Your API key
Required
phone*
Integer
Phone number of the session
Required
webhookid*
String
Webhook ID
Required

Responses

status: "SUCCESS" is returned.

status: "ERROR" is returned.


listWebhooks

List webhook IDs

Lists webhook IDs.


/session/list-webhooks

Usage and SDK Samples

curl "https://api.wazaap.co/session/list-webhooks?apikey=API_KEY&phone=PHONE_NUMBER"

Parameters

Query parameters
Name Description
apikey*
String
Your API key
Required
phone*
Integer
Phone number of the session
Required

Responses

status: "SUCCESS" is returned.

status: "ERROR" is returned.