static osapi.jive.corev3.announcements

Static class for getting and creating Announcements. Functions are used in the same way as the contents static class, but the "type" field is unnecessary and there is some additional functionality such as the ability to only get active announcements.

Examples:
Create an announcement

How to create an announcement with minimal fields. You can determine the minimum required fields by reading the table of properties for an Announcement. It's not necessary to include the type since we are using the announcements static class.

//Create a minimal announcement
var announcementJSON = {
    "subject": "Free pizza in the break room!",
    "content": {
         "type": "text/html",
         "text": "Test announcement"
    }
};

osapi.jive.corev3.contents.create(announcementJSON)
    .execute(function(data) {
        console.log("Created this announcement with announcements.create()!", data);
    });
Get a list of announcements

Here is an example of getting a list of system announcements. To get announcements inside a place, use Get announcements inside a Space, for example.

 //Get 5 active announcements
 var request = osapi.jive.corev3.announcements.get({
     "count": 5,
     "activeOnly": true
 });

 request.execute(function(data) {
     console.log("Fetched 5 announcements!", data);
 });

Methods

create(announcement,options)
POST /announcements

Retrieves

Announcement

Description

Create a new announcement with specified characteristics, and return an entity representing the newly created announcement.

Here is an example of a JSON with the minimum set of fields you must include for a system announcement:

 {
  "content":
      {
      "type": "text/html",
      "text": "<body><p>Some interesting text</p></body>"
      },
  "subject": "Free beer for everyone"
 }

Here is an example of a JSON with the minimum set of fields you must include for an announcement in a place:

 {
  "content":
      {
      "type": "text/html",
      "text": "<body><p>Some interesting text</p></body>"
      },
  "parent" : "https://example.jiveon.com/api/core/v3/places/1234",
  "subject": "Free beer for everyone"
 }

Takes:
Options:
NameTypeRequiredDescription
fieldsStringfalseNames of the fields to be returned
Retrieves:
  • Announcement describing the newly created document
  • get(options)
    GET /announcements

    Retrieves

    Announcement[]

    Description

    Return a paginated list of system announcements that are currently viewable.

    Options:
    NameTypeRequiredDescription
    activeOnlyBooleanfalseFlag indicating whether only active system announcements should be returned.
    startIndexIntegerfalseZero-relative index of the first content object to be returned
    countIntegerfalseMaximum number of objects to return (default is 25)
    fieldsStringfalseNames of the fields to be returned
    Retrieves:
  • Announcement[] Paginated list of matching system announcements
  • get(options)
    GET /announcements/{uri}

    Retrieves

    Announcement

    Description

    Return a single announcement by its URI.

    Options:
    NameTypeRequiredDescription
    uriStringtrueURI of the announcement to get
    fieldsStringfalseNames of the fields to be returned
    Retrieves:
  • Announcement Representation of the requested announcement