API & Webhooks Documentation

Welcome to the WaRespond API & Webhooks! You can use our API to access WaRespond API endpoints & receive incoming Webhooks, which can be used to create new WaRespond instance, retrieve QR code, trigger on new WhatsApp messages received, reboot, reset or reconnect instance as well as sending out WhatsApp text and file messages to individual or group chats.

The main endpoint is:

https://warespond.xyz/api

Authentication

WaRespond uses access tokens to allow access to the API. You can register for a developer account here.

WaRespond expects for the access token to be included in all API requests to the server in a header that looks like the following:

access_token=ACCESS_TOKEN
You must replace ACCESS_TOKEN with your personal access token.

Instance API

POST Create Instance

https://warespond.xyz/api/createinstance.php?access_token=ACCESS_TOKEN

Create a new Instance ID

Parameters

access_token=ACCESS_TOKEN

POST Get QR Code

https://warespond.xyz/api/getqrcode.php?instance_id=INSTANCE_ID&access_token=ACCESS_TOKEN

Create a new Instance ID

Parameters

instance_id=INSTANCE_ID
access_token=ACCESS_TOKEN

POST Set Receiving Webhook

https://warespond.xyz/api/setwebhook.php?webhook_url=https://webhook.site/xxxxxxxx&enable=true&instance_id=INSTANCE_ID&access_token=ACCESS_TOKEN

Get all return values from WhatsApp such as connection status, Incoming message, Outgoing message, Disconnected, Change Battery, etc.

Parameters

webhook_url=https://webhook.site/xxxxxxxx
enable=true
instance_id=INSTANCE_ID
access_token=ACCESS_TOKEN

POST Reboot Instance

https://warespond.xyz/api/reboot.php?instance_id=INSTANCE_ID&access_token=ACCESS_TOKEN

Logout of WhatsApp Web and do a fresh scan.

Parameters

instance_id=INSTANCE_ID
access_token=ACCESS_TOKEN

POST Reset Instance

https://warespond.xyz/api/resetinstance.php?instance_id=INSTANCE_ID&access_token=ACCESS_TOKEN

Logout of WhatsApp Web, Change Instance ID, Delete all old instance data

Parameters

instance_id=INSTANCE_ID
access_token=ACCESS_TOKEN

POST Reconnect Instance

https://warespond.xyz/api/reconnect.php?instance_id=INSTANCE_ID&access_token=ACCESS_TOKEN

Re-initiate connection from app to WhatsApp Web when connection is lost

Parameters

instance_id=INSTANCE_ID
access_token=ACCESS_TOKEN

Send Direct Message API

POST Send Text

https://warespond.xyz/api/send.php?number=xxxxxxxx&type=text&message=test%20message&instance_id=INSTANCE_ID&access_token=ACCESS_TOKEN

Send a text message to a phone number through the app

Parameters

number=xxxxxxxx
type=text
message=test message (URL needs to be encoded)
instance_id=INSTANCE_ID
access_token=ACCESS_TOKEN

POST Send Text with Button

https://warespond.xyz/api/send.php?number=xxxxxxxx&type=text&message=text%20message%0A_%5Ebutton%20name%201_button%20text%201_%5E_%0A_%5Ebutton%20name%202_button%20text%202_%5E_%0A_%5Ebutton%20name%203_button%20text%203_%5E_&instance_id=INSTANCE_ID&access_token=ACCESS_TOKEN

Send a text message with a button to a phone number through the app. Selecting the button will trigger a message reply.

Parameters

number=xxxxxxxx
type=text
message= text message _^button name 1_button text 1_^_ _^button name 2_button text 2_^_ _^button name 3_button text 3_^_ (URL needs to be encoded, you can have up to 3 buttons, button name is an identifier & not shown to the user)
instance_id=INSTANCE_ID
access_token=ACCESS_TOKEN

POST Send Text with Link Button

https://warespond.xyz/api/send.php?number=xxxxxxxx&type=text&message=text%20message%0A_%5Ebutton%20name_button%20text_https%3A%2F%2Furllinkbutton.com_%5E_&instance_id=INSTANCE_ID&access_token=ACCESS_TOKEN

Send a text message with a button to a phone number through the app. Selecting the button will trigger a message reply.

Parameters

number=xxxxxxxx
type=text
message= text message _^button name_button text_https://urllinkbutton.com_^_ (URL needs to be encoded, you can have up to 3 buttons, button name is an identifier and will not be shown to the user)
instance_id=INSTANCE_ID
access_token=ACCESS_TOKEN

POST Send Media

https://warespond.xyz/api/send.php?number=xxxxxxxx&type=media&message=test%20message&media_url=https://mediahosting.com/file&filename=FILENAME.jpg&instance_id=INSTANCE_ID&access_token=ACCESS_TOKEN

Send a media or file with message to a phone number through the app

Parameters

number=xxxxxxxx
type=media
message=test message (URL needs to be encoded)
media_url=https://mediahosting.com/file
filename=FILENAME.jpg (only used for sending media)
instance_id=INSTANCE_ID
access_token=ACCESS_TOKEN

POST Send Media with Button & Link

For a better idea on how to use this API, please also refer to Send Text with Button and Send Text with Button Link

https://warespond.xyz/api/send.php?number=xxxxxxxx&type=media&message=test%20message%0A_%5Ebutton%20name_button%20text_https%3A%2F%2Furllinkbutton.com_%5E_&media_url=https://mediahosting.com/file&filename=FILENAME.jpg&instance_id=INSTANCE_ID&access_token=ACCESS_TOKEN

Send a media or file with message to a phone number through the app

Parameters

number=xxxxxxxx
type=media
message= test message _^button 1 text_button 1 reply message_https://urllinkbutton.com_^_ (URL needs to be encoded, you can add links into buttons and have up to 3 buttons, button name is an identifier and does not show to the user)
media_url=https://mediahosting.com/file
filename=FILENAME.jpg
instance_id=INSTANCE_ID
access_token=ACCESS_TOKEN

Send Group Message API

POST Send Text to Group

https://warespond.xyz/api/sendgroupmsg.php?group_id=xxxxxxxx@g.us&type=text&message=test%20message&instance_id=INSTANCE_ID&access_token=ACCESS_TOKEN

Send a text message to a group through the app

Parameters

group_id=xxxxxxxx@g.us
type=text
message=test message (URL needs to be encoded)
instance_id=INSTANCE_ID
access_token=ACCESS_TOKEN

POST Send Media & Files to Group

https://warespond.xyz/api/sendgroupmsg.php?group_id=xxxxxxxx@g.us&type=media&message=test%20message&media_url=https://mediahosting.com/file&filename=FILENAME.jpg&instance_id=INSTANCE_ID&access_token=ACCESS_TOKEN

Send a media or file with message to a group through the app

Parameters

group_id=xxxxxxxx@g.us
type=text
message=test message (URL needs to be encoded)
media_url=https://mediahosting.com/file
filename=FILENAME.jpg
instance_id=INSTANCE_ID
access_token=ACCESS_TOKEN

Is this article helpful?

Articles in this section: