Announcements
Overview
School-wide announcements that reach parents and teachers via push notifications and in-app banners.
Create Announcement
POST /school-admin/announcement/create
{
"data": {
"title": "Mid-Term Exam Schedule Released",
"body": "The mid-term exam schedule has been published. Please check the exam section for details.",
"priority": "NORMAL", // NORMAL | URGENT
"targetAudience": "PARENTS_AND_TEACHERS", // ALL | STUDENTS | PARENTS | TEACHERS | PARENTS_AND_TEACHERS
"attachments": [
{ "type": "FILE", "fileKey": "s3://bucket/announcements/schedule.pdf" }
],
"publishAt": "2024-04-01T10:00:00Z" // optional scheduled publish
}
}
Priority
| Priority | Behavior |
|---|---|
NORMAL | Shows in app notification center |
URGENT | Triggers SMS + push notification immediately |
Delivery
For urgent announcements, the API triggers:
// SNS → SMS for all target phone numbers
await Promise.all(parentPhones.map(phone =>
snsClient.publish({
PhoneNumber: phone,
Message: `[URGENT - ${schoolName}]\n${announcement.title}\n${announcement.body}`,
})
));
// SNS → FCM push notification
await Promise.all(deviceTokens.map(token =>
snsClient.publish({
TargetArn: token,
Message: JSON.stringify({
default: announcement.title,
GCM: JSON.stringify({
notification: { title: announcement.title, body: announcement.body },
data: { type: 'ANNOUNCEMENT', id: announcementId }
})
}),
MessageStructure: 'json',
})
));
Announcement List
GET /school-admin/announcement/list
GET /parent/announcement/list
GET /teacher/announcement/list
Teacher Announcements
Teachers can also create announcements (module-level permission required):
POST /teacher/announcement/create
Typically scoped to their class or division only.