Notifications
This section covers the endpoints for managing user notifications.
Available Endpoints
List Notifications
Get a list of notifications for the authenticated user.
Endpoint
- Method: GET
- URL:
/v1/admin/notifications
Request Headers
| Header | Value | Required |
|---|---|---|
| Content-Type | application/json | Yes |
| Accept | application/json | Yes |
| Authorization | Bearer token | Yes |
Query Parameters
| Parameter | Type | Description | Required | Default |
|---|---|---|---|---|
| per_page | integer | Number of items per page | No | 10 |
| is_read | boolean | Filter by read status | No | null |
Success Response
{
"success": true,
"message": "تم جلب البيانات بنجاح",
"data": {
"numberOfNotifications": 4,
"notifications": {
"currentPage": 1,
"data": [
{
"id": "uuid",
"fullname": "خالد لنا العناسوة",
"icon": null,
"status": "unread",
"createdAt": "قبل 6 أشهر",
"message": "تغيرت حالة الدفع الى غير مطالب بها بعد ورقم سجل الدفع uuid",
"title": "تم تحديث حالة الدفع"
},
]
],
"current_page": 1,
"from": 1,
"last_page": 1,
"per_page": 10,
"to": 1,
"total": 1
},
"statusCode": 200
}
Mark Notification as Read
Mark a specific notification as read.
Endpoint
- Method: POST
- URL:
/v1/coach/notifications
Request Headers
| Header | Value | Required |
|---|---|---|
| Content-Type | application/json | Yes |
| Accept | application/json | Yes |
| Authorization | Bearer token | Yes |
Path Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| ids | string | Read selected notification | Yes |
| read_all | string | Read all notification | Yes |
Success Response
{
"success": true,
"message": "تم تحديث البيانات بنجاح.",
"data": [],
"statusCode": 200
}
Mark Notifications as Read
Mark notifications as read for the authenticated user.
Endpoint
- Method: POST
- URL:
/v1/coach/notifications/read-all
Request Headers
| Header | Value | Required |
|---|---|---|
| Content-Type | application/json | Yes |
| Accept | application/json | Yes |
| Authorization | Bearer token | Yes |
Success Response
{
"success": true,
"message": "تم تحديث حالة جميع الإشعارات بنجاح",
"data": null,
"statusCode": 200
}
Delete Notification
Delete a specific notification.
Endpoint
- Method: DELETE
- URL:
/v1/admin/notifications/{id}
Request Headers
| Header | Value | Required |
|---|---|---|
| Content-Type | application/json | Yes |
| Accept | application/json | Yes |
| Authorization | Bearer token | Yes |
Path Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| id | string | Notification ID | Yes |
Success Response
{
"success": true,
"message": "تم حذف البيانات بنجاح.",
"data": [],
"statusCode": 200
}
Error Response
Notification Not Found (404)
{
"success": false,
"message": "لم يتم العثور على الإشعار",
"data": null,
"statusCode": 404
}
Unauthorized (401)
{
"success": false,
"message": "غير مصرح",
"data": null,
"statusCode": 401
}