new Notification()
Properties:
Name | Type | Description |
---|---|---|
id |
string | unique notification id |
link |
string | link to redirect to when clicked |
read |
boolean | bool representing if the notification has been marked read or not |
text |
string | notification text |
timestamp |
integer | unix timestamp |
timestampText |
string | timestamp in text form |
type |
number | type of notification. The exact type definitions aren't known and more research has to be done. But right now the following is known: 2 - attendance updated (eg. you get marked tardy), 3 - course grade updated (eg. your class grade changes after an assignment is graded), 4 - assignment updated (eg. an assignment is graded or its state is updated as missing, late, etc ) |
Methods
-
toggleRead()
-
Toggles the read state of a notification
Example
const InfiniteCampus = require('infinite-campus') const user = new InfiniteCampus('New York District', 'NY', 'JDoe12', 'XXXXXX') // wait until we are done logging in user.on('ready', () => { // user is authenticated, now we can get notifications user.getNotifications().then((notifications) => { // if the first notification is unread if (notification[0].read === false){ // mark it as read by toggling its read state notifications[0].toggleRead() } } })