Connection
Generating the qrCode
The starting point for communication with the API is generating the qrCode. Once the qrCode is generated, you can scan it using your mobile device to enable message exchange between the API and your system.
| Command | generate_qrcode.aspx |
| Method | POST |
| Body |
|
| Response | SUCCESS → returns qrCode image in SVG base64 format: ERROR → returns the described error: |
Once the device scans the qrCode, a series of events will be returned via the PostBack URL:
Connection Status
| Command | status.aspx | ||||||||||||||||||
| Method | GET | ||||||||||||||||||
| Response | Connection information: Status codes and their string equivalents:
|
Disconnect
Completely disconnects from WhatsApp (qrCode must be generated again).
| Command | disconnect.aspx |
| Method | GET |
| Response | SUCCESS → connection information: |
End Session
Partially disconnects from WhatsApp (possible to reconnect using the restore_session.aspx command).
| Command | close_session.aspx |
| Method | GET |
| Response | SUCCESS → connection information: |
Save Session
Saves the current connection state and allows reconnection. This is executed automatically after reading the qrCode.
| Command | save_session.aspx |
| Method | GET |
| Response | SUCCESS: |
Restore Session
Restores a previously ended session (using the close_session.aspx command).
| Command | restore_session.aspx |
| Method | GET |
| Response | SUCCESS → connection information: |
Clear Instance
Completely clears saved instance data. Resets stored files and cache. (Does not affect WhatsApp data)
| Command | clear.aspx |
| Method | GET |
| Response | |
Update Settings
Updates connection settings.
If you change the WebHook using the set_config.aspx command, using the system via browser will stop working.
If you want to use both methods (browser and API), consider changing the WebHook via the system administration interface (Access the admin area > Edit Instance > API > PostBack URL).
| Command | set_config.aspx |
| Method | POST |
| Body | |
| Response | SUCCESS → Returns connection data: |