Welcome to v1
Watsler is a leading Arabic platform that provides WhatsApp bot services through QR code scanning. It simplifies the integration of WhatsApp functionalities into your applications, allowing for seamless communication automation. The Watsler API offers a range of endpoints to manage WhatsApp instances, send messages, and handle webhooks.
Key Features:
- Instance Management: Create, reboot, reset, and reconnect instances to manage WhatsApp connections efficiently.
- Messaging: Send text and media messages to individual contacts and groups.
- Webhook Integration: Set up webhooks to receive updates on WhatsApp events such as incoming messages, connection status, and more.
Getting Started:
To use the Watsler API, you need to authenticate using an access token. The API endpoints support various operations essential for WhatsApp bot functionality. Getting Started
instance
- Create Instance
Description: Creates a new instance ID for managing WhatsApp connections.
Parameter | Required | Type | Description |
---|---|---|---|
access_token | YES | string | Your access token |
GET https://watsler.com/api/create_instance?access_token={{token}}
{
"status": "success",
"message": "Instance ID generated successfully",
"instance_id": "665A54F2CBXB6"
}
- Generate qr code
Description: Generates a QR code to log in to WhatsApp Web.
Parameter | Required | Type | Description |
---|---|---|---|
access_token | YES | string | Your access token |
instance_id | YES | string | The ID of the instance |
Example:
GET https://watsler.com/api/generate_qrcode?instance_id={{instance_id}}&access_token={{token}}
{
"status": "success",
"message": "Success",
"base64": "data:image/png;base64,iVBORw06....."
}
- Webhook Instance
Description: Sets the webhook URL to receive WhatsApp events.
Parameter | Required | Type | Description |
---|---|---|---|
access_token | YES | string | Your access token |
instance_id | YES | string | The ID of the instance |
webhook_url | YES | string | The URL to receive webhook events. |
enable | YES | boolean | Boolean to enable or disable the webhook. |
Example:
GET https://watsler.com/api/set_webhook?webhook_url={{url}}&enable=true&instance_id={{instance_id}}&access_token={{token}}
{
"status": "success",
"message": "Webhook URI Saved"
}
- Reinitialize instance
Description: Logs out from WhatsApp Web and performs a fresh scan to reinitialize the instance.
Parameter | Required | Type | Description |
---|---|---|---|
access_token | YES | string | Your access token |
instance_id | YES | string | The ID of the instance |
Example:
GET https://watsler.com/api/reinitialize?instance_id={{instance_id}}&access_token={{token}}
{
"status": "success",
"message": "Success"
}
- Destroy instance
Description: Logs out from WhatsApp Web, changes the Instance ID, and deletes all old instance data.
Parameter | Required | Type | Description |
---|---|---|---|
access_token | YES | string | Your access token |
instance_id | YES | string | The ID of the instance |
Example:
GET https://watsler.com/api/destroy?instance_id={{instance_id}}&access_token={{token}}
{
"status": "success",
"message": "Reset Instance ID was successful"
}
- Reconnect instance
Description: Re-initiates the connection to WhatsApp Web when the connection is lost.
Parameter | Required | Type | Description |
---|---|---|---|
access_token | YES | string | Your access token |
instance_id | YES | string | The ID of the instance |
Example:
GET https://watsler.com/api/reconnect?instance_id={{instance_id}}&access_token={{token}}
{
"status": "success",
"message": "Success",
"data": {
"id": "966597070416:[email protected]",
"name": "عين لتقنية المعلومات",
"avatar": "https://pps.whatsapp.net/v/t61.24694-24/420836702_1039921437777480_6157537768758314540_n.jpg?stp=dst-jpg_s96x96&ccb=11-4&oh=01_Q5AaIFgtDL84Dg9hfKW5dYTp2qi3BYWsxEan3wMIYajs87Mb&oe=6667C92E&_nc_sid=e6ed6c&_nc_cat=108"
}
}
Send Message
Description: Send Message
Parameter | Required | Type | Description |
---|---|---|---|
access_token | YES | string | Your access token |
instance_id | YES | string | The ID of the instance |
number | YES | string | The recipient's phone number or chat_id ([email protected] , 9665097070416) |
type | YES | string | The type of message (text , media) |
message | YES | string | The message content |
Example:
POST https://watsler.com/api/send_message
Content-Type: application/json
{
"number": "966597070416",
"type": "text",
"message": "test message",
"instance_id": "609ACF283XXXX",
"access_token": "664ed52e3XXXX"
}
{
"status": "success",
"message": {
"key": {
"remoteJid": "[email protected]",
"fromMe": true,
"id": "BAE5F139C934D8BB"
},
"message": {
"extendedTextMessage": {
"text": "Hola Emad Mohammed."
}
},
"messageTimestamp": "1717217958"
}
}
- Send Media & File
Description: Sends a media file or document with a message to a specified phone number.
Parameter | Required | Type | Description |
---|---|---|---|
access_token | YES | string | Your access token |
instance_id | YES | string | The ID of the instance |
number | YES | string | The recipient's phone number or chat_id ([email protected] , 9665097070416) |
type | YES | string | media |
message | YES | string | The message content |
media_url | YES | string | The URL of the media file |
filename | NO | string | The filename for documents |
- Send Text Message to Group
Description: Sends a text message to a specified WhatsApp group.
Parameter | Required | Type | Description |
---|---|---|---|
access_token | YES | string | Your access token |
instance_id | YES | string | The ID of the instance |
number | YES | string | The recipient's phone number or chat_id ([email protected] , 9665097070416) |
type | YES | string | text |
message | YES | string | The message content |
- Send Media & File Message to Group
Description: Sends a media file or document with a message to a specified WhatsApp group.
Parameter | Required | Type | Description |
---|---|---|---|
access_token | YES | string | Your access token |
instance_id | YES | string | The ID of the instance |
number | YES | string | The recipient's phone number or chat_id ([email protected] , 9665097070416) |
type | YES | string | media |
message | YES | string | The message content |
media_url | YES | string | The URL of the media file |
filename | NO | string | The filename for documents |