Skip to main content

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

HeaderValueRequired
Content-Typeapplication/jsonYes
Acceptapplication/jsonYes
AuthorizationBearer tokenYes

Query Parameters

ParameterTypeDescriptionRequiredDefault
per_pageintegerNumber of items per pageNo10
is_readbooleanFilter by read statusNonull

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

HeaderValueRequired
Content-Typeapplication/jsonYes
Acceptapplication/jsonYes
AuthorizationBearer tokenYes

Path Parameters

ParameterTypeDescriptionRequired
idsstringRead selected notificationYes
read_allstringRead all notificationYes

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

HeaderValueRequired
Content-Typeapplication/jsonYes
Acceptapplication/jsonYes
AuthorizationBearer tokenYes

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

HeaderValueRequired
Content-Typeapplication/jsonYes
Acceptapplication/jsonYes
AuthorizationBearer tokenYes

Path Parameters

ParameterTypeDescriptionRequired
idstringNotification IDYes

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
}