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/coach/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": {
"notifications": [
{
"id": "uuid",
"title": "string",
"body": "string",
"type": "string",
"is_read": false,
"created_at": "datetime",
"data": {
"key": "value"
}
}
],
"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/{id}/read
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
}
Mark All Notifications as Read
Mark all 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/coach/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
}
Overview
Notification Information
Each notification includes:
- Unique identifier
- Title
- Body content
- Type (e.g., 'session', 'order', 'system')
- Read status
- Creation timestamp
- Additional data (type-specific)
Important Notes
- Notifications are paginated
- Can be filtered by read status
- Support different types of notifications
- Include additional data based on type
- Notifications are automatically created for various events
- Read status is tracked per user
- Notifications can be deleted
- All operations require authentication