Month Notes
The Month Notes API provides access to monthly notes within the Sumaya369 platform. This API enables users to view and download monthly notes, as well as retrieve the currently active note.
List Month Notes
Retrieve a list of all displayed month notes, grouped by year.
Endpoint
- Method: GET
- URL:
/v1/mobile/month-notes
Request Headers
| Header | Value | Required |
|---|---|---|
| Content-Type | application/json | Yes |
| Accept | application/json | Yes |
Success Response
{
"success": true,
"message": "تم جلب البيانات بنجاح.",
"data": {
"2024": [
{
"id": "8290fac0-0797-11ef-8bb0-6b1e469387bb",
"name": "تطوير الجسد المشاعري",
"date": "2024-05-01",
"custom_date": "2024 May",
"note_file": "https://sumaya369-testing-media.s3.us-east-2.amazonaws.com/22678/%D9%85%D9%81%D9%83%D8%B1%D8%A9-%D8%AA%D8%B7%D9%88%D9%8A%D8%B1-%D8%A7%D9%84%D8%AC%D8%B3%D8%AF-%D8%A7%D9%84%D9%85%D8%B4%D8%A7%D8%B9%D8%B1%D9%8A.pdf",
"displayed": true,
"selected": true,
"created_at": "2024-05-01 11:47:58"
},
{
"id": "762b3320-f2c3-11ee-a07e-3358d74636f7",
"name": "الحظ",
"date": "2024-04-02",
"custom_date": "2024 Apr",
"note_file": "https://sumaya369-testing-media.s3.us-east-2.amazonaws.com/22256/%D9%85%D9%81%D9%83%D8%B1%D8%A9-%D8%A7%D9%84%D8%AD%D8%B8-.pdf",
"displayed": true,
"selected": false,
"created_at": "2024-04-04 23:39:41"
},
{
"id": "d4647360-daca-11ee-b46f-fb67c7547b86",
"name": "مفكرة الروحانية",
"date": "2024-03-03",
"custom_date": "2024 Mar",
"note_file": "https://sumaya369-testing-media.s3.us-east-2.amazonaws.com/21699/%D9%85%D9%81%D9%83%D8%B1%D8%A9-%D8%A7%D9%84%D8%B1%D9%88%D8%AD%D8%A7%D9%86%D9%8A%D8%A9-.pdf",
"displayed": true,
"selected": false,
"created_at": "2024-03-05 11:31:57"
},
]
},
"status_code": 200
}
Get First Active Note
Retrieve the currently selected (active) month note.
Endpoint
- Method: GET
- URL:
/v1/mobile/month-notes/note
Request Headers
| Header | Value | Required |
|---|---|---|
| Accept | application/json | Yes |
Success Response
{
"success": true,
"message": "تم جلب البيانات بنجاح.",
"data": {
"id": "8290fac0-0797-11ef-8bb0-6b1e469387bb",
"name": "تطوير الجسد المشاعري",
"date": "2024-05-01",
"custom_date": "2024 May",
"note_file": "https://sumaya369-testing-media.s3.us-east-2.amazonaws.com/22678/%D9%85%D9%81%D9%83%D8%B1%D8%A9-%D8%AA%D8%B7%D9%88%D9%8A%D8%B1-%D8%A7%D9%84%D8%AC%D8%B3%D8%AF-%D8%A7%D9%84%D9%85%D8%B4%D8%A7%D8%B9%D8%B1%D9%8A.pdf",
"displayed": true,
"selected": true,
"created_at": "2024-05-01 11:47:58"
},
"status_code": 200
}
Error Response
Note Not Found (404)
{
"success": false,
"message": "لم يتم العثور على السجل",
"data": [],
"status_code": 404
}
Download Month Note
Download a specific month note PDF file.
Endpoint
- Method: GET
- URL:
/v1/mobile/month-notes/download/{id}
Request Headers
| Header | Value | Required |
|---|---|---|
| Accept | application/json | Yes |
Response
The endpoint returns a streamed PDF file with the following headers:
Content-Type: application/pdf
Content-Disposition: attachment; filename="month-event-media-note{date}.pdf"
Error Response
Note Not Found (404)
{
"success": false,
"message": "لم يتم العثور على السجل",
"data": [],
"status_code": 404
}
Implementation Flow
-
List Month Notes
- Application sends request to
/v1/mobile/month-notes - Notes are retrieved and grouped by year
- Only displayed notes are included in the response
- Application sends request to
-
First Active Note
- Application sends request to
/v1/mobile/month-notes/first-active - Returns the currently selected note
- Returns null if no note is selected
- Application sends request to
-
Note Download
- User requests to download a specific note
- Application sends request to
/v1/mobile/month-notes/{id}/download - Note view is recorded using CustomVisitor
- PDF file is streamed to the user
Key Considerations
- Notes can be marked as displayed/hidden
- Only one note can be marked as selected at a time
- View tracking is implemented for note downloads
- PDF downloads are streamed to optimize memory usage