Comments
This guide explains how to interact with the Comments API in the Sumaya369 mobile 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/mobile/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://127.0.0.1:8000/v1/mobile/comments?page=1",
"from": 1,
"last_page": 672,
"last_page_url": "http://127.0.0.1:8000/v1/mobile/comments?page=672",
"links": [
{
"url": null,
"label": "« السابق",
"active": false
},
{
"url": "http://127.0.0.1:8000/v1/mobile/comments?page=1",
"label": "1",
"active": true
},
{
"url": "http://127.0.0.1:8000/v1/mobile/comments?page=2",
"label": "2",
"active": false
},
{
"url": "http://127.0.0.1:8000/v1/mobile/comments?page=3",
"label": "3",
"active": false
},
{
"url": "http://127.0.0.1:8000/v1/mobile/comments?page=4",
"label": "4",
"active": false
},
{
"url": "http://127.0.0.1:8000/v1/mobile/comments?page=5",
"label": "5",
"active": false
},
{
"url": "http://127.0.0.1:8000/v1/mobile/comments?page=6",
"label": "6",
"active": false
},
{
"url": "http://127.0.0.1:8000/v1/mobile/comments?page=7",
"label": "7",
"active": false
},
{
"url": "http://127.0.0.1:8000/v1/mobile/comments?page=8",
"label": "8",
"active": false
},
{
"url": "http://127.0.0.1:8000/v1/mobile/comments?page=9",
"label": "9",
"active": false
},
{
"url": "http://127.0.0.1:8000/v1/mobile/comments?page=10",
"label": "10",
"active": false
},
{
"url": null,
"label": "...",
"active": false
},
{
"url": "http://127.0.0.1:8000/v1/mobile/comments?page=671",
"label": "671",
"active": false
},
{
"url": "http://127.0.0.1:8000/v1/mobile/comments?page=672",
"label": "672",
"active": false
},
{
"url": "http://127.0.0.1:8000/v1/mobile/comments?page=2",
"label": "التالي »",
"active": false
}
],
"next_page_url": "http://127.0.0.1:8000/v1/mobile/comments?page=2",
"path": "http://127.0.0.1:8000/v1/mobile/comments",
"per_page": 10,
"prev_page_url": null,
"to": 10,
"total": 6720,
"comments": [
{
"id": "958b7830-ffd2-11ef-ad7e-ed4cccc88fdb",
"comment": "can we do it !!",
"writerable_avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"name": "Hamad Alshabanah",
"created_at": "2025-03-13",
"reply": null
},
{
"id": "8e6555e0-ffd2-11ef-a8f5-6d2a96fd45f5",
"comment": "can we do it !!",
"writerable_avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"name": "Hamad Alshabanah",
"created_at": "2025-03-13",
"reply": null
},
{
"id": "d3358e40-d253-11ef-b84b-ad99e3b7c95d",
"comment": "لو سمحتي ممكن اعرف كيف فيني اخد بس الغضب من الباقة",
"writerable_avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"name": "Asmaa Kassabbachi",
"created_at": "2025-01-14",
"reply": null
},
{
"id": "dc3a2e70-d15d-11ef-88ce-f32b8e4d2628",
"comment": "أبدا اليوم بجزء من المتعه وبنهاية اليوم أيضا",
"writerable_avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"name": "سلوى صاحى صديق رضوان",
"created_at": "2025-01-13",
"reply": null
},
{
"id": "53f99c10-d15d-11ef-8e9d-5186f1cd2a7a",
"comment": "فعلا لا أحب الألعاب أبدا",
"writerable_avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"name": "سلوى صاحى صديق رضوان",
"created_at": "2025-01-13",
"reply": null
},
{
"id": "28bd7ca0-d093-11ef-b76f-13e4f2633225",
"comment": "هل ينفع اشترك في الباقه وأنا مو حاطة نية الثراء حاطه نية تحسين الوضع المالي لان لسه ماامتلك مصدر دخل؟",
"writerable_avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"name": "Afnan Aloufi",
"created_at": "2025-01-12",
"reply": null
},
{
"id": "f2c0c870-d07d-11ef-aab5-43d275ac5b77",
"comment": "السلام عليكم \r\nاني ساكنه في السويد .. شلون احصل الكتب؟ \r\nما عندي سفر لدول عربيه حاليا 😔",
"writerable_avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"name": "Ebtihal Hassan",
"created_at": "2025-01-12",
"reply": null
},
{
"id": "442a6d60-cf8b-11ef-b3cf-6da71380e146",
"comment": "أرغب في شراء باقة أفضل الاحتمالات.لكن عند الأداء لا يفصل عن باقي الباقات.!!",
"writerable_avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"name": "فاطمة الزماحي",
"created_at": "2025-01-10",
"reply": null
},
{
"id": "75d4a800-ccf0-11ef-a7e6-99d048d427a7",
"comment": "المتعه قبل الهدف تشعرني بعدم جدية الموضوع وبالخوف\r\nاثناء الهدف ضروريه جدا جدا لي للاكمال\r\nبعد الهدف احب استمتع لكن اشعر معها بالخوف \r\n..",
"writerable_avatar": "http://127.0.0.1:8000/storage/21755/5C75C20C-15DC-4A1D-ADD8-7B87172AAF82.jpeg",
"name": "مريم فلاح خليل",
"created_at": "2025-01-07",
"reply": null
},
{
"id": "d6d38c60-ccef-11ef-8d6c-b3b0b3b39da4",
"comment": "حالياً لعبة cooking dash\r\nتعطيني شعور جميل بأكمال المهام \r\nشعور تنظيف الطاولات وترتيب المكان وتجهيز الطلبيات ممتع بالنسبه لي في اللعبة",
"writerable_avatar": "http://127.0.0.1:8000/storage/21755/5C75C20C-15DC-4A1D-ADD8-7B87172AAF82.jpeg",
"name": "مريم فلاح خليل",
"created_at": "2025-01-07",
"reply": null
}
]
},
"status_code": 200
}
Create Comment
Create a new comment.
Endpoint
- Method: POST
- URL:
/v1/mobile/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": "958b7830-ffd2-11ef-ad7e-ed4cccc88fdb",
"comment": "can we do it !!",
"writerable_avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"name": "Hamad Alshabanah",
"created_at": "2025-03-13"
},
"status_code": 200
}
Commentable
Retrieve comments for a specific item (course, article, etc.).
Endpoint
- Method: GET
- URL:
/v1/mobile/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://127.0.0.1:8000/v1/mobile/commentable?commentable_type=articles&commentable_id=f083c6c0-3c08-11ee-a0f5-3325cca2539b&page=1",
"from": 1,
"last_page": 5,
"last_page_url": "http://127.0.0.1:8000/v1/mobile/commentable?commentable_type=articles&commentable_id=f083c6c0-3c08-11ee-a0f5-3325cca2539b&page=5",
"links": [
{
"url": null,
"label": "« السابق",
"active": false
},
{
"url": "http://127.0.0.1:8000/v1/mobile/commentable?commentable_type=articles&commentable_id=f083c6c0-3c08-11ee-a0f5-3325cca2539b&page=1",
"label": "1",
"active": true
},
{
"url": "http://127.0.0.1:8000/v1/mobile/commentable?commentable_type=articles&commentable_id=f083c6c0-3c08-11ee-a0f5-3325cca2539b&page=2",
"label": "2",
"active": false
},
{
"url": "http://127.0.0.1:8000/v1/mobile/commentable?commentable_type=articles&commentable_id=f083c6c0-3c08-11ee-a0f5-3325cca2539b&page=3",
"label": "3",
"active": false
},
{
"url": "http://127.0.0.1:8000/v1/mobile/commentable?commentable_type=articles&commentable_id=f083c6c0-3c08-11ee-a0f5-3325cca2539b&page=4",
"label": "4",
"active": false
},
{
"url": "http://127.0.0.1:8000/v1/mobile/commentable?commentable_type=articles&commentable_id=f083c6c0-3c08-11ee-a0f5-3325cca2539b&page=5",
"label": "5",
"active": false
},
{
"url": "http://127.0.0.1:8000/v1/mobile/commentable?commentable_type=articles&commentable_id=f083c6c0-3c08-11ee-a0f5-3325cca2539b&page=2",
"label": "التالي »",
"active": false
}
],
"next_page_url": "http://127.0.0.1:8000/v1/mobile/commentable?commentable_type=articles&commentable_id=f083c6c0-3c08-11ee-a0f5-3325cca2539b&page=2",
"path": "http://127.0.0.1:8000/v1/mobile/commentable",
"per_page": 10,
"prev_page_url": null,
"to": 10,
"total": 42,
"comments": [
{
"id": "e4111a20-c749-11ef-ae13-b98e16c91672",
"comment": "نعم مستمتع ، استمتع بتحدى الصعوبات لتي اواجهها مع بناتي من فئة التوحد . كانت البداية الم وحيره وشعور بالضياع الى أن وصلت الى قرار تغير ذلك واستمتع بالرحلة مع فتياتي .",
"writerable_avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"name": "عفاف السليماني",
"created_at": "2024-12-31"
},
{
"id": "af2953a0-bcf2-11ef-ada9-2f0afc481d47",
"comment": "انا قمة متعتي فهم النفس البشريه وفهم نفسي وتطويرها كل يوم في فديواتك ودوراتك وفديوات اخرين ايضا وعالم كانت عندي تساؤلات كثيرة عنه وجائتني كل الاجابات بمختلف أنواعها على الجسد المادي والمشاعري والطاقي ….الخ فاندهشت وتعلمت والان صار شغفي هنا ومتعتي زيادة المعرفه وبدأت انصح اولادي اولا واهلي واصدقائي واخذ بيد المستعد \r\nمستمتعه مستمتعه ولا متعه اكثر من المعرفه راحة وطمأنينه وسلام وحب عميق \r\nشكرا لك دكتورة تطوري ونهاية معاناتي شكرا من اعماق قلبي يا غاليتي ❤️❤️❤️",
"writerable_avatar": "http://127.0.0.1:8000/images/emails/default_avatar.png",
"name": "shroq",
"created_at": "2024-12-18"
},
{
"id": "8e278040-b9a8-11ef-a3c5-2bf96513b62d",
"comment": "اعتقد اني مستمتعه بدور الضحية و المسكينه مستمتعه بقصة اني انا الذكية المثقفه اللي كل من حولها جهلة لا يفقهون شيء وهي تعيش دايم دور الضحية و تشير لهم بالبنان على كل صغيرة وكبيرة تحدث و تلومهم ولا تتحمل المسؤولية اعتقد اني مستمتعه بهذا الظلم اللي ظلمته نفسي وانا اليوم مستعده ان اتخلى عن هذا و استعد لعام قام خالي من دور الضحية و المتع المزيفه",
"writerable_avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"name": "رؤيا صالح",
"created_at": "2024-12-14"
},
{
"id": "78961c50-b6bd-11ef-9c03-13c51b0888bf",
"comment": "مضحك ولكن هذه الحقيقة أنا مستمتعه بتهويل قصة الحزن والموقف الذي تعرضت له..اريد ان اخرج من هذة القصة ولكن ايضا اريد ان اخرج منها بصعوبة ومعركة حتى اشعر بشعور الانتصار",
"writerable_avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"name": "حصه احمد",
"created_at": "2024-12-10"
},
{
"id": "0824c880-adb3-11ef-a268-4b7afc01115f",
"comment": "مستمعة جداً بحياتي و تطوري كل سنة اطلع بنسخة افضل من اللي قبلها مستمتعة و مشغولة بنفسي و وعي برغم الضروف الصعبة جداً و العثرات بحياتي اللي مريت فيها برغم الالم اللي عشته و لكن انا قوية انا انسانة جداً قوية احب الحياة احب اضحك و انبسط احب الناس البسطاء احب الحب نفسه عندي طاقة هائلة من الحب و السعادة الحمد لله",
"writerable_avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"name": "همس الروح",
"created_at": "2024-11-28"
},
{
"id": "fbaa4ac0-92f8-11ef-8608-ef9c8b90bef3",
"comment": "استمتع بالجلوس بمفردي واتابعك او أتعلم مهارة جديدة أو أنمي مهارة عندي بالفعل أو أكل حلو او اطبخ اكله جديدة",
"writerable_avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"name": "اسم العميل",
"created_at": "2024-10-25"
},
{
"id": "87076c50-92bc-11ef-9170-b9524664631d",
"comment": "استمتع بالقراءة هي الوحيدة التي تساعدني على تجاوز الصدمات و الاحزان و في كثير من الأحيان احس باني تجاوزت كل العقبات و ياتي حدث صغير انهار مع ذلك احاول احاول",
"writerable_avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"name": "نزهة رفيع",
"created_at": "2024-10-25"
},
{
"id": "80cf7d80-9142-11ef-8bf9-b7fffcb92691",
"comment": "مستمتعة بالموسيقى تشعرني بالبهجة ومستمتعة بالحرية واني تجاوزت كثير من عقبات المجتمع وصرت اعبر واعيش حياتي بطريقتي اللهم لك الحمد واطمح لمتعة المال والثراء والتجارب الجديدة والاستكشاف وتجربة مشاعر أعلى وأجمل",
"writerable_avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"name": "فوزية المرحبي",
"created_at": "2024-10-23"
},
{
"id": "55af5fe0-8ff2-11ef-99bb-2beda658bb6c",
"comment": "نحن نستمتع بما تعودنا عليه",
"writerable_avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"name": "نوف المسيفري",
"created_at": "2024-10-22"
},
{
"id": "ea7d7180-8ba0-11ef-b3ea-092820aefa80",
"comment": "نعم انا مستمتعة \r\nأنا أستمتع بكل لحظة من لحظات حياتى بكل نفس اتنفسه بكل الوجود الحياة فى هذه الارض أستمتع بالاكسجين النقى البارد ومنعش أستمتع برؤية السماء الله على نعم الله لاتعد ولا تحسى الحمد الله على نعمة المتعة بما سخر لنا",
"writerable_avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"name": "مريم حمدان",
"created_at": "2024-10-16"
}
]
},
"status_code": 200
}
Example Implementation Flow
- Comments Management
- Application retrieves users' comments using the list endpoint
- User can create new comments on various items
- 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