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:
NameTypeRequiredDescription
shareIDStringtrueID of the share this comment replies to
Query Parameters:
NameTypeRequiredDescription
fieldsStringfalseFields to include in the returned Comment
Takes:
  • Comment describing the comment to be created
  • Retrieves:
  • Comment representing the new comment
  • Return Status:
    HTTP Status CodeDescription
    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

    Create Share

    POST /shares
    Query Parameters:
    NameTypeRequiredDescription
    fieldsStringfalseFields to be included in the response
    Takes:
  • JSON entity containing the participant and shared object URIs
  • Retrieves:
  • Share representing the newly created share
  • Return Status:
    HTTP Status CodeDescription
    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

    Destroy Share

    DELETE /shares/{shareID}

    Delete the specified share.

    Path Parameters:
    NameTypeRequiredDescription
    shareIDStringtrueID of the share to be deleted
    Return Status:
    HTTP Status CodeDescription
    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:
    NameTypeRequiredDescription
    shareIDStringtrueID of the share for which to return comments
    Query Parameters:
    NameTypeRequiredDescription
    excludeRepliesBooleanfalseFlag indicating whether to exclude replies (and therefore return direct comments only)
    hierarchicalBooleanfalseFlag indicating that comments should be returned in hierarchical order instead of chronological order
    startIndexIntegerfalseZero-relative index of the first comment to be returned
    countIntegerfalseMaximum number of comments to be returned
    anchorStringfalseoptional 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.
    fieldsStringfalseFields to be returned in the selected comments
    Retrieves:
  • Comment[]
  • Return Status:
    HTTP Status CodeDescription
    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 Share

    GET /shares/{shareID}

    Retrieve and return the specified share.

    Path Parameters:
    NameTypeRequiredDescription
    shareIDStringtrueID of the share to be retrieved
    Query Parameters:
    NameTypeRequiredDescription
    fieldsStringfalseFields to be included in the returned
    Retrieves:
  • Share describing the specified share
  • Return Status:
    HTTP Status CodeDescription
    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:
    NameTypeRequiredDescription
    shareIDStringtrueID of the share to be marked
    Return Status:
    HTTP Status CodeDescription
    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:
    NameTypeRequiredDescription
    shareIDStringtrueID of the share to be marked
    Return Status:
    HTTP Status CodeDescription
    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