Announcements

Announcements are a way to send system-level messages to users. Announcements are global (they are not part of a single conversation). In fact, an Announcement is a special type of Message. However, it is different in the following ways:

  • Announcements can only be received, not sent via the REST API or WebSockets. Use the Server API to send announcements
  • The object will not have a conversation property
  • The id will be of the format layer:///announcements/UUID
  • The object does not show the recipient status for other recipients; recipient_status will only show the current user and their receipt status
{
  "id": "layer:///announcements/940de862-3c96-11e4-baad-164230d1df67",
  "url": "https://api.layer.com/announcements/940de862-3c96-11e4-baad-164230d1df67",
  "receipts_url": "https://api.layer.com/announcements/940de862-3c96-11e4-baad-164230d1df67/receipts",
  "position": 15032697020,
  "conversation": null,
  "parts": [
    {
      "id": "layer:///announcements/940de862-3c96-11e4-baad-164230d1df67/parts/0",
      "mime_type": "text/plain",
      "body": "This is the announcement."
    }
  ],
  "sent_at": "2014-09-09T04:44:47+00:00",
  "sender": {
    "id": null,
    "url": null,
    "user_id": null,
    "display_name": "Admin"
  },
  "is_unread": true,
  "recipient_status": {
    "999": "read"
  }
}