Retrieves a paginated list of posts in a class (announcements, events, discussions).
GET
/classes/{classId}/posts
curl \
--request GET 'http://localhost:8080/api/classes/{classId}/posts' \
--header "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
"success": true,
"code": 200,
"message": "string",
"data": [
{
"id": "550e8400-e29b-41d4-a716-446655440008",
"classId": "550e8400-e29b-41d4-a716-446655440000",
"authorId": "550e8400-e29b-41d4-a716-446655440001",
"author": {
"id": "string",
"firstName": "string",
"lastName": "string",
"avatarUrl": "string"
},
"content": "Check out this lesson on quadratic equations",
"type": "announcement",
"attachments": [
"https://example.com/file.pdf"
],
"linkedResources": [
"550e8400-e29b-41d4-a716-446655440005"
],
"linkedLesson": {
"id": "string",
"title": "string",
"resources": [
{
"id": "550e8400-e29b-41d4-a716-446655440006",
"lessonId": "550e8400-e29b-41d4-a716-446655440005",
"name": "Quadratic Formula Worksheet",
"type": "document",
"url": "https://example.com/worksheet.pdf",
"filePath": "/uploads/worksheet.pdf",
"description": "Practice worksheet for quadratic equations",
"isRequired": true,
"isPrepared": false,
"createdAt": "2024-01-15T10:30:00Z"
}
]
},
"isPinned": false,
"allowComments": true,
"createdAt": "2024-09-20T10:30:00Z",
"updatedAt": "2024-09-20T14:45:00Z"
}
],
"pagination": {
"currentPage": 1,
"pageSize": 10,
"totalItems": 100,
"totalPages": 10
}
}
Response examples (401)
{
"success": false,
"code": 42,
"errorCode": "string",
"message": "string",
"timestamp": "2026-05-04T09:42:00Z"
}
Response examples (404)
{
"success": false,
"code": 42,
"errorCode": "string",
"message": "string",
"timestamp": "2026-05-04T09:42:00Z"
}
Response examples (500)
{
"success": false,
"code": 42,
"errorCode": "string",
"message": "string",
"timestamp": "2026-05-04T09:42:00Z"
}