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:
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); });
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:
- Announcement fields describing the new document
Options:
Name | Type | Required | Description |
---|---|---|---|
fields | String | false | Names of the fields to be returned |
Retrieves:
get(options)
GET /announcements
Retrieves
Announcement[]
Description
Return a paginated list of system announcements that are currently viewable.
Options:
Name | Type | Required | Description |
---|---|---|---|
activeOnly | Boolean | false | Flag indicating whether only active system announcements should be returned. |
startIndex | Integer | false | Zero-relative index of the first content object to be returned |
count | Integer | false | Maximum number of objects to return (default is 25) |
fields | String | false | Names of the fields to be returned |
Retrieves:
get(options)
GET /announcements/{uri}
Retrieves
Announcement
Description
Return a single announcement by its URI.
Options:
Name | Type | Required | Description |
---|---|---|---|
uri | String | true | URI of the announcement to get |
fields | String | false | Names of the fields to be returned |