Share
Share Service
Web service endpoints for shares.
Examples:
Create a share of the specified Jive content object or place with the specified list of people. Minimum JSON to create a new share:
{ "content" : { "type" : "text/html", "text" : "Hey, you should join in on this discussion!" }, "participants" : [ "http://jive.somecompany.com/api/core/v3/people/2345" ], "shared" : "http://jive.somecompany.com/api/core/v3/contents/12345" }
Create a share
Python example of sharing content with another user:
import urllib2, json, base64 uri = "/api/core/v3/shares" base_url = "http://jive.mycompany.com" url = base_url + uri user = "Gregory.Employee" password = "password" auth = "Basic " + base64.encodestring('%s:%s' % (user, password)).replace("\n",""); headers = { "Content-Type": "application/json", "Authorization": auth } data = json.dumps({ "shared": "http://jive.mycompany.com/api/core/v3/contents/11858", "content": { "type": "text/html", "text": "Sharing this doc with you!" }, "participants": ["http://jive.mycompany.com/api/core/v3/people/1234"] }) 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 Comment
POST /shares/{shareID}/comments
Create a new comment as a reply to the specified share. The parent
field (if any)
in the incoming entity will be ignored. Instead, it will be set to the URI of the specified share.
Path Parameters:
Name | Type | Required | Description |
---|---|---|---|
shareID | String | true | ID of the share this comment replies to |
Query Parameters:
Name | Type | Required | Description |
---|---|---|---|
fields | String | false | Fields to include in the returned Comment |
Takes:
Retrieves:
Return Status:
HTTP Status Code | Description |
---|---|
201 (Created) | Request was successful |
400 (Bad Request) | If an input field is missing or malformed |
409 (Conflict) | if you attempt to add a comment to a share for which comments have been closed |
403 (Forbidden) | if you are not allowed to perform this operation |
404 (Not Found) | if the specified parent share (or comment) cannot be found |
POST /shares
Query Parameters:
Name | Type | Required | Description |
---|---|---|---|
fields | String | false | Fields to be included in the response |
Takes:
Retrieves:
Return Status:
HTTP Status Code | Description |
---|---|
201 (Created) | Request was successful |
400 (Bad Request) | An input field is missing or malformed |
403 (Forbidden) | You are not allowed to access one of the specified participants, or the specified object |
404 (Not Found) | One of the specified participants, or the specified shared object, does not exist |
DELETE /shares/{shareID}
Delete the specified share.
Path Parameters:
Name | Type | Required | Description |
---|---|---|---|
shareID | String | true | ID of the share 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 share |
404 (Not Found) | The specified share is not found |
Get Comments
GET /shares/{shareID}/comments
Return a paginated list of comments to the specified share, optionally limiting the returned results to direct replies only.
Path Parameters:
Name | Type | Required | Description |
---|---|---|---|
shareID | String | true | ID of the share for which to return comments |
Query Parameters:
Name | Type | Required | Description |
---|---|---|---|
excludeReplies | Boolean | false | Flag indicating whether to exclude replies (and therefore return direct comments only) |
hierarchical | Boolean | false | Flag indicating that comments should be returned in hierarchical order instead of chronological order |
startIndex | Integer | false | Zero-relative index of the first comment to be returned |
count | Integer | false | Maximum number of comments to be returned |
anchor | String | false | optional URI for a comment to anchor at. Specifying a anchor will try to return the page containing the anchor. If the anchor could not be found then the first page of comments will be returned. |
fields | String | false | Fields to be returned in the selected comments |
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 share or comments |
404 (Not Found) | The specified share does not exist |
GET /shares/{shareID}
Retrieve and return the specified share.
Path Parameters:
Name | Type | Required | Description |
---|---|---|---|
shareID | String | true | ID of the share to be retrieved |
Query Parameters:
Name | Type | Required | Description |
---|---|---|---|
fields | String | false | Fields to be included in the returned |
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 share |
404 (Not Found) | The specified share is not found |
Mark Read
POST /shares/{shareID}/read
Mark the specified share as having been read.
Path Parameters:
Name | Type | Required | Description |
---|---|---|---|
shareID | String | true | ID of the share 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 share |
404 (Not Found) | The specified share does not exist |
Mark Unread
DELETE /shares/{shareID}/read
Mark the specified share as having not been read.
Path Parameters:
Name | Type | Required | Description |
---|---|---|---|
shareID | String | true | ID of the share 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 share |
404 (Not Found) | The specified share does not exist |