Skip to content

Commit 710a2cd

Browse files
committed
doc update
1 parent 26560f5 commit 710a2cd

File tree

1 file changed

+82
-0
lines changed

1 file changed

+82
-0
lines changed

API_DOCS.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
- [ICS Files](#ics-files)
1717
- [Get All Available ICS Files](#get-all-available-ics-files)
1818
- [Get ICS File](#get-ics-file)
19+
- [Memes](#memes)
20+
- [Get Memes (Paginated)](#get-memes-paginated)
1921

2022
---
2123

@@ -583,6 +585,58 @@ File does not exist
583585

584586
---
585587

588+
## Memes
589+
590+
### Get Memes (Paginated)
591+
592+
**Endpoint:** `GET /api/v1/memes/{page}`
593+
594+
**Description:** Retrieves a paginated list of memes.
595+
596+
**Authentication:** Required (via AuthMiddleware)
597+
598+
**Path Parameters:**
599+
- `page` (integer, required): The page number to retrieve.
600+
601+
**Request:**
602+
```http
603+
GET /api/v1/memes/1
604+
```
605+
606+
**Response:**
607+
608+
Success (200 OK):
609+
```json
610+
{
611+
"totalPages": 10,
612+
"hasNext": true,
613+
"hasPrev": false,
614+
"memeList": [
615+
{
616+
"id": "meme-id-123",
617+
"imageUrl": "https://example.com/meme.jpg",
618+
"altText": "A funny meme",
619+
"imageB64": "base64_encoded_image_string",
620+
"title": "My Awesome Meme",
621+
"permalink": "https://example.com/meme-id-123",
622+
"likes": "100",
623+
"timeStamp": "2024-01-01T12:00:00Z",
624+
"user": "MemeLord",
625+
"tags": ["funny", "dev"],
626+
"comments": ["First comment", "lol"]
627+
}
628+
]
629+
}
630+
```
631+
632+
Error (400 Bad Request):
633+
```
634+
Internal Server Error
635+
```
636+
(Note: The error message is generic, but it's returned for invalid page parameters)
637+
638+
---
639+
586640
## Data Models
587641

588642
### Post Object
@@ -628,6 +682,33 @@ File does not exist
628682
}
629683
```
630684

685+
### Meme Object
686+
```json
687+
{
688+
"id": "string",
689+
"imageUrl": "string",
690+
"altText": "string",
691+
"imageB64": "string (Base64)",
692+
"title": "string",
693+
"permalink": "string",
694+
"likes": "string",
695+
"timeStamp": "string",
696+
"user": "string",
697+
"tags": ["string"],
698+
"comments": ["string"]
699+
}
700+
```
701+
702+
### MemeResponse Object
703+
```json
704+
{
705+
"totalPages": "integer",
706+
"hasNext": "boolean",
707+
"hasPrev": "boolean",
708+
"memeList": [Meme]
709+
}
710+
```
711+
631712
---
632713

633714
## Validation Rules
@@ -711,5 +792,6 @@ For validation errors:
711792
| GET | `/api/v1/users/{creatorId}/posts` | Get posts by creator |
712793
| PATCH | `/api/v1/users/{creatorId}/{postId}` | Update post |
713794
| DELETE | `/api/v1/users/{creatorId}/{postId}` | Delete post |
795+
| GET | `/api/v1/memes/{page}` | Get memes (paginated) |
714796
| GET | `/api/v1/ics` | Get all available ICS file names |
715797
| GET | `/api/v1/ics/{fileName}` | Download specific ICS file |

0 commit comments

Comments
 (0)