This API deals with a chatting platform based on WhatsApp. With the endpoints that are created for the user, the user can send and receive text and media messages through WhatsApp in private chats. Moreover, the current status and the screen of the session can be retrieved using these endpoints. With the account specific endpoints, user can get the product or registered phones information, edit and remove these. Currently the API allows you to add a specific determined number of phones into one account regarding your purchase package.
It is an address, to which all the acknowledge information of the sent messages and all the received messages are delivered. It is specified by the user.
Returns the screenshot of the screen in the current session.
Returns the status of the current session.
{
"success": true,
"status": {
"loggedIn": true/false,
"isQr": true/false,
"loading": true/false,
"connRetry": true/false,
"message": "..."
}
}
The status parameters are:
STATES | MEANINGS |
---|---|
loggedIn | if the qr-screen is also passed and the chat screen is opened |
isQr | if the session is in qr-screen |
loading | if the session is loading before the qr-screen or after passes qr-screen |
connRetry | if the internet connection is not available and page is refreshed |
message | specific message from Whatsapp about the status |
Gets the image of qr-code.
Restarts the session by refreshing the page.
{
"success": true
}
Backups the material needed for opening the same chat screen for the current phone number. This call is useful when the
session is active and also the status of the session is active. Later, the response information can be used to open
the chat screen with the POST restore
call.
{
"success": true,
"data": {
(all the current session information)
}
}
Reloads the current session based on the reload data.
POST backup
, when session is open and status is active.{
"WABrowserId": "...",
"debugCursor": "...",
"remember-me": "...",
"whatsapp-mutex": "..."
}
{
"success": true
}
Logouts the number from the current session and converts the screen to qr-code screen.
{
"success": true
}
Sends both text and media (image, video, sound, document) to the user, whose number is taken at the body of the request.
{
"to_number": "...",
"message": "...",
"type" : "text" / "media"
}
PARAMETES | USAGE |
---|---|
to_number | with the country code excluding + , e.g. 905001112233 for Turkey |
type | if a text message is sent, then type is text , for other types the type parameter is media |
message | if the message is a text message, then the message itself, if the message is a media message, then either the direct web link of the media or if the media is an image under 1MB, then its base64 text can be also given. |
{
"success": true,
"data": {
"chatId": "...",
"msgId": "..."
}
}
PARAMETES | USAGE |
---|---|
chatId | the specific id of the chat the message is sent to |
msgId | the specific id of the message sent (can be useful for matching with the acknowledgement notifications) |
Gets the product id and webhook url of the account.
{
"pid": "...",
"webhook": "...",
"ack_delivery": 0 / 1,
"phone_limit": ...
}
PARAMETES | USAGE |
---|---|
pid | product id of the account |
webhook | webhook url of the account, the incoming messages and acknowledge messages are directed there |
ack_delivery | 0, if the acknowledge message delivery is not enabled; 1, otherwise |
Gets the list of phones with their id’s and numbers that are registered to the given product id.
[
{
"id": ...,
"number": "..."
},
{
"id": ...,
"number": "..."
},
...
]
PARAMETES | USAGE |
---|---|
id | id of the phone object assigned by the database automatically |
number | the number registered for the specific id |
Sets the webhook url. Webhook is used for directing the incoming messages and some changes in the session.
{
"webhook": "..."
}
{
"pid": "...",
"webhook": "...",
"ack_delivery": 0 / 1,
"phone_limit": ...
}
Adds a new phone object to the database for the product determined by the taken product id. A number can also be specified in that step but if not, the phone number in the active session after the qr-screen process is entered to the database.
{
"number": "..."
}
** Successful Response: returns the current phone object.
{
"id": ...,
"pid": "...",
"number": ...
}
Sets the acknowledge notification preference to true or false. If it is set to true, then every acknowledge message of the delivered messages are sent to the webhook address if a webhook address is available. Otherwise, no acknowledgement is sent to the webhook.
{
"preference": true / false
}
** Successful Response: returns the current product information.
{
"pid": "...",
"webhook": "...",
"ack_delivery": 0 / 1,
"phone_limit": ...
}
Every single incoming message is delivered into the webhook address if there is one available.
Successful Return Format :
{
"productId": "...",
"phoneId": ...,
"message": {
"type": "text" / "image" / ... ,
(message specific parameters)
},
"user": {
"id": "...",
"name": "...",
"phone": "...",
"image": "..."
},
"conversation": "...",
"receiver": "...",
"timestamp": ...,
"type": "message",
"reply":"..."
}
PARAMETES | USAGE |
---|---|
user | specific information about the user, who sent the message to us |
conversation | chat id |
receiver | receiver’s phone number, in that case our phone number |
timestamp | the timestamp of the incoming message (last ‘000’ are excluded) |
If the acknowledge notifications are enabled, then for evety acknowledgement, a notification is sent to the webhook address. Acknowledge messages are checked in every 2 seconds and every single acknowledgement after the previous delivery are placed to an array and this array is returned to the user.
Successful Return Format :
[
{
"ackType": "delivered" / "reached" / "seen",
"chatId": "...",
"msgId": "..."
},
{
"ackType": "delivered" / "reached" / "seen",
"chatId": "...",
"msgId": "..."
},
...
]
PARAMETES | USAGE |
---|---|
ackType | delivered: for 1 tick, reached: for 2 ticks, seen: for blue ticks |
chatId | the id of the specific chat where the acknowledged message is placed |
msgId | the id of the specific message acknowledged |