Content
Content Service
Web service endpoints for functionality that is common to all content objects.
Supported content types are:
discussion
(Discussion) - a discussion, which is the beginning of a conversation.document
(Document) - a document in Jive that can be discussed and shared with other people.file
(File) - a file in Jive that can be discussed and shared with other people.poll
(Poll) - a poll where people can vote to make a decision or express an opinion.post
(Post) - an entry in a blog.favorite
(Favorite) - a link to content around the web that can be shared and discussed.task
(Task) - a task for a person to get things done.update
(Update) - a user status update.
Plugins can add more content types to the above list.
Examples:
POST to /contents
to create a Discussion. Here is an example using curl.
curl -u mary:password -H "Content-Type: application/json" --data
'{ "type": "discussion", "content": { "type": "text/html", "text":"Starting a discussion"},
"subject": "A new discussion"}' http://example.jiveon.com/api/core/v3/contents
Updates can be created using the contents endpoint. The update will be for the user whose credentials are used. Example with curl of creating a status update.
curl -u bob:password -H "Content-Type: application/json" --data '{ "type": "update", "content":
{ "type": "text/html", "text":"Vacation coming up soon!"}, "subject": "Vacation"}'
http://example.jiveon.com/api/core/v3/contents
Having created an update, you can create a "repost", or an update that quotes your original update. Here, in the "repost" field you must provide the URI of the original update returned in the response of the previous example.
curl -u bob:password -H "Content-Type: application/json" --data '{ "type": "update", "repost":
"http://example.jiveon.com/api/core/v3/contents/1234", "content": { "type": "text/html", "text":"Still can't wait for the vacation!"},
"subject": "Vacation"}' http://example.jiveon.com/api/core/v3/contents
Jump to
- Create Comment
- Create Content
- Upload New Content
- Create Content Like
- Destroy Content
- Destroy Content Like
- Get Comments
- Get Content
- Get Content Followers
- Get Content Following In
- Get Content Likes
- Get Contents
- Get Popular Content
- Get Recent Content
- Get Recommended Content
- Get Trending Content
- Mark Read
- Mark Unread
- Create Content Following In
- Update Content
- Upload Update Content
Create Comment
POST /contents/{contentID}/comments
Create a new comment as a reply to the specified content object. The parent
field (if any)
in the incoming entity will be ignored. Instead, it will be set to the URI of the specified content object.
Path Parameters:
Name | Type | Required | Description |
---|---|---|---|
contentID | String | true | ID of the content object this comment replies to |
Query Parameters:
Name | Type | Required | Description |
---|---|---|---|
author | Boolean | false | Flag indicating if new comment is an author comment or a regular comment (only valid for documents). By default a regular comment will be created. |
fields | String | false | Fields to include in the returned Comment |
Takes:
Retrieves:
Return Status:
HTTP Status Code | Description |
---|---|
400 (Bad Request) | An input field is missing or malformed |
409 (Conflict) | You attempt to add a comment to a content object that does not support them, or for which comments have been closed |
403 (Forbidden) | You are not allowed to perform this operation |
404 (Not Found) | The specified parent content object (or comment) cannot be found |
Create Content
POST /contents
Create a new content object with specified characteristics, and return an entity representing the newly created content object.
For those types of content that support attachments, it is possible to specify URL of files that the server will download and store them as attachments of the new content. A BAD_REQUEST error will be returned if URL of files are passed and the content type does not support attachments. Here we can see an example where attachments are specified as URLs.
{ "content":{ "type":"text/html", "text":"<body><p>Some interesting text</p></body>" }, "subject":"New Document", "type":"document", "attachments":[ { "doUpload":true, "url":"http://www.mysite.com/images/cat.jpg" } ] }
Attachments can only be images when creating Update. Those images will be accessible through the images resource of an Update.
The following rules define which fields in the incoming JSON entity are processed:
- For all content object types, the following fields are processed:
author
,content
,parent
,status
,subject
,tags
,type
. - For all content object types, the
content
andsubject
fields are required. Furthermore,subject
must be unique within the parent place.
Query Parameters:
Name | Type | Required | Description |
---|---|---|---|
fields | String | false | The fields to include in the returned entity |
Takes:
Retrieves:
Return Status:
HTTP Status Code | Description |
---|---|
201 (Created) | Request was successful |
400 (Bad Request) | An input field is malformed |
409 (Conflict) | The new entity would conflict with system restrictions (such as two contents of the same type with the same name) |
403 (Forbidden) | You are not allowed to access the specified content |
Upload New Content
POST /contents
Create a new content object with specified characteristics, and return an entity representing the newly created content object. Uploaded files will be added to the new content object as attachments. Uploading attachments is only allowed for those content types that support attachments. A BAD_REQUEST error will be returned if attachments are passed and the content type does not support them.
The following rules define which fields in the incoming JSON entity are processed:
- For all content object types, the following fields are processed:
author
,content
,parent
,status
,subject
,tags
,type
. - For all content object types, the
author
,content
,parent
, andsubject
fields are required, and must be unique within the parent place.
Query Parameters:
Name | Type | Required | Description |
---|---|---|---|
fields | String | false | The fields to include in the returned entity |
Takes:
Retrieves:
Return Status:
HTTP Status Code | Description |
---|---|
201 (Created) | Request was successful |
400 (Bad Request) | An input field is malformed |
409 (Conflict) | The new entity would conflict with system restrictions (such as two contents of the same type with the same name) |
403 (Forbidden) | You are not allowed to access the specified content |
Create Content Like
POST /contents/{contentID}/likes
Register that the requesting person likes the specified content object.
Path Parameters:
Name | Type | Required | Description |
---|---|---|---|
contentID | String | true | ID of the content object to be liked |
Return Status:
HTTP Status Code | Description |
---|---|
204 (No Content) | Request was successful |
400 (Bad Request) | An input field is malformed |
403 (Forbidden) | You are not allowed to access or like this content object |
404 (Not Found) | The specified content object does not exist |
Destroy Content
DELETE /contents/{contentID}
Delete the specified content object.
Path Parameters:
Name | Type | Required | Description |
---|---|---|---|
contentID | String | true | ID of the content object to be deleted |
Return Status:
HTTP Status Code | Description |
---|---|
204 (No Content) | Request was successful |
400 (Bad Request) | An input field is malformed |
403 (Forbidden) | You are not allowed to access the specified content object |
404 (Not Found) | The specified content does not exist |
Destroy Content Like
DELETE /contents/{contentID}/likes
Delete the like of the specified content object by the requesting user.
Path Parameters:
Name | Type | Required | Description |
---|---|---|---|
contentID | String | true | The ID of the content object for which a like is being removed |
Return Status:
HTTP Status Code | Description |
---|---|
204 (No Content) | Request was successful |
400 (Bad Request) | An input field is malformed |
409 (Conflict) | You do not currently have a like registered for this content object |
403 (Forbidden) | You are not allowed to access or unlike this content object |
404 (Not Found) | The specified content object does not exist |
Get Comments
GET /contents/{contentID}/comments
Return a paginated list of comments to the specified content object, optionally limiting the returned results to direct replies only. The specified content object type must support comments, or be a comment itself (in which case replies to this comment only are returned).
Path Parameters:
Name | Type | Required | Description |
---|---|---|---|
contentID | String | true | ID of the content object 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 |
author | Boolean | false | Flag indicating if author comments should be returned or regular comments (only valid for documents). By default regular comments are returned. |
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 malformed |
403 (Forbidden) | You are not allowed to access the specified content object or comments |
404 (Not Found) | The specified content object does not exist |
501 (Not Implemented) | The specified content object is of a type that does not support comments |
Get Content
GET /contents/{contentID}
Return the specified content object with the specified fields.
Path Parameters:
Name | Type | Required | Description |
---|---|---|---|
contentID | String | true | ID of the content object to be returned |
Query Parameters:
Name | Type | Required | Description |
---|---|---|---|
fields | String | false | Fields to be returned |
abridged | Boolean | false | Flag indicating that if content.text is requested, it will be abridged
(length shortened, HTML tags removed) |
Retrieves:
Return Status:
HTTP Status Code | Description |
---|---|
200 (OK) | Request was successful |
400 (Bad Request) | An input field is malformed |
403 (Forbidden) | You are not allowed to access the specified content object |
404 (Not Found) | The specified content does not exist |
Get Content Followers
GET /contents/{contentID}/followers
Return a paginated list of Persons about people who are following the specified content.
Path Parameters:
Name | Type | Required | Description |
---|---|---|---|
contentID | String | true | ID of the content object to check for followers |
Query Parameters:
Name | Type | Required | Description |
---|---|---|---|
startIndex | Integer | false | Zero-relative index of the first instance to be returned |
count | Integer | false | Maximum number of instances to be returned (i.e. the page size) |
fields | String | false | Fields to be returned (or null for summary fields) |
Retrieves:
Return Status:
HTTP Status Code | Description |
---|---|
200 (OK) | Request was successful |
400 (Bad Request) | The request criteria are malformed |
403 (Forbidden) | The requesting user is not authorize to retrieve this user information |
404 (Not Found) | The specified user cannot be found |
Since: 3.5
Get Content Following In
GET /contents/{contentID}/followingIn
Return the list of custom streams in which the requesting user is following this content object.
Path Parameters:
Name | Type | Required | Description |
---|---|---|---|
contentID | String | true | ID of the content object to check for following |
Query Parameters:
Name | Type | Required | Description |
---|---|---|---|
fields | String | false | Fields to be included in the returned representation |
Retrieves:
Return Status:
HTTP Status Code | Description |
---|---|
200 (OK) | Request was successful |
400 (Bad Request) | An input field is malformed |
403 (Forbidden) | You are not allowed to access this content object |
404 (Not Found) | The specified content object does not exist |
Get Content Likes
GET /contents/{contentID}/likes
Return a paginated list of the people who like the specified content object.
Path Parameters:
Name | Type | Required | Description |
---|---|---|---|
contentID | String | true | ID of the content object for which to return liking people |
Query Parameters:
Name | Type | Required | Description |
---|---|---|---|
startIndex | Integer | false | Zero-relative index of the first person to be returned |
count | Integer | false | Maximum number of people to be returned |
fields | String | false | Fields to be returned on liking people |
Retrieves:
Return Status:
HTTP Status Code | Description |
---|---|
200 (OK) | Request was successful |
400 (Bad Request) | An input field is malformed |
403 (Forbidden) | You are not allowed to access this content object |
404 (Not Found) | The specified content object does not exist |
Get Contents
GET /contents
Return a paginated list of content objects that match the specified filter criteria.
This service supports the following filters. Parameters, when used, should be wrapped in parentheses, and multiple values separated by commas. See the examples for clarification.
Filter | Params | Example |
---|---|---|
author | one or more person URIs, separated by commas | ?filter=author(http://domain/api/core/v3/people/12,http://domain/api/core/v3/people/853) |
entityDescriptor | one or more objectType,objectID pairs (this filter is likely only useful to those developing the Jive UI itself). This filter cannot be combined with other filters. | ?filter=entityDescriptor(102,1234,37,2345) |
place | only one place URI where the content lives | ?filter=place(http://domain/api/core/v3/places/1006) |
relationship |
Chose one of the following options:
|
?filter=relationship(participated) |
search | One or more search terms, separated by commas. You must escape any of the following special characters embedded in the search terms: comma (","), backslash ("\"), left parenthesis ("("), and right parenthesis (")") by preceding them with a backslash. | ?filter=search(test,report) or ?filter=search(10\,000) |
status | Returns content that is in draft mode and the authenticated user can see. This filter cannot be combined with filters: relationship. Available since 3.3. | ?filter=status(draft) |
tag | one or more tags, separated by commas (matching any tag will select a content). Replace the , with AND if you want to retrieve content that has all the specified tags. | ?filter=tag(sales,performance) or ?filter=tag(sales%20AND%20performance) |
type | one or more object types of desired contained content objects separated by commas | ?filter=type(document,discussion) |
This service supports the following sort types.
Sort | Description |
---|---|
dateCreatedAsc | Sort by the date this content object was created, in ascending order |
dateCreatedDesc | Sort by the date this content object was created, in descending order. Default if none was specified. |
latestActivityAsc | Sort by the date this content object had the most recent activity, in ascending order |
latestActivityDesc | Sort by the date this content object had the most recent activity, in descending order |
titleAsc | Sort by content object subject, in ascending order |
The returned list may contain a mixture of content entities of various types. On any given content object entity,
use the type
field to determine the type of that particular content.
Query Parameters:
Name | Type | Required | Description |
---|---|---|---|
filter | Object[] | false | The filter criteria used to select content objects |
sort | String | false | The requested sort order |
startIndex | Integer | false | The zero-relative index of the first matching content to be returned |
count | Integer | false | The maximum number of contents to be returned |
fields | String | false | The fields to be returned on each content |
abridged | Boolean | false | Flag indicating that if content.text is requested, it will be abridged
(length shortened, HTML tags removed) |
Retrieves:
Return Status:
HTTP Status Code | Description |
---|---|
200 (OK) | Request was successful |
400 (Bad Request) | An input field is malformed |
Get Popular Content
GET /contents/popular
Return a list of popular content objects for the authenticated user. Use this service when recommendation is disabled. Do a GET to /api/core/v3/metadata/properties/feature.recommender.enabled to figure out whether recommendation service is enabled or not.
The returned list may contain a mixture of content entities of various types. On any given content object entity,
use the type
field to determine the type of that particular content.
Query Parameters:
Name | Type | Required | Description |
---|---|---|---|
fields | String | false | The fields to be returned on each content |
Retrieves:
Return Status:
HTTP Status Code | Description |
---|---|
200 (OK) | Request was successful |
403 (Forbidden) | You are not allowed to access the specified content object |
Since: 3.1
Get Recent Content
GET /contents/recent
Return a list of recently updated content objects that match the specified filter criteria.
This service supports the following filters. Parameters, when used, should be wrapped in parentheses, and multiple values separated by commas. See the examples for clarification.
Filter | Params | Example |
---|---|---|
place | only one place URI where the content lives | ?filter=place(http://domain/api/core/v3/places/1006) |
type | one or more object types of desired contained content objects separated by commas | ?filter=type(document,discussion) |
The returned list may contain a mixture of content entities of various types. On any given content object entity,
use the type
field to determine the type of that particular content.
Query Parameters:
Name | Type | Required | Description |
---|---|---|---|
filter | Object[] | false | The filter criteria used to select content objects |
startIndex | Integer | false | The zero relative index of the first content object to be returned |
count | Integer | false | The maximum number of content objects to be returned |
fields | String | false | The fields to be returned on each content object |
abridged | Boolean | false | Flag indicating that if content.text is requested, it will be abridged
(length shortened, HTML tags removed) |
Retrieves:
Return Status:
HTTP Status Code | Description |
---|---|
200 (OK) | Request was successful |
400 (Bad Request) | An input field is malformed |
403 (Forbidden) | You are not allowed to access the specified content object |
410 (Gone) | Recommendation feature is disabled |
404 (Not Found) | The specified place in the filter does not exist |
Since: 3.1
Get Recommended Content
GET /contents/recommended
Return a list of recommended content objects for the authenticated user. When recommender service is not enabled in the Jive instance then predefined recommended content is going to be returned instead. Do a GET to /api/core/v3/metadata/properties/feature.recommender.enabled to figure out whether recommendation service is enabled or not.
The returned list may contain a mixture of content entities of various types. On any given content object entity,
use the type
field to determine the type of that particular content.
Query Parameters:
Name | Type | Required | Description |
---|---|---|---|
count | Integer | false | The maximum number of contents to be returned |
fields | String | false | The fields to be returned on each content |
abridged | Boolean | false | Flag indicating that if content.text is requested, it will be abridged
(length shortened, HTML tags removed) |
Retrieves:
Return Status:
HTTP Status Code | Description |
---|---|
200 (OK) | Request was successful |
403 (Forbidden) | You are not allowed to access the specified content object |
Since: 3.1
Get Trending Content
GET /contents/trending
Return a list of trending content objects that match the specified filter criteria. It's possible for some Jive instances to have recommendation disabled, for these cases use getPopularContent(fields, abridged) instead. Do a GET to /api/core/v3/metadata/properties/feature.recommender.enabled to figure out whether recommendation service is enabled or not.
This service supports the following filters. Parameters, when used, should be wrapped in parentheses, and multiple values separated by commas. See the examples for clarification.
Filter | Params | Example |
---|---|---|
place | only one place URI where the content lives | ?filter=place(http://domain/api/core/v3/places/1006) |
type | one or more object types of desired contained content objects separated by commas | ?filter=type(document,discussion) |
The returned list may contain a mixture of content entities of various types. On any given content object entity,
use the type
field to determine the type of that particular content.
Query Parameters:
Name | Type | Required | Description |
---|---|---|---|
filter | Object[] | false | The filter criteria used to select content objects |
count | Integer | false | The maximum number of contents to be returned |
fields | String | false | The fields to be returned on each content |
abridged | Boolean | false | Flag indicating that if content.text is requested, it will be abridged
(length shortened, HTML tags removed) |
Retrieves:
Return Status:
HTTP Status Code | Description |
---|---|
200 (OK) | Request was successful |
400 (Bad Request) | An input field is malformed |
403 (Forbidden) | You are not allowed to access the specified content object |
410 (Gone) | Recommendation feature is disabled |
404 (Not Found) | The specified place in the filter does not exist |
Since: 3.1
Mark Read
POST /contents/{contentID}/read
Mark the specified content object as having been read.
Path Parameters:
Name | Type | Required | Description |
---|---|---|---|
contentID | String | true | ID of the content object 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 content object |
404 (Not Found) | The specified content object does not exist |
Mark Unread
DELETE /contents/{contentID}/read
Mark the specified content object as having not been read.
Path Parameters:
Name | Type | Required | Description |
---|---|---|---|
contentID | String | true | ID of the content object 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 content object |
404 (Not Found) | The specified content object does not exist |
Create Content Following In
POST /contents/{contentID}/followingIn
Replace the list of Streams in which the requesting user is following this content object.
Path Parameters:
Name | Type | Required | Description |
---|---|---|---|
contentID | String | true | ID of the content object being followed |
Query Parameters:
Name | Type | Required | Description |
---|---|---|---|
fields | String | false | Fields to be returned on the updated list of streams |
Takes:
Retrieves:
Return Status:
HTTP Status Code | Description |
---|---|
200 (OK) | Request was successful |
400 (Bad Request) | if any input field is malformed |
404 (Not Found) | if the specified person does not exist |
Since: 3.3
Update Content
PUT /contents/{contentID}
Update an existing content with specified characteristics.
The following rules define which fields in the incoming JSON entity are processed:
- For all content object types, the following fields are processed:
author
,content
,parent
,status
,subject
,tags
,type
. - For all content object types, the
author
,content
,parent
, andsubject
fields are required, and must be unique within the parent place.
Path Parameters:
Name | Type | Required | Description |
---|---|---|---|
contentID | String | true | ID of the content object 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 |
abridged | Boolean | false | Flag indicating that if content.text is requested, it will be abridged
(length shortened, HTML tags removed) |
Takes:
Retrieves:
Return Status:
HTTP Status Code | Description |
---|---|
200 (OK) | Request was successful |
400 (Bad Request) | An input field is malformed |
409 (Conflict) | The new entity would conflict with system restrictions (such as two content objects of the same type with the same subject) |
403 (Forbidden) | You are not allowed to access the specified content object, or to make the requested change in content object state |
Upload Update Content
PUT /contents/{contentID}
Update an existing content with specified characteristics including the option to replace existing attachments. Uploading attachments is only allowed for those content types that support attachments. A BAD_REQUEST error will be returned if attachments are passed and the content type does not support them.
The following rules define which fields in the incoming JSON entity are processed:
- For all content object types, the following fields are processed:
author
,content
,parent
,status
,subject
,tags
,type
. - For all content object types, the
author
,content
,parent
, andsubject
fields are required, and must be unique within the parent place.
Path Parameters:
Name | Type | Required | Description |
---|---|---|---|
contentID | String | true | ID of the content object 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 |
abridged | Boolean | false | Flag indicating that if content.text is requested, it will be abridged
(length shortened, HTML tags removed) |
Takes:
Retrieves:
Return Status:
HTTP Status Code | Description |
---|---|
200 (OK) | Request was successful |
400 (Bad Request) | An input field is malformed |
409 (Conflict) | The new entity would conflict with system restrictions (such as two content objects of the same type with the same subject) |
403 (Forbidden) | You are not allowed to access the specified content object, or to make the requested change in content object state |