Appearance
API Reference
Welcome to the WhatsGate API reference. This section provides detailed information about all available API endpoints, request parameters, and response formats.
Base URL
All API endpoints are relative to your WhatsGate instance URL:
https://{subdomain}.whatsgate.net/api
Authentication
All API requests require authentication using an API token. You need to include your token in the request headers:
Access-Token: your_api_token_here
Learn more about creating and managing API tokens.
API Endpoints
The WhatsGate API is organized around the following resource categories:
Messages
- Send Text Message
- Send Image Message
- Send Video Message
- Send Audio Message
- Send File/Document Message
- Send Location Message
Devices
Reports
Response Format
All API responses are returned in JSON format. Successful responses typically include a success
field set to true
and a message
field with additional information:
json
{
"success": true,
"message": "Message sent successfully"
}
Error responses include a success
field set to false
and a message
field with an error description:
json
{
"success": false,
"message": "Invalid phone number format"
}
Error Handling
The API uses standard HTTP status codes to indicate the success or failure of requests:
200 OK
: The request was successful400 Bad Request
: The request was invalid or cannot be served401 Unauthorized
: Authentication failed or user doesn't have permissions403 Forbidden
: The request is forbidden404 Not Found
: The requested resource could not be found422 Unprocessable Entity
: The request was well-formed but could not be processed500 Internal Server Error
: An error occurred on the server
Rate Limiting
The API implements rate limiting to prevent abuse. If you exceed the rate limit, you'll receive a 429 Too Many Requests
response.