0% found this document useful (0 votes)
56 views10 pages

Waboxapp API v2

The document outlines the WaboxApp API for sending messages, images, links, and media via WhatsApp, detailing the required parameters and response formats for each action. It also includes information on checking account status and receiving event notifications through webhooks. Each API call requires authentication via a token and provides responses in JSON format indicating success or error statuses.

Uploaded by

Iller Akenar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views10 pages

Waboxapp API v2

The document outlines the WaboxApp API for sending messages, images, links, and media via WhatsApp, detailing the required parameters and response formats for each action. It also includes information on checking account status and receiving event notifications through webhooks. Each API call requires authentication via a token and provides responses in JSON format indicating success or error statuses.

Uploaded by

Iller Akenar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

API REST

Basic concepts
URL https://www.waboxapp.com/api
Requests GET / POST
Standard HTTP format (application/x-www-form-urlencoded)
Responses JSON format
HTTP 200 code and “success” field when action is successfully done
HTTP 403 code and “error” field on authentication failure
HTTP 400 code and “error” field on parameters validation failure
Send WhatsApp text message (chat)
URL https://www.waboxapp.com/api/send/chat
Method GET / POST

Mandatory parameters
token Your waboxapp API token or Your
enabled APP token
uid Your WhatsApp account phone Ex. 34666123456
number with international code
to Recipient WhatsApp account phone Ex. 34666789123
number with international code
custom_uid Your custom unique ID for the new Must be unique
message to be send Will be sent back to you on
ACK events
text Text to be send Hello dude!

Response: JSON format


success Message successfully received by true
waboxapp
custom_uid Your custom unique ID for this Ex. SJER345FL56
message

Example
POST
https://www.waboxapp.com/api/send/chat?token=my_token&uid=34666123456&to=346
66789123&custom_uid=msg0001&text=Hello+dude

{
"success": true,
"custom_uid": msg0001
}
Send image
URL https://www.waboxapp.com/api/send/image
Method GET / POST

Mandatory parameters
token Your waboxapp API token or Your
enabled APP token
uid Your WhatsApp account phone Ex. 34666123456
number with international code
to Recipient WhatsApp account phone Ex. 34666789123
number with international code
custom_uid Your custom unique ID for the new Must be unique
message to be send Will be sent back to you on
ACK events
url URL of image to send Ex. https://go.gl/image.png

Optional parameters
caption Title to show on image preview Ex. A cute dog
description Extended description to show on Ex. This is just a test of image
image preview sending

Response: JSON format


success Message successfully received by true
waboxapp
custom_uid Your custom unique ID for this Ex. SJER345FL56
message
Send link (with preview)
URL https://www.waboxapp.com/api/send/link
Method GET / POST

Mandatory parameters
token Your waboxapp API token or Your
enabled APP token
uid Your WhatsApp account phone Ex. 34666123456
number with international code
to Recipient WhatsApp account phone Ex. 34666789123
number with international code
custom_uid Your custom unique ID for the new Must be unique
message to be send Will be sent back to you on
ACK events
url URL of link to send Ex. https://mysite.com/home

Optional parameters
caption Title to show on link preview Ex. My site
description Extended description to show on link Ex. The best place to stay
preview over all Internet
url_thumb URL of thumb image to show on link Ex. https://go.gl/image.png
preview

Response: JSON format


success Message successfully received by true
waboxapp
custom_uid Your custom unique ID for this Ex. SJER345FL56
message

Note: When a link caption, description or url_thumb are not provided, they are taken from
link itself metada.
Send media (any kind of file)
URL https://www.waboxapp.com/api/send/media
Method GET / POST

Mandatory parameters
token Your waboxapp API token or Your
enabled APP token
uid Your WhatsApp account phone Ex. 34666123456
number with international code
to Recipient WhatsApp account phone Ex. 34666789123
number with international code
custom_uid Your custom unique ID for the new Must be unique
message to be send Will be sent back to you on
ACK events
url URL of file to send Ex. https://go.gl/doc.pdf

Optional parameters
caption Title to show on file preview Ex. Our document
description Extended description to show on file Ex. PDF with detailed
preview arguments about or mission
url_thumb URL of thumb image to show on file Ex. https://go.gl/icon.png
preview

Response: JSON format


success Message successfully received by true
waboxapp
custom_uid Your custom unique ID for this Ex. SJER345FL56
message
Check account (phone number) status
URL https://www.waboxapp.com/api/status/[uid]
Method GET / POST

Mandatory parameters
token Your waboxapp API token or Your
enabled APP token
[uid] In-URL parameter Ex. 34666123456
Your WhatsApp account phone
number with international code

Response: JSON format


success Message successfully received by true
waboxapp
uid Your WhatsApp account phone Ex. 34666123456
number with international code
hook_url Account URL for web hooks Ex. http://reqb.in/ABC
alias Your WhatsApp account name
platform Your smartphone platform
battery Your smartphone battery percentage
plugged Indicates whether your smartphone is Ex. 0/1
plugged and charging
locale Your WhatsApp web session locale Ex. en-GB

Example
POST https://www.waboxapp.com/api/status/34666123456?token=my_token

{
"success": true,
"uid": "34666123456",
"hook_url": " http://reqb.in/ABC ",
"alias": "My WA account",
"platform": "android",
"battery": "69",
"plugged": "0",
"locale": "en-GB"
}
Events notification (hooks) in real time
Webhooks are calls made to your custom URL when any event gets fired. You can define
your own hooks URL at client and account levels.

Event: New message received


URL waboxapp will call your URL
Method POST

Request (POST form)


event message
token Your waboxapp API token or Your
enabled APP token
uid Your WhatsApp account phone Ex. 34666123456
number with international code
contact[uid] Sender WhatsApp account phone Ex. 34666123456
number
contact[name] Sender WhatsApp account name Ex. Peter
contact[type] Sender type Ex. user
Ex. group
message[dtm] Message sent timestamp Ex. 1487082303
message[uid] WhatsApp unique ID for this message Ex. 62397B58E3E0B
message[cuid] Your custom unique ID for this
message, if sent by you
message[dir] Message direction Ex: i (input)
Ex: o (output)
message[type] Message type Ex: chat, image, video, audio,
document, vcard, location
message[body] Message content. It depends con See messages types appendix
message[type] for details
ack WhatsApp acknowledge status for this See messages ACK status
message appendix for details

Example
POST https://requestb.in/xh9tvh

{
"event": "message",
"token": "abcd1234",
"contact[uid]": "34666123456",
"contact[name]": "Peter",
"contact[type]": "user",
"message[dtm]": 1487082303,
"message[uid]": "62397B58E3E0B",
"message[cuid]": "",
"message[dir]": "i",
"message[type]": "chat",
"message[body][text]": "Hey! How are you doing?",
"message[ack]": 3
}

Event: Message acknowledge (ACK)


URL waboxapp will call your URL
Method POST

Request (POST form)


event ack
token Your waboxapp API token or Your
enabled APP token
uid Your WhatsApp account phone Ex. 34666123456
number with international code
muid WhatsApp unique ID for this message Ex. 62397B58E3E0B
cuid Your custom unique ID for this
message, if sent by you
ack WhatsApp acknowledge status for this See messages ACK status
message appendix for details

Example
POST https://requestb.in/xh9tvh

{
"event": "ack",
"token": "abcd1234",
"uid": "74397B58E3ELZ",
"cuid": "your-cutom-id",
"ack": 3
}
Appendix: Messages types
Type Body structure
chat text – Message text
image caption – Media caption
mimetype – Media mime type
size – Media size in bytes
thumb – Media thumb preview in base64
url – Media URL (15-day retention)
video caption – Media caption
mimetype – Media mime type
size – Media size in bytes
duration – Media duration in seconds
thumb – Media thumb preview in base64
url – Media URL (15-day retention)
audio caption – Media caption
mimetype – Media mime type
size – Media size in bytes
duration – Media duration in seconds
url – Media URL (15-day retention)
ptt caption – Media caption
(recorded audio) mimetype – Media mime type
size – Media size in bytes
duration – Media duration in seconds
url – Media URL (15-day retention)
document caption – Media caption
mimetype – Media mime type
size – Media size in bytes
thumb – Media thumb preview in base64
url – Media URL (15-day retention)
vcard contact – Contact name
vcard – vCard content
location name – Place name
lng – Longitude coordinate
lat – Latitude coordinate
thumb – Place map preview in base64
url – Place URL
Appendix: Acknowledge (ACK) status
Type Body structure
0 Message still not sent to WhatsApp servers
1 Message sent to WhatsApp servers
2 Message delivered to recipient
3 Message read by recipient
(note: it can be masked as status “2” depending on recipient’s privacy
settings)

You might also like