/sites/self/notifications GET

Return any active site-wide notifications for the current site - protected.

Parameters

none

Response Messages

200 OK - success

The result is an array of notifications, possibly empty if no site-wide notifications are currently active. Each notification is a structure containing a text field with the message that should be displayed on each page (while the member is logged in) and a datecreated field, purely for information, that says when the notification was created (this may be months ago so it isn’t useful to display this to members). Each notification may contain a route field (which may be null), indicating that the message should only be displayed if the client application is in that “state” (usually assumed to be the prefix of the URI in the browser address bar). Each notification also contains a format field that is either "banner" or "modal" that the client can use as they wish to control the UI, a flag, dismissible, that is a Boolean (true or false) indicating whether the notification should be dismissible or “permanent”, and an optional bgcolor and textcolor fields (which may be null). The two color fields may specify a hex color code if it starts with # or else a symbolic name (such as "promo") which the UI may interpret in its own way, consistently:

{
  "notifications" : [
    { "text" : "Some notification",
      "datecreated" : "June 23, 2016 16:26:00 -0800",
      "id" : 1234,                 // added in 2.32.0
      "route" : "/app/chat",
      "format" : "banner",
      "dismissible" : false,       // cannot be dismissed; true => can be dismissed
      "bgcolor" : "PaleTurquoise", // hex literal or symbolic name
      "textcolor" : "#800080" },   // hex literal or symbolic name
    ...
  ]
}