Endpoint
GET /api/get_replies/<post_id>
Get all replies associated with a post, sorted by creation date (newest first).
Path parameters
ID of the post to fetch replies for
Response
Array of reply objects
Username of the reply author
Reply content text (max 512 characters)
ISO timestamp of when the reply was created
URL to the reply author’s avatar (defaults to ‘default.png’ if not set)
Error message if the post was not found
Status codes
- 200: Replies retrieved successfully (may be empty array)
- 404: Post not found
Example request
curl https://api.example.com/api/get_replies/123
Example responses
{
"replies": [
{
"id": 456,
"username": "bob",
"content": "Welcome to Mirage!",
"created_at": "2024-03-15T11:00:00",
"avatar_url": "https://example.com/bob.png"
},
{
"id": 457,
"username": "charlie",
"content": "Great to have you here!",
"created_at": "2024-03-15T10:45:00",
"avatar_url": "default.png"
}
]
}
Notes
- No authentication required - replies are publicly viewable
- Replies are sorted by creation date in descending order (newest first)
- Empty array is returned if the post has no replies
- Reply authors’ avatars are included in the response
- Replies count toward the author’s total post count in their profile stats