The Whatsable Notifier API allows users to send messages via a POST request. This documentation covers the specifics of making a request to the API, including the required headers, payload structure, and understanding the API response.
POST https://api.insightssystem.com/api:-GWQv5aM/send
To use the API, an authorization token is required. This token must be included in the request headers.
Content-Type: application/json
- Indicates the media type of the resource.
Authorization: Bearer YOUR_TOKEN_HERE
- Authentication token for the API.
The body of the request should be a JSON object with the following fields:
Example:
{ "phone": "phone_number", "text": "text", "attachment": "attachment as public url", "filename": "" }
The response from the API will be in JSON format. It typically includes a message and details field.
Example Success Response:
{ "message": "Message sent successfully" }
Example Error Response:
{ "message": "Message sending failed", "details": "Message limit for this phone number reached." }
In case of an error, the API responds with a message indicating the failure and details providing more context. Common errors include reaching the message limit for a given phone number or issues with authentication.
Note: Replace YOUR_TOKEN_HERE with your actual API token and phone_number with the recipient's phone number in international format. For attachment, provide a valid public URL to the file you wish to send, and optionally, you can specify a filename for the attachment.
Use the following cURL command to send a request to the API:
curl -X POST https://api.insightssystem.com/api:-GWQv5aM/send\ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_TOKEN_HERE" \ -d '{ "phone": "phone_number", "text": "Your message text", "attachment": "attachment_public_url", "filename": "filename" }'