Notifications
This guide explains how to interact with the Notifications API in the Sumaya369 mobile application. The API provides endpoints for managing customer notifications, including features for listing notifications, marking them as read, and deleting notifications.
List Notifications
Retrieve all notifications for the authenticated customer.
Endpoint
- Method: GET
- URL:
/v1/mobile/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 |
|---|---|---|---|
| per_page | integer | Number of items per page | No |
Success Response
{
"success": true,
"message": "تم جلب البيانات بنجاح.",
"data": {
"number_of_notifications": "9+",
"notifications": {
"current_page": 1,
"data": [
{
"id": "b77e542d-df92-45df-98a4-ff8b969ab48a",
"created_at": "قبل شهرين",
"message": "بقي 10 أيام على إنتهاء الإشتراك ",
"title": "قانون التوسع",
"icon": "course",
"status": "unread"
},
{
"id": "96676d34-b77d-41d5-82f4-e043f5799562",
"created_at": "قبل شهرين",
"message": "بقي 10 أيام على إنتهاء الإشتراك ",
"title": "الخوف",
"icon": "course",
"status": "unread"
},
{
"id": "8b8a746a-58ef-4c95-ae2f-c2ad77665327",
"created_at": "قبل شهرين",
"message": "تم إستلام الطلب سيصلك إيميل فور الإنتهاء من المراجعة و التأكد",
"title": 2412194962,
"icon": "bank_transfer",
"status": "unread"
},
{
"id": "463d6e8c-31a2-49ea-86c6-d59a343123b0",
"created_at": "قبل شهرين",
"message": "ثم تسجيل الدخول على حسابك بجهازين او دولتين في اقل من ساعة",
"title": "تسجيل دخول مخالف",
"icon": "suspicious_login",
"status": "unread"
},
{
"id": "af0d9351-bbca-4d9d-85fa-3ddf0b718404",
"created_at": "قبل شهرين",
"message": "ثم تسجيل الدخول على حسابك بجهازين او دولتين في اقل من ساعة",
"title": "تسجيل دخول مخالف",
"icon": "suspicious_login",
"status": "unread"
},
{
"id": "455131fb-c7f2-4b6a-bf78-3830fd6ca1c4",
"created_at": "قبل شهرين",
"message": "بقي 10 أيام على إنتهاء الإشتراك ",
"title": "اسرار الأثرياء",
"icon": "course",
"status": "unread"
},
{
"id": "fd91a1d9-72f8-4e1b-8ed5-aab5920545a5",
"created_at": "قبل شهرين",
"message": "بقي 10 أيام على إنتهاء الإشتراك ",
"title": "الهوية المالية",
"icon": "course",
"status": "unread"
},
{
"id": "310dd813-72d7-4221-b691-6f03049d55ff",
"created_at": "قبل شهرين",
"message": "بقي 10 أيام على إنتهاء الإشتراك ",
"title": "طبقات الثراء",
"icon": "course",
"status": "unread"
},
{
"id": "3143f693-07d3-4c9a-962e-49d4162a3a31",
"created_at": "قبل شهرين",
"message": "بقي 10 أيام على إنتهاء الإشتراك ",
"title": "كارما الثراء",
"icon": "course",
"status": "unread"
},
{
"id": "e2ceb5fa-db0c-46fb-a0e6-8b7c5df7b5be",
"created_at": "قبل شهرين",
"message": "بقي 10 أيام على إنتهاء الإشتراك ",
"title": "بداية القصة",
"icon": "course",
"status": "unread"
}
],
"first_page_url": "http://127.0.0.1:8000/v1/mobile/notifications?page=1",
"from": 1,
"last_page": 19,
"last_page_url": "http://127.0.0.1:8000/v1/mobile/notifications?page=19",
"links": [
{
"url": null,
"label": "« السابق",
"active": false
},
{
"url": "http://127.0.0.1:8000/v1/mobile/notifications?page=1",
"label": "1",
"active": true
},
{
"url": "http://127.0.0.1:8000/v1/mobile/notifications?page=2",
"label": "2",
"active": false
},
{
"url": "http://127.0.0.1:8000/v1/mobile/notifications?page=3",
"label": "3",
"active": false
},
{
"url": "http://127.0.0.1:8000/v1/mobile/notifications?page=4",
"label": "4",
"active": false
},
{
"url": "http://127.0.0.1:8000/v1/mobile/notifications?page=5",
"label": "5",
"active": false
},
{
"url": "http://127.0.0.1:8000/v1/mobile/notifications?page=6",
"label": "6",
"active": false
},
{
"url": "http://127.0.0.1:8000/v1/mobile/notifications?page=7",
"label": "7",
"active": false
},
{
"url": "http://127.0.0.1:8000/v1/mobile/notifications?page=8",
"label": "8",
"active": false
},
{
"url": "http://127.0.0.1:8000/v1/mobile/notifications?page=9",
"label": "9",
"active": false
},
{
"url": "http://127.0.0.1:8000/v1/mobile/notifications?page=10",
"label": "10",
"active": false
},
{
"url": null,
"label": "...",
"active": false
},
{
"url": "http://127.0.0.1:8000/v1/mobile/notifications?page=18",
"label": "18",
"active": false
},
{
"url": "http://127.0.0.1:8000/v1/mobile/notifications?page=19",
"label": "19",
"active": false
},
{
"url": "http://127.0.0.1:8000/v1/mobile/notifications?page=2",
"label": "التالي »",
"active": false
}
],
"next_page_url": "http://127.0.0.1:8000/v1/mobile/notifications?page=2",
"path": "http://127.0.0.1:8000/v1/mobile/notifications",
"per_page": 10,
"prev_page_url": null,
"to": 10,
"total": 190
}
},
"status_code": 200
}
Mark Notifications as Read
Mark specific notifications or all notifications as read for the authenticated customer.
Endpoint
- Method: POST
- URL:
/v1/mobile/notifications
Request Headers
| Header | Value | Required |
|---|---|---|
| Content-Type | application/json | Yes |
| Accept | application/json | Yes |
| Authorization | Bearer token | Yes |
Request Body Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| read_all | boolean | Mark all notifications as read | No |
| ids | array | Array of notification IDs to mark as read | No* |
*Either read_all or ids must be provided
Success Response
{
"success": true,
"message": "تم تحديث البيانات بنجاح.",
"data": null,
"status_code": 200
}
Delete Notifications
Delete specific notifications for the authenticated customer.
Endpoint
- Method: DELETE
- URL:
/v1/mobile/notifications
Request Headers
| Header | Value | Required |
|---|---|---|
| Content-Type | application/json | Yes |
| Accept | application/json | Yes |
| Authorization | Bearer token | Yes |
Request Body Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| ids | array | Array of notification IDs to delete | Yes |
Success Response
{
"success": true,
"message": "تم حذف البيانات بنجاح.",
"data": null,
"status_code": 200
}
Example Implementation Flow
- Notification Management
- Application periodically fetches notifications using the list endpoint
- Unread notifications count is displayed to the user
- User can mark notifications as read individually or all at once
- User can delete unwanted notifications
Key Considerations
- Authentication is required for all endpoints
- Notifications are personal to each customer
- Unread notification count is capped at "9+" for display purposes
- System supports both individual and bulk operations for marking as read
- Deleted notifications cannot be recovered