Get Push Notifications
This endpoint retrieves a list of push notifications for a platform. It provides information about both sent and scheduled notifications, allowing administrators to monitor and manage their notification campaigns.
Endpoint
- URL:
/api/push-notifications - Method:
GET - Authentication: Required (Admin access)
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
page | integer | No | Page number for pagination (default: 1) |
limit | integer | No | Number of items per page (default: 10) |
sort | string | No | Field to sort by (default: "createdAt") |
order | string | No | Sort order, either "ASC" or "DESC" (default: "DESC") |
PlatformId | integer | No | Filter notifications by platform ID |
GroupId | integer | No | Filter notifications by group ID |
Response
Success Response
- Code:
200 OK - Content:
{
"count": 2,
"rows": [
{
"id": 123,
"GroupId": 456,
"PlatformId": 789,
"title": "New Feature Announcement",
"message": "We've just launched a new feature! Check it out now.",
"status": "sent",
"scheduledFor": "2023-11-15T10:00:00.000Z",
"createdAt": "2023-11-10T08:30:00.000Z",
"updatedAt": "2023-11-15T10:01:00.000Z",
"parameterData": "{}",
"destinationPage": "Home"
},
{
"id": 124,
"GroupId": 456,
"PlatformId": 789,
"title": "Upcoming Maintenance",
"message": "The platform will be down for maintenance on Saturday.",
"status": "scheduled",
"scheduledFor": "2023-11-20T08:00:00.000Z",
"createdAt": "2023-11-10T09:15:00.000Z",
"updatedAt": "2023-11-10T09:15:00.000Z",
"parameterData": "{}",
"destinationPage": "Settings"
}
]
}
Error Response
- Code:
400 Bad Request - Content:
{
"error": "Something went wrong"
}
Notes
- The response includes both sent and scheduled notifications
- The
statusfield can be one of: "draft", "scheduled", "sent", or "error" - Notifications with a
scheduledFordate in the past and a status of "scheduled" have already been sent - The
parameterDatafield contains JSON data that can be used by the mobile app for deep linking - The
destinationPagefield specifies which page in the mobile app should be opened when the notification is tapped
Example
curl -X GET "https://api.example.com/api/push-notifications?PlatformId=789&limit=10" \
-H "Authorization: Bearer YOUR_AUTH_TOKEN"