Overview

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

  1. Create Instance

Description: Creates a new instance ID for managing WhatsApp connections.

ParameterRequiredTypeDescription
access_tokenYESstringYour access token
GET https://watsler.com/api/create_instance?access_token={{token}}
{
    "status": "success",
    "message": "Instance ID generated successfully",
    "instance_id": "665A54F2CBXB6"
}

  1. Generate qr code

Description: Generates a QR code to log in to WhatsApp Web.

ParameterRequiredTypeDescription
access_tokenYESstringYour access token
instance_idYESstringThe 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....."
}

  1. Webhook Instance

Description: Sets the webhook URL to receive WhatsApp events.

ParameterRequiredTypeDescription
access_tokenYESstringYour access token
instance_idYESstringThe ID of the instance
webhook_urlYESstringThe URL to receive webhook events.
enableYESbooleanBoolean 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"
}

  1. Reinitialize instance

Description: Logs out from WhatsApp Web and performs a fresh scan to reinitialize the instance.

ParameterRequiredTypeDescription
access_tokenYESstringYour access token
instance_idYESstringThe ID of the instance

Example:

GET https://watsler.com/api/reinitialize?instance_id={{instance_id}}&access_token={{token}}
{
    "status": "success",
    "message": "Success"
}

  1. Destroy instance

Description: Logs out from WhatsApp Web, changes the Instance ID, and deletes all old instance data.

ParameterRequiredTypeDescription
access_tokenYESstringYour access token
instance_idYESstringThe 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"
}

  1. Reconnect instance

Description: Re-initiates the connection to WhatsApp Web when the connection is lost.

ParameterRequiredTypeDescription
access_tokenYESstringYour access token
instance_idYESstringThe 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

ParameterRequiredTypeDescription
access_tokenYESstringYour access token
instance_idYESstringThe ID of the instance
numberYESstringThe recipient's phone number or chat_id ([email protected] , 9665097070416)
typeYESstringThe type of message (text , media)
messageYESstringThe 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"
    }
}

  1. Send Media & File

Description: Sends a media file or document with a message to a specified phone number.

ParameterRequiredTypeDescription
access_tokenYESstringYour access token
instance_idYESstringThe ID of the instance
numberYESstringThe recipient's phone number or chat_id ([email protected] , 9665097070416)
typeYESstringmedia
messageYESstringThe message content
media_urlYESstringThe URL of the media file
filenameNOstringThe filename for documents

  1. Send Text Message to Group

Description: Sends a text message to a specified WhatsApp group.

ParameterRequiredTypeDescription
access_tokenYESstringYour access token
instance_idYESstringThe ID of the instance
numberYESstringThe recipient's phone number or chat_id ([email protected] , 9665097070416)
typeYESstringtext
messageYESstringThe message content

  1. Send Media & File Message to Group

Description: Sends a media file or document with a message to a specified WhatsApp group.

ParameterRequiredTypeDescription
access_tokenYESstringYour access token
instance_idYESstringThe ID of the instance
numberYESstringThe recipient's phone number or chat_id ([email protected] , 9665097070416)
typeYESstringmedia
messageYESstringThe message content
media_urlYESstringThe URL of the media file
filenameNOstringThe filename for documents