Comments
This guide explains how to interact with the Comments API in the Sumaya369 web application. The API provides endpoints for customer comments, including features for listing comments, creating new comments, and removing comments.
List Comments
Retrieve all comments for the authenticated customer.
Endpoint
- Method: GET
- URL:
/v1/customer/comments
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 |
| sort | string | Sort direction ('asc' or 'desc') | No |
| orderBy | string | Field to sort by | No |
| search_text | string | Search comments by content | No |
Success Response
{
"success": true,
"message": "تم جلب البيانات بنجاح.",
"data": {
"current_page": 1,
"first_page_url": "http://testing-api.sumaya369.net/v1/customer/comments?page=1",
"from": 1,
"last_page": 656,
"last_page_url": "http://testing-api.sumaya369.net/v1/customer/comments?page=656",
"links": [
{
"url": null,
"label": "« السابق",
"active": false
},
{
"url": "http://testing-api.sumaya369.net/v1/customer/comments?page=1",
"label": "1",
"active": true
},
{
"url": "http://testing-api.sumaya369.net/v1/customer/comments?page=2",
"label": "2",
"active": false
},
{
"url": "http://testing-api.sumaya369.net/v1/customer/comments?page=3",
"label": "3",
"active": false
},
{
"url": "http://testing-api.sumaya369.net/v1/customer/comments?page=4",
"label": "4",
"active": false
},
{
"url": "http://testing-api.sumaya369.net/v1/customer/comments?page=5",
"label": "5",
"active": false
},
{
"url": "http://testing-api.sumaya369.net/v1/customer/comments?page=6",
"label": "6",
"active": false
},
{
"url": "http://testing-api.sumaya369.net/v1/customer/comments?page=2",
"label": "التالي »",
"active": false
}
],
"next_page_url": "http://testing-api.sumaya369.net/v1/customer/comments?page=2",
"path": "http://testing-api.sumaya369.net/v1/customer/comments",
"per_page": 10,
"prev_page_url": null,
"to": 10,
"total": 6556,
"comments": [
{
"id": "6e6fdad0-c370-11ef-8e15-79f205f11034",
"comment": "القرارات السهلة لأنني لا أعيرها انتباها فإنه من الممكن أن لا اكون حاسمة فيها أو ان أدع شخص ما يختار لي و هذا عن طيب خاطر و برغبتي أما القرارات المصيرية فأقرر بنفسي بعد صلاة الاستخارةالقرارات السهلة لأنني لا أعير",
"writerable_avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"name": "omer khaled",
"created_at": "2024-12-26",
"reply": null
},
{
"id": "98d5bee0-c36a-11ef-8bad-9173e543bbd2",
"comment": "كتاب جميل",
"writerable_avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"name": "هبه}",
"created_at": "2024-12-26",
"reply": null
},
{
"id": "d9501c10-c125-11ef-86f8-65dd7afa6b2d",
"comment": "fffffffffffffff",
"writerable_avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"name": "Ahmed Raed 3",
"created_at": "2024-12-23",
"reply": null
},
{
"id": "ceaec330-c125-11ef-a27f-d5ba36cb085e",
"comment": "ssssssssssss",
"writerable_avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"name": "Ahmed Raed 3",
"created_at": "2024-12-23",
"reply": null
},
{
"id": "1e7ac8d0-c121-11ef-8e49-691b32414c1b",
"comment": "يبلبيل",
"writerable_avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"name": "Ahmed Raed 3",
"created_at": "2024-12-23",
"reply": null
},
{
"id": "508f74b0-c105-11ef-8b8e-4bed3aae33b1",
"comment": "vbnvbnv",
"writerable_avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"name": "Ahmed Raed 3",
"created_at": "2024-12-23",
"reply": null
},
{
"id": "2b4df550-bf73-11ef-82d9-dbe164aaea35",
"comment": "اهلا بكوم",
"writerable_avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"name": "مازن كامل",
"created_at": "2024-12-21",
"reply": null
},
{
"id": "fca9c350-b853-11ef-a0f7-3975d986c241",
"comment": "تست",
"writerable_avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"name": "علاء محمد",
"created_at": "2024-12-12",
"reply": null
},
{
"id": "d7214450-abcb-11ef-8480-3d350817bc41",
"comment": "لعبتي المفضله",
"writerable_avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"name": "omer khaled",
"created_at": "2024-11-26",
"reply": null
},
{
"id": "e7260c40-abc7-11ef-81ff-134a20014541",
"comment": "اللعب اكثر منتفس ممتع",
"writerable_avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"name": "مايا إبراهيم",
"created_at": "2024-11-26",
"reply": {
"id": "2daae510-abc8-11ef-97b8-c593842f1fde",
"name": "شحادة التلهوني",
"comment": "نعم انه كذلك 😍",
"role": "super_admin",
"avatar": "https://i.ibb.co/g4BR50S/avatar.png",
"created_at": "2024-11-26"
}
}
]
},
"status_code": 200
}
Create Comment
Create a new comment.
Endpoint
- Method: POST
- URL:
/v1/customer/comments
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 |
|---|---|---|---|
| comment | string | The comment text | Yes |
| commentable_type | string | Type of item being commented on | Yes |
| commentable_id | string | ID of the item being commented on | Yes |
Success Response
{
"success": true,
"message": "تم حفظ البيانات بنجاح.",
"data": {
"id": "bd467f00-f3f7-11ef-ae95-43f9ff180d50",
"comment": "can we do it !!",
"email": "developer@sumaya369.net",
"name": "Hamad Alshabanah",
"commentable_id": "f0485b00-b67a-11ec-903a-6f7ee614148f",
"status": null,
"commentable_type": "App\\Models\\Course",
"writerable_id": "9f2ecd22-5c07-48ec-9415-2979deec4493",
"writerable_type": "App\\Models\\Customer",
"subject": "التعلق",
"created_at": "2025-02-26 07:11:22",
"updated_at": "2025-02-26 07:11:22",
"reply": null
},
"status_code": 200
}
Show Comment
Retrieve a specific comment by ID.
Endpoint
- Method: GET
- URL:
/v1/customer/comments/{id}
Request Headers
| Header | Value | Required |
|---|---|---|
| Content-Type | application/json | Yes |
| Accept | application/json | Yes |
| Authorization | Bearer token | Yes |
Success Response
{
"success": true,
"message": "تم جلب البيانات بنجاح.",
"data": {
"id": "1e7ac8d0-c121-11ef-8e49-691b32414c1b",
"comment": "يبلبيل",
"email": "ahmedra2@gmail.com",
"name": "Ahmed Raed 3",
"commentable_id": "09d53ec0-b305-11ef-98a6-735d2de688a2",
"status": "approved",
"commentable_type": "App\\Models\\Bundle",
"writerable_id": "c6797c90-8c6c-11ef-b1d4-ab495a16f97c",
"writerable_type": "App\\Models\\Customer",
"subject": "الباقه الباقه",
"created_at": "2024-12-23 14:29:06",
"updated_at": "2024-12-23 14:29:56",
"reply": null
},
"status_code": 200
}
Delete Comment
Delete one or more comments.
Endpoint
- Method: DELETE
- URL:
/v1/customer/comments
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 comment IDs to delete | Yes |
Success Response
{
"success": true,
"message": "تم حذف البيانات بنجاح.",
"data": null,
"status_code": 200
}
Commentable
Retrieve comments for a specific item (course, article, etc.).
Endpoint
- Method: GET
- URL:
/v1/customer/commentable
Request Headers
| Header | Value | Required |
|---|---|---|
| Content-Type | application/json | Yes |
| Accept | application/json | Yes |
| Authorization | Bearer token | Yes |
Query Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| commentable_id | string | ID of the item being commented on | Yes |
| per_page | integer | Number of items per page | No |
| sort | string | Sort direction ('asc' or 'desc') | No |
| orderBy | string | Field to sort by | No |
| search_text | string | Search comments by content | No |
Success Response
{
"success": true,
"message": "تم جلب البيانات بنجاح.",
"data": {
"current_page": 1,
"first_page_url": "http://testing-api.sumaya369.net/v1/customer/commentable?commentable_type=courses&commentable_id=f0485b00-b67a-11ec-903a-6f7ee614148f&page=1",
"from": 1,
"last_page": 5,
"last_page_url": "http://testing-api.sumaya369.net/v1/customer/commentable?commentable_type=courses&commentable_id=f0485b00-b67a-11ec-903a-6f7ee614148f&page=5",
"links": [
{
"url": null,
"label": "« السابق",
"active": false
},
{
"url": "http://testing-api.sumaya369.net/v1/customer/commentable?commentable_type=courses&commentable_id=f0485b00-b67a-11ec-903a-6f7ee614148f&page=1",
"label": "1",
"active": true
},
{
"url": "http://testing-api.sumaya369.net/v1/customer/commentable?commentable_type=courses&commentable_id=f0485b00-b67a-11ec-903a-6f7ee614148f&page=2",
"label": "2",
"active": false
},
{
"url": "http://testing-api.sumaya369.net/v1/customer/commentable?commentable_type=courses&commentable_id=f0485b00-b67a-11ec-903a-6f7ee614148f&page=3",
"label": "3",
"active": false
},
{
"url": "http://testing-api.sumaya369.net/v1/customer/commentable?commentable_type=courses&commentable_id=f0485b00-b67a-11ec-903a-6f7ee614148f&page=4",
"label": "4",
"active": false
},
{
"url": "http://testing-api.sumaya369.net/v1/customer/commentable?commentable_type=courses&commentable_id=f0485b00-b67a-11ec-903a-6f7ee614148f&page=5",
"label": "5",
"active": false
},
{
"url": "http://testing-api.sumaya369.net/v1/customer/commentable?commentable_type=courses&commentable_id=f0485b00-b67a-11ec-903a-6f7ee614148f&page=2",
"label": "التالي »",
"active": false
}
],
"next_page_url": "http://testing-api.sumaya369.net/v1/customer/commentable?commentable_type=courses&commentable_id=f0485b00-b67a-11ec-903a-6f7ee614148f&page=2",
"path": "http://testing-api.sumaya369.net/v1/customer/commentable",
"per_page": 10,
"prev_page_url": null,
"to": 10,
"total": 49,
"comments": [
{
"id": "9ebdc750-f3b3-11ee-b8ab-fd00801a0995",
"comment": "في هذه المادة ذكر اذا كنت متعلق بشي فهذا وخايف من شي راح تجذب اللي انت خايف منه واللي انت متعلق فيه سيبتعد بسبب الطاقة اللي بتوصلها وبنفس الوقت في ذكر اذا شخص متعلق فيك ويرسل هذا الشعور فأنت لن تستطيع تعيش بسلام... فأعتقد ان المعلومات متناقضه",
"writerable_avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"name": "لميس الكحلاني",
"created_at": "2024-04-06",
"reply": null
},
{
"id": "b6305f10-db8e-11ee-8631-1dfc39e36136",
"comment": "شعرت اني اقوى من قبل ، شكرًا لك د. سمية وبارك الله بجهودك 💕",
"writerable_avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"name": "Shuroq Alsubaie",
"created_at": "2024-03-06",
"reply": null
},
{
"id": "b762cda0-9d0b-11ee-935d-53840661beab",
"comment": "من بعد اكثر من ٩ شهور تعلق وطبقت تمارين كثيره للتحرير مع مدربين آخرين لكن مع هذه الدوره من ثالث يوم تقريبا بدأ التعلق يروح والله اعظم شعور بحياتي هم وانزاح وبعدها حسيت بخفه وحريه وصارتلي سفره عجيبه استمتعت فيها لاني كنت منظفه التعلق ❤️ احبك سميه وكل الشكر والتقدير لك يا عظيمة ❤️",
"writerable_avatar": "https://sumaya369-testing-media.s3.us-east-2.amazonaws.com/8189/126CBC38-90BD-4100-95F1-DFEE2D6D1EBF.jpeg",
"name": "shahad alshammari",
"created_at": "2023-12-17",
"reply": null
},
{
"id": "c58284d0-9c57-11ee-98a9-473142161b0f",
"comment": "ماشاءالله كورس روعة",
"writerable_avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"name": "نهاد خدروش",
"created_at": "2023-12-17",
"reply": null
},
{
"id": "f3dfe710-800d-11ee-806e-3ffe5d9eaf03",
"comment": "شكرًا وامتنانًا من أعماق الظلمات لهذا العون العظيم\r\n\r\nأكتب هنا بعد مرور أكثر من 6 أشهر على إتمام دورة أبنوس ونظام الصدمة ومرور أسبوعين على إتمام تطبيقات التعلق، ومازالت أحلامي وأجسادي الفكرية والمشاعربة تستحضر ما أود التحرر من تعلقي به. كلي رجاء أن ينقضي من عمري يومٌ لناظري قريب ، أضحك فيه على صبيانيتي بهذا التعلق وأعي فيه أني تحررت منه ولا أتذكر آخر مرة خطر لي فيها علي بال!\r\n\r\nشكرًا جزيلًا معلمتي \r\nقلبي ودعواتي لكِ",
"writerable_avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"name": "Razan Mostafa",
"created_at": "2023-11-11",
"reply": null
},
{
"id": "e747f980-6ea8-11ee-a92c-8710d9b18c09",
"comment": "فكيت تعلقي بشخص احبه من ٦ سنين وبعدها بشهر جا وخطبني الأمور كانت ماشيه لين فجاه امه رفضت وتكنسل كل شي الحمدلله اني فكيت تعلقي فيه صح لسى فيه مشاعر حزن بس اهون ممكن لو مافكيت جاني انهيار او صدمه وبعد استوعبت ان من ٦ سنين والموضوع واضح ان مالنا نصيب مع بعض بس النظاره الورديه وافعالها🥲",
"writerable_avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"name": "رهف محمد",
"created_at": "2023-10-19",
"reply": null
},
{
"id": "2b936d80-5204-11ee-bd06-b7541dd12d33",
"comment": "دخلت الكورس بهدف فك التعلق عن أهدافي، لأجل اتحرر من النتائج التي ارجوها وأسعى بخفة أكثر اتجاه ما اريد. لم أعرف كيف أوجه واصيغ التمارين لناحية \"الاهداف\" لأنها مكتوبة بصيغة تستهدف الشخوص، فاخترت أشخاص في حياتي كانت لي علاقة وطيدة، ظننت اني فكيت التعلق بهم من زمان لكن مع التمارين اكتشفت في مشاعر تحركت وتحررت. تفاجأت من فعالية التمارين رغم بساطتها. سعيدة بفعالية الكورس وقررت استمر اخذ كورسات أكثر واعمق مع د. سمية (هذا أول كورس أخذه معها).",
"writerable_avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"name": "ورد علي",
"created_at": "2023-09-13",
"reply": null
},
{
"id": "761d53c0-5178-11ee-b436-09803d7786d1",
"comment": "دخلنا في الشهر الجديد ) العظمه ) .. لكن طلع لي ٤٤٤ ثلاث مرات اليوم .. مأعرف هل هي متعلقه بالعظمه ولا بالدعوه ان ربي يعوضني بعد ماقطعت علاقتي في العلاقه السامه .",
"writerable_avatar": "https://sumaya369-testing-media.s3.us-east-2.amazonaws.com/19502/128514.jpeg",
"name": "Arwa Alghriri",
"created_at": "2023-09-12",
"reply": null
},
{
"id": "e4520ea0-45a2-11ee-9545-8d13571911f3",
"comment": "ممتنة لكِ د. سميه بصراحه الكورس رهيب يعلمك جوانب التعلق ويحرر منه شكراً لكِ د.سميه🙏💖",
"writerable_avatar": "https://i.ibb.co/g4BR50S/avatar.png",
"name": "مشاعل احمد",
"created_at": "2023-08-28",
"reply": null
},
{
"id": "35d3a840-40e8-11ee-bbc5-1916d853d7fd",
"comment": "تخلصت من التعلق بنسبة 99.89٪ لم أكن لاحلم بهذا اليوم اصلا دخلت وانا اقول انا ما ابغى هذا الشخص بس هو المتعلق... لكن اكتشفت أجزاء مني متعلقة فيه",
"writerable_avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"name": "Rawan Salem",
"created_at": "2023-08-22",
"reply": null
}
]
},
"status_code": 200
}
Example Implementation Flow
- Comments Management
- Application retrieves users' comments using the list endpoint
- User can create new comments on various items
- User can view specific comments
- User can delete their comments
- Commentable
- Application retrieves comments for a specific item using its id and type
Key Considerations
- Authentication is required for all endpoints
- Comments are associated with specific items (courses, articles, etc.)
- Pagination is available for the list endpoint
- Bulk deletion is supported through the delete endpoint
- Comments may require approval based on system settings