curl --request GET \
--url 'https://api.example.com/api/get_posts/<username>'{
"posts": [
{
"id": 123,
"username": "<string>",
"content": "<string>",
"created_at": "<string>",
"upvotes": 123,
"downvotes": 123
}
]
}Retrieve all posts from a specific user
curl --request GET \
--url 'https://api.example.com/api/get_posts/<username>'{
"posts": [
{
"id": 123,
"username": "<string>",
"content": "<string>",
"created_at": "<string>",
"upvotes": 123,
"downvotes": 123
}
]
}GET /api/get_posts/<username>
200 OK
{
"posts": [
{
"id": 123,
"username": "johndoe",
"content": "This is a post",
"created_at": "2026-03-03 12:34:56",
"upvotes": 42,
"downvotes": 3
},
{
"id": 122,
"username": "johndoe",
"content": "Another post",
"created_at": "2026-03-02 10:20:30",
"upvotes": 15,
"downvotes": 1
}
]
}
{
"posts": []
}
curl -X GET https://api.example.com/api/get_posts/johndoe
{
"posts": [
{
"id": 123,
"username": "johndoe",
"content": "This is a post",
"created_at": "2026-03-03 12:34:56",
"upvotes": 42,
"downvotes": 3
}
]
}