Notifications API Documentation
The Notifications API enables you to manage and retrieve notifications on WaSMS.Net. Below are the key API endpoints for notification management.
1. Notifications - Delete Notification
This endpoint allows you to delete a specific notification from your account. It requires the delete_notification
API permission.
GET: https://sys.wasms.net/api/delete/notification
Parameters:
Field | Type | Description |
secret |
String | The API secret you copied from the Tools -> API Keys page. |
id |
Number | The notification ID to be deleted. |
Success Response Format:
Field | Type | Description |
status |
Number | Status code (200 = Success) |
message |
String | Response message |
data |
Array | Details of the deleted notification |
Example Success Response:
{
"status": 200,
"message": "Notification has been deleted!",
"data": false
}
Error Response Format:
Field | Type | Description |
status |
Number | Status code: 400, 401, 403, 500 |
message |
String | Error message |
data |
Array | Any additional data (usually empty) |
Example PHP Request:
$apiSecret = "API_SECRET"; // your API secret from (Tools -> API Keys) page
$notificationId = 1;
$cURL = curl_init();
curl_setopt($cURL, CURLOPT_URL, "https://sys.wasms.net/api/delete/notification?secret={$apiSecret}&id={$notificationId}");
curl_setopt($cURL, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($cURL);
curl_close($cURL);
$result = json_decode($response, true);
print_r($result);
2. Notifications - Get Notifications
This endpoint allows you to retrieve notifications from your account. It requires the get_notifications
API permission.
GET: https://sys.wasms.net/api/get/notifications
Parameters:
Field | Type | Description |
secret |
String | The API secret you copied from the Tools -> API Keys page. |
limit |
Number | (Optional) Limit the number of results per page. Default: 10. |
page |
Number | (Optional) Page number for pagination. Default: 1. |
Success Response Format:
Field | Type | Description |
status |
Number | Status code (200 = Success) |
message |
String | Response message |
data |
Array | List of notifications |
Example Success Response:
{
"status": 200,
"message": "Received Notifications",
"data": [
{
"id": 1,
"device": "00000000-0000-0000-d57d-f30cb6a89289",
"package_name": "com.facebook.orca",
"title": "Darren Shmuck",
"content": "Hello World!",
"timestamp": 1645052535
},
{
"id": 2,
"device": "00000000-0000-0000-d57d-f30cb6a89289",
"package_name": "com.facebook.katana",
"title": "Michael shared your post",
"content": "Michael shared your post",
"timestamp": 1645052541
}
]
}
Error Response Format:
Field | Type | Description |
status |
Number | Status code: 400, 401, 403, 500 |
message |
String | Error message |
data |
Array | Any additional data (usually empty) |
Example PHP Request:
$apiSecret = "API_SECRET"; // your API secret from (Tools -> API Keys) pag
$cURL = curl_init();
curl_setopt($cURL, CURLOPT_URL, "https://sys.wasms.net/api/get/notifications?secret={$apiSecret}");
curl_setopt($cURL, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($cURL);
curl_close($cURL);
$result = json_decode($response, true);
print_r($result);
Conclusion
The Notifications API on WaSMS.Net enables you to manage and retrieve notifications effectively, providing robust functionality for integrating notifications into your applications. For more information, visit the Tools -> API Keys page in your WaSMS.Net account or contact our support team.