osapi.jive.corev3.contents.Document

The document class contains methods and data for using documents just as you would in the UI. Everything can be modified such as a document's content, subject, tags, and comments. Metadata is available, e.g. the author, the publish date, the number of people following the document, etc.

Example:
Example JSON

JSON with the most important data for a Document. See the table below for a list of all fields.

  {
   "type" : "document",
   "status" : "published",
   "subject" : "My First Document",
   "content" : {
        "type" : "text/html",
        "text" : "<p>Some interesting document text</p>"
    },
   "authorship" : "open",
   "author" : {
      "displayName" : "Administrator",
   },
   "visibility" : "all",
   "restrictComments" : false,
   "viewCount" : 0,
   "replyCount" : 0,
   "followerCount" : 0,
   "likeCount" : 0,
   "published" : "2012-06-27T22:53:30.370+0000",
   "updated" : "2012-06-27T22:53:30.491+0000",
   "categories" : [ "Cars" ],
   "tags" : [ ],
   "attachments" : [ ]
 }

Properties

PropertyTypeMode Description
approversPerson[]optional

List of people who are approvers on the content of this document.

attachmentsAttachment[]optional

List of attachments to this document.

authorPersonread-only

Author of this content object.

authorsPerson[]optional

List of people who are authors on this content. Authors are allowed to edit the content. This value is used only when authorship is limited.

authorshipStringoptional
The authorship policy for this content.
  • open - anyone with appropriate permissions can edit the content. Default when visibility is place.
  • author - only the author can edit the content. Default when visibility is hidden or all.
  • limited - only those users specified by authors can edit the content. If authors was not specified then users will be used instead when visibility is people. Default when visibility is people.
categoriesString[]optional

Categories associated with this object. Places define the list of possible categories.

contentContentBodyrequired

Content of this content object.

followerCountIntegerread-only

Number of people following this object.

Availability:

Will be present only for object types that support being followed.

fromQuestStringoptional

Flag indicating that this document was created as part of a quest.

highlightBodyStringread-only

Highlight snippet of a search match in the body or description.

Availability:

Will be present in search results only.

highlightSubjectStringread-only

Highlight snippet of a search match in the subject or name.

Availability:

Will be present in search results only.

highlightTagsStringread-only

Highlight snippet of a search match in tags.

Availability:

Will be present in search results only.

idStringread-only

Identifier (unique within an object type and Jive instance) of this object. This field is internal to Jive and should not be confused with contentID or placeID used in URIs.

likeCountIntegerread-only

Number of people who have liked this object.

Availability:

Will be present only for object types that support being liked.

parentStringoptional

URI of the parent place of this content object. When visibility is place then the URI points to a place (and is required on create). Otherwise, this field is not part of the returned JSON (and must not be included on create).

parentContentSummaryread-only

Summary information about the content object that is the parent of this object.

Availability:

Will be present in search results only.

parentPlaceSummaryread-only

Summary information about the place that contains this object.

Availability:

Will be present in search results only.

publishedISO 8601 Dateread-only

Date and time when this content object was originally created.

replyCountIntegerread-only

Number of replies to this object.

Availability:

Will be present only for object types that support replies.

resourcesObjectread-only

Resource links (and related permissions for the requesting person) relevant to this object.

restrictCommentsBooleanoptional
Flag indicating that old comments will be visible but new comments are not allowed. If not restricted then anyone with appropriate permissions can comment on the content.
statusStringread-only

State of this document.

  • incomplete - Document is in draft mode
  • pending_approval - Document is waiting for approval
  • rejected - Document has been rejected for publication by an approver
  • published - Document has been published
subjectStringrequired

Subject of this content object.

tagsString[]optional

Tags associated with this object.

Availability:

Will be present only for object types that support tags

typeStringrequired

The object type of this object ("document"). This field is required when creating new content.

updatedISO 8601 Dateread-only

Date and time this content object was most recently updated.

updaterPersonread-only

The last person that updated this document. If not present, the last person to update this document was the person referenced in the author field.

usersPerson[]optional
The list of users that can see the content. On create or update, provide a list of Person URIs or Person entities. On get, returns a list of Person entities. This value is used only when visibility is people.
viewCountIntegerread-only

Number of times this content object has been viewed.

Availability:

Will be present only for objects that support view counts

visibilityStringoptional

The visibility policy for this content object. Valid values are:

  • all - anyone with appropriate permissions can see the content. Default when visibility, parent and users were not specified.
  • hidden - only the author can see the content.
  • people - only those users specified by users can see the content. Default when visibility and parent were not specified but users was specified.
  • place - place permissions specify which users can see the content. Default when visibility was not specified but parent was specified.
visibleToExternalContributorsBooleanread-only

Flag indicating that this content object is potentially visible to external contributors.

→ Fields used by update and create operations
→ Fields used only by create operations
→ Fields not used by update or create operations

Methods

createComment(comment,options)
POST /contents/1234/comments

Retrieves

Comment

Description

Add a comment about this content object.

The minimum JSON object needed to create a comment is:

     {
         "content": {"type": "text/html", "text": "<body><p>This is a new comment</p></body>"},
     }
Takes:
Options:
NameTypeRequiredDescription
authorBooleanfalseFlag indicating if new comment is an author comment or a regular comment. By default a regular comment will be created.
fieldsStringfalseThe names of the fields to be returned
Retrieves:
  • Comment representing the recorded comment
  • destroy()
    DELETE /contents/1234

    Retrieves

    --

    Description

    Delete this content object and any related comments and other related information.

    get(options)
    GET /contents/1234

    Retrieves

    Document

    Description

    Return an updated version of this content object.

    Options:
    NameTypeRequiredDescription
    fieldsStringfalseThe names of the fields to be returned
    Retrieves:
  • Content describing this content object
  • getAttachments(options)
    GET /attachments/contents/1234

    Retrieves

    Attachment[]

    Description

    Return a list of attachments associated to this document.

    Options:
    NameTypeRequiredDescription
    fieldsStringfalseThe names of the fields to be returned
    Retrieves:
  • Attachment[]
  • getComments(options)
    GET /contents/1234/comments

    Retrieves

    Comment[]

    Description

    Return a paginated list of the comments about this content object.

    Options:
    NameTypeRequiredDescription
    countIntegerfalseThe maximum number of comments to be returned (default is 25)
    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.
    excludeRepliesBooleanfalseFlag indicating that replies to the direct comments about this direct message should be excluded (default is false)
    fieldsStringfalseThe names of the fields to be returned
    hierarchicalBooleanfalseFlag indicating that comments should be returned in hierarchical order instead of chronological order (default is true)
    startIndexIntegerfalseZero-relative index of the first comment to be returned (default is zero)
    Retrieves:
  • Comment[]
  • getFollowers(options)
    GET /contents/1234/followers

    Retrieves

    Person[]

    Description

    Return a paginated list of the people following this content.

    Options:
    NameTypeRequiredDescription
    countIntegerfalseNumber of followers to be returned (default is 25)
    fieldsStringfalseNames of the fields to be returned
    startIndexIntegerfalseZero-relative index of the first follower to be returned
    Retrieves:
  • Person[]
  • Since: 3.5
    getFollowingIn(options)
    GET /contents/1234/followingIn

    Retrieves

    Stream[]

    Description

    Return the list of custom streams in which the requesting person is following this document (if any).

    Options:
    NameTypeRequiredDescription
    fieldsStringfalseThe names of the fields to be returned
    Retrieves:
  • Stream[]
  • getLikes(options)
    GET /contents/1234/likes

    Retrieves

    Person[]

    Description

    Return a paginated list of people who like this document.

    Options:
    NameTypeRequiredDescription
    countIntegerfalseThe maximum number of people to return (default is 25)
    fieldsStringfalseThe names of the fields to be returned
    startIndexIntegerfalseZero-relative index of the first person to return (default is 0)
    Retrieves:
  • Person[]
  • getVersions(options)
    GET /versions/1234

    Retrieves

    ContentVersion[]

    Description

    Return a paginated list of versions of this document.

    Options:
    NameTypeRequiredDescription
    countIntegerfalseThe maximum number of versions to return (default is 25)
    fieldsStringfalseThe names of the fields to be returned
    startIndexIntegerfalseZero-relative index of the first person to return (default is 0)
    Retrieves:
  • ContentVersion
  • like()
    POST /contents/1234/likes

    Retrieves

    --

    Description

    Register that the requesting person likes this document.

    Availability:

    Must be authenticated, must not be your own document, and must not have liked this document already

    markRead()
    POST /contents/1234/read

    Retrieves

    --

    Description

    Mark this document as having been read.

    Since: 3.2
    markUnread()
    DELETE /contents/1234/read

    Retrieves

    --

    Description

    Mark this document as having not been read.

    Since: 3.2
    toURI()

    Retrieves

    String

    Description

    Retrieves:
  • A URI representing this entity, or undefined if no such URI exists.
  • unlike()
    DELETE /contents/1234/likes

    Retrieves

    --

    Description

    Delete the like of this document by the requesting person.

    Availability:

    Must be authenticated, and must have liked this document already

    update(multipartbody,options)
    PUT /contents/1234

    Retrieves

    Content

    Description

    Update the information about this content object.

    Options:
    NameTypeRequiredDescription
    fieldsStringfalseThe names of the fields to be returned
    Retrieves:
  • Content representing the updated content object
  • Resources

    ResourceMethodReturnsDescription
    htmlGETObject

    Return the HTML representation of this content object.