Announcement
Announcement Service
Web service endpoints for announcements.
Example:
Create Announcement
Python example of creating a new system announcement:
import urllib2, json, base64 uri = "/api/core/v3/announcements" base_url = "http://jive.mycompany.com" url = base_url + uri user = "admin" password = "admins_password" auth = "Basic " + base64.encodestring('%s:%s' % (user, password)).replace("\n",""); headers = { "Content-Type": "application/json", "Authorization": auth } data = json.dumps( { "subject": "An important announcement created using Python!", "content": { "type": "text/html", "text": "Meeting now in room 123!" } }) req = urllib2.Request(url, data, headers ) try: json = urllib2.urlopen(req).read() except urllib2.HTTPError, e: print e.code print e.read() print json
Create Announcement
POST /announcements
Create a new announcement with the specified characteristics.
Query Parameters:
Name | Type | Required | Description |
---|---|---|---|
minor | Boolean | false | Flag indicating whether this update is a minor edit (true) or not (false) |
fields | String | false | Fields to include in the returned Announcement |
Takes:
Retrieves:
Return Status:
HTTP Status Code | Description |
---|---|
201 (Created) | Request was successful |
400 (Bad Request) | An input field is missing or malformed |
409 (Conflict) | You attempt to add an announcement to a non-place object, or to a place that does not support them |
403 (Forbidden) | You are not allowed to create announcements in the specified place |
404 (Not Found) | The specified parent place cannot be found |
Destroy Announcement
DELETE /announcements/{announcementID}
Delete the specified announcement.
Path Parameters:
Name | Type | Required | Description |
---|---|---|---|
announcementID | String | true | ID of the announcement to be deleted |
Return Status:
HTTP Status Code | Description |
---|---|
204 (No Content) | Request was successful |
400 (Bad Request) | An input field is missing or malformed |
403 (Forbidden) | You are not allowed to delete the specified announcement |
404 (Not Found) | The specified announcement cannot be found |
Get Announcement
GET /announcements/{announcementID}
Retrieve and return the specified announcement.
Path Parameters:
Name | Type | Required | Description |
---|---|---|---|
announcementID | String | true | ID of the announcement to be returned |
Query Parameters:
Name | Type | Required | Description |
---|---|---|---|
fields | String | false | Fields to be returned |
Retrieves:
Return Status:
HTTP Status Code | Description |
---|---|
200 (OK) | Request was successful |
400 (Bad Request) | If an input field is missing or malformed |
403 (Forbidden) | If you are not allowed to access the specified announcement |
404 (Not Found) | If the specified announcement cannot be found |
Get System Announcements
GET /announcements
Return a paginated list of system announcements that are currently viewable.
Query Parameters:
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 requested announcement |
count | Integer | false | Maximum number of announcements to be returned |
fields | String | false | Fields to include in the returned announcements |
Retrieves:
Return Status:
HTTP Status Code | Description |
---|---|
200 (OK) | Request was successful |
400 (Bad Request) | An input field is missing or malformed |
403 (Forbidden) | You are not allowed to access the requested announcements |
Mark Read
POST /announcements/{announcementID}/read
Mark the specified announcement as having been read.
Path Parameters:
Name | Type | Required | Description |
---|---|---|---|
announcementID | String | true | ID of the announcement to be marked |
Return Status:
HTTP Status Code | Description |
---|---|
204 (No Content) | Request was successful |
400 (Bad Request) | An input field was malformed |
403 (Forbidden) | You are not allowed to access this announcement |
404 (Not Found) | The specified announcement does not exist |
Mark Unread
DELETE /announcements/{announcementID}/read
Mark the specified announcement as having not been read.
Path Parameters:
Name | Type | Required | Description |
---|---|---|---|
announcementID | String | true | ID of the announcement to be marked |
Return Status:
HTTP Status Code | Description |
---|---|
204 (No Content) | Request was successful |
400 (Bad Request) | An input field was malformed |
403 (Forbidden) | You are not allowed to access this announcement |
404 (Not Found) | The specified announcement does not exist |
Update Announcement
PUT /announcements/{announcementID}
Update the specified announcement with the specified characteristics.
Path Parameters:
Name | Type | Required | Description |
---|---|---|---|
announcementID | String | true | ID of the announcement to be updated |
Query Parameters:
Name | Type | Required | Description |
---|---|---|---|
minor | Boolean | false | Flag indicating whether this update is a minor edit (true) or not (false) |
fields | String | false | Fields to include in the returned entity |
Takes:
Retrieves:
Return Status:
HTTP Status Code | Description |
---|---|
200 (OK) | Request was successful |
400 (Bad Request) | An input field is missing or malformed |
403 (Forbidden) | You are not allowed to access the specified announcement |
404 (Not Found) | The specified announcement cannot be found |