static
osapi.jive.corev3.contents
Static class for getting or creating any content type. Specific content types also have their own static classes
for manipulating that content type. The more specific classes function similarly, but the "type" field is not required
and there might be more functionality specific to that type. For example, discussions
is the static class for creating and
getting discussions. Content types include:
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.
Example:
You may want to save the URIs of content types for future use. URIs are the handles used to retrieve objects throughout the API. Here is an example of using the URI of a document to retrieve all fields of that document. Note that the "fields" parameter takes a comma-delimited list of fields or the special values "@all" and "@summary".
//Get all fields of a document by URI var documentURI = ...; //A given URI of a document <p/> var request = osapi.jive.corev3.contents.get({ "type": "document", "uri": documentURI, "fields": "@all" }); <p/> request.execute(function(data) { console.log("Fetched the document!", data); });
Methods
create(content,options)
POST /contents
Retrieves
Content
Description
Create a new content object with specified characteristics, and return an entity representing the newly created content object.
The specific JSON varies per type of content. Follow these links to see creation examples for each type of content:
Takes:
- Content fields describing the new content
Options:
Name | Type | Required | Description |
---|---|---|---|
fields | String | false | Names of the fields to be returned |
Retrieves:
get(options)
GET /contents
Retrieves
Content[]
Description
Return a paginated list of content object that match the specified criteria.
Options:
Name | Type | Required | Description |
---|---|---|---|
author | String | false | URI of a person, limiting results to objects authored by this person |
entityDescriptor | String | false | Comma delimited list of object type / object ID values (useful only for the Jive UI). When used other filters are not allowed |
count | Integer | false | Maximum number of objects to return (default is 25) |
fields | String | false | Comma delimited list of the fields to be returned. |
place | String | false | URI of a place, limiting results to objects contained in that place |
search | String | false | One or more search terms separated by commas, limiting results to objects that match the terms |
startIndex | Integer | false | Zero-relative index of the first content object to be returned |
tag | String | false | Comma delimited list of tag values, limiting results to objects with one of those tags |
type | String | false | Comma delimited list of content object types, limiting results to objects of those types |
Retrieves:
get(options)
GET /contents/{uri}
Retrieves
Content
Description
Return a single content object by its URI.
Options:
Name | Type | Required | Description |
---|---|---|---|
uri | String | true | URI of the content object to get |
fields | String | false | Names of the fields to be returned |
Retrieves:
getPopularContent(options)
GET /contents/popular
Retrieves
Content[]
Description
Return a list of popular content objects for the authenticated user. Use this service when recommendation is disabled. Use getPropertyMetadata({name:'feature.recommender.enabled'}) to figure out whether recommendation service is enabled or not.
Options:
Name | Type | Required | Description |
---|---|---|---|
fields | String | false | Names of the fields to be returned |
Retrieves:
Since: 3.1
getRecommendedContent(options)
GET /contents/recommended
Retrieves
Content[]
Description
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. Use getPropertyMetadata({name:'feature.recommender.enabled'}) to figure out whether recommendation service is enabled or not.
Options:
Name | Type | Required | Description |
---|---|---|---|
count | Integer | false | Maximum number of objects to return (default is 25) |
fields | String | false | Names of the fields to be returned |
Retrieves:
Since: 3.1
getTrendingContent(options)
GET /contents/trending
Retrieves
Content[]
Description
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() instead. Use getPropertyMetadata({name:'feature.recommender.enabled'}) to figure out whether recommendation service is enabled or not.
Options:
Name | Type | Required | Description |
---|---|---|---|
count | Integer | false | Maximum number of objects to return (default is 25) |
fields | String | false | Names of the fields to be returned |
place | String | false | URI of a place, limiting results to objects contained in that place |
type | String | false | Comma delimited list of content object types, limiting results to objects of those types |
Retrieves:
Since: 3.1
search(options)
GET /search/contents
Retrieves
Object[]
Description
Search for and return content objects that match the specified filter criteria.
Options:
Name | Type | Required | Description |
---|---|---|---|
after | String | false | Select content objects modified after the specified date/time |
author | String | false | Select content objects authored by the specified person. The parameter value must be either a full or partial (starting with "/people/") URI for the desired person |
before | String | false | Select content objects last modified before the specified date/time |
count | Integer | false | Maximum number of results to be returned |
fields | String | false | Names of the fields to be returned |
morelike | String | false | Select content objects that are similar to the specified content object. The parameter value must be either a full or partial (starting with "/contents/") URI of the specified content object. |
place | String | false | Select content objects that are contained in the specified place or places. The parameter value must be one or more (comma separated) either full or partial (starting with "/places/") URI of the specified place(s). |
search | String | true | 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. Wildcards can be used, e.g. to search by substring use "*someSubstring*". |
startIndex | Integer | false | Zero relative index of the first search result to be returned |
subjectonly | String | false | Flag indicating whether or not to limit search results to only content objects
whose subject matches the search keywords. Defaults to true . |
type | String | false | Select content objects that are of one of the specified types (separated by commas). Defaults to all available content types. |
Retrieves:
highlightBody
, highlightSubject
, highlightTags
,
parentContent
, parentPlace
)