Logotype Sitevision Developer
Log in
Log in

Comments REST API endpoint

Disclaimer: This endpoint documentation is generated from the latest Sitevision version. It might differ from the actual Sitevision environment where your website resides.

Use the RestApi utility of the Public API for server-side access of this endpoint.

Comments

Get, create, update or delete comments or replies on a commentable node.

Applicable to: sv:timelineEntry, sv:timelineWallEntry, sv:timelineFileEntry, sv:timelineFileWallEntry, sv:timelineShareEntry, sv:timelineSharePageEntry, sv:topicTimelineEntry, sv:page, sv:article, sv:collaborationGroupPage, sv:sitePage, sv:pageComment, sv:comment, sv:file of a sv:personalFileRepository and sv:image of a sv:personalImageRepository.

GET

Returns either an array or a single object containing comments or replies to a comment from a commentable node.

Requirements

  • The feature "social collaboration" and that social collaboration is enabled on the sv:site, except when operating on page types.

Permissions

  • A node owned by a sv:userIdentity requires that the sv:userIdentity is available and the caller is authorized to READ the sv:site.
  • A node owned by a sv:collaborationGroup requires that the caller is allowed to view the group and is authorized to READ the sv:collaborationGroupPage.
  • A node owned by a sv:topic requires that the caller is a member of the topic.
  • On a sv:page, sv:article, sv:collaborationGroupPage or a sv:sitePage it is required that the caller is authorized to READ the node.
  • On a sv:pageComment, it is required that the caller is authorized to READ the page (sv:page, sv:article, sv:collaborationGroupPage or sv:sitePage) the comment resides on.

Get a collection

Returns an array containing multiple comments or replies from a commentable node.

Parameters

Name Type Default Values Description Since
skip number 0 Any positive value Skips leading number of comments.
limit number 10 1-500 Limits the number of comments to return.
order string CHRONOLOGICAL CHRONOLOGICAL, REVERSE_CHRONOLOGICAL Determines sort order of the comments. CHRONOLOGICAL returns oldest first. REVERSE_CHRONOLOGICAL returns newest first. 4.5.1
offsetCommentId string From which point to retrieve following comments. 4.5.1
messageFormat String HTML HTML, PLAIN, JSON, JSON_TREE, MARKDOWN The data format for the message in the returned result (JSON_TREE since 2024.02.1, MARKDOWN since 2024.11.1).

Legacy note! MARKDOWN is not applicable for comments stored in the legacy format used prior to 2025.01.1! Using MARKDOWN for such entries will result in the message being returned in HTML format instead.

8
escapeMessage boolean false HTML escape the message in the returned result (not applicable when messageFormat is PLAIN or MARKDOWN). 7

Example URL

420.2d9ef32f1625230616bd/comments

Example input

{
   "skip": 5,
   "limit": 10,
   "escapeMessage": true
}

Example response

[
   {
      "id": "404.6a65440c19938da4a741f",
      "creationDate": 1757597495303,
      "author": {
         "id": "400.6a65440c19938da4a7411",
         "fullName": "Elias Abrache",
         "disabled": false,
         "BuddyIconSize_SMALL": "/svplaceholder/32/400.6a65440c19938da4a7411.webp",
         "BuddyIconSize_LARGE": "/svplaceholder/48/400.6a65440c19938da4a7411.webp",
         "BuddyIconSize_X_LARGE": "/svplaceholder/64/400.6a65440c19938da4a7411.webp"
      },
      "commentsCount": 4,
      "isLikable": true,
      "isEditable": true,
      "isRemovable": true,
      "message": "<p>Sitevision is like a box of chocolate, but without the liqueur pieces that no one likes..</p>",
      "isModified": false,
      "likesCount": 12,
      "userLikes": true,
      "attachments": []
   },
   {
      "id": "404.6a65440c19938da4a7425",
      "creationDate": 1757597563142,
      "author": {
         "id": "400.6a65440c19938da4a7411",
         "fullName": "Jimmy Roselin",
         "disabled": false,
         "BuddyIconSize_SMALL": "/svplaceholder/32/400.6a65440c19938da4a8411.webp",
         "BuddyIconSize_LARGE": "/svplaceholder/48/400.6a65440c19938da4a8411.webp",
         "BuddyIconSize_X_LARGE": "/svplaceholder/64/400.6a65440c19938da4a8411.webp"
      },
      "commentsCount": 1,
      "isLikable": true,
      "isEditable": true,
      "isRemovable": true,
      "message": "<p>I agree 👆!</p>",
      "isModified": false,
      "likesCount": 4,
      "userLikes": false,
      "attachments": [
         {
            "type": "file",
            "id": "18.6a65440c19938da4a7422",
            "URI": "/download/18.6a65440c19938da4a7422/1757597543529/chocolates.pdf",
            "URL": "https://elias.dev.sitevision.net/download/18.6a65440c19938da4a7422/1757597543529/chocolates.pdf",
            "displayName": "chocolates.pdf",
            "length": 0,
            "mimeType": "application/pdf"
         },
         {
            "type": "file",
            "id": "18.6a65440c19938da4a7423",
            "URI": "/download/18.6a65440c19938da4a7423/1757597543529/notes.txt",
            "URL": "https://elias.dev.sitevision.net/download/18.6a65440c19938da4a7423/1757597543529/notes.txt",
            "displayName": "notes.txt",
            "length": 0,
            "mimeType": "text/plain"
         }
      ]
   }
]

Get a single comment

Returns a single object containing a specific comment from a commentable node.

Parameters

Name Type Default Values Description
messageFormat String HTML HTML, PLAIN, JSON, JSON_TREE, MARKDOWN The data format for the message in the returned result.

Legacy note! MARKDOWN is not applicable for comments stored in the legacy format used prior to 2025.01.1! Using MARKDOWN for such entries will result in the message being returned in HTML format instead.

escapeMessage boolean false HTML escape the message in the returned result (not applicable when messageFormat is PLAIN or MARKDOWN).

Example URL

420.2ece0c25197309c07c748/comments/404.2e58f3ae1977909db276e

Example response

{
   "id": "404.6a65440c19938da4a741f",
   "creationDate": 1757597495303,
   "author": {
      "id": "400.6a65440c19938da4a7411",
      "fullName": "Elias Abrache",
      "disabled": false,
      "BuddyIconSize_SMALL": "/svplaceholder/32/400.6a65440c19938da4a7411.webp",
      "BuddyIconSize_LARGE": "/svplaceholder/48/400.6a65440c19938da4a7411.webp",
      "BuddyIconSize_X_LARGE": "/svplaceholder/64/400.6a65440c19938da4a7411.webp"
   },
   "commentsCount": 4,
   "isLikable": true,
   "isEditable": true,
   "isRemovable": true,
   "message": "<p>Sitevision is like a box of chocolate, but without the liqueur pieces that no one likes..</p>",
   "isModified": false,
   "likesCount": 12,
   "userLikes": true,
   "attachments": []
}

POST

Create a comment or reply to a comment on a commentable node, such as a page, a post on a timeline or a fileresource

Returns an object containing the newly created comment

Requirements

  • The feature "social collaboration" and that social collaboration is enabled on the sv:site, except when operating on page types.
  • The caller must have a sv:userIdentity

Permissions

  • Commenting or replying to a comment on a node owned by a sv:userIdentity requires that the caller is authorized to READ the sv:site.
  • Commenting or replying to a comment on a node owned by a sv:collaborationGroup requires that the caller is allowed to view the group and is authorized to READ the sv:collaborationGroupPage.
  • Commenting or replying to a comment on a node owned by a sv:topic requires that the caller is a member of the topic.
  • Commenting on a sv:page, sv:article, sv:collaborationGroupPage or a sv:sitePage requires that the caller is authorized to READ the node.
  • On a sv:pageComment, it is required that the caller is authorized to READ the page (sv:page, sv:article, sv:collaborationGroupPage or sv:sitePage) the comment resides on.

Parameters

Name Type Default Values Description Since
message string The message of the comment (plain text or Markdown-formatted plain text).

The max length of the message is determined by the social collaboration max character count setting (maxEntryCharacterCount property of the sv:site).

hidden boolean false Whether the comment should be created as hidden or not, i.e. moderated comments. Only applicable to comments on pages and articles
isAnonymous boolean false Whether the comment should be published as an anonymous user or not. Only applicable to comments on pages and articles. Note! A service user is still required as a proxy to call the API. 2026.04.2
fullName string The name of the person posting an anonymous comment. A value is required to post an anonymous comment. Only applicable to comments on pages and articles. 2026.04.2
mail string The mail of the person posting an anonymous comment. Only applicable to comments on pages and articles. 2026.04.2
messageFormat String HTML HTML, PLAIN, JSON, JSON_TREE, MARKDOWN The data format for the message in the returned result (JSON_TREE since 2024.02.1, MARKDOWN since 2024.11.1). 8
escapeMessage boolean false HTML escape the message in the returned result (not applicable when messageFormat is PLAIN or MARKDOWN). 7

Example URL

420.2d9ef32f1625230616bd/comments

Example input

{
   "message": "Hello, World!"
}

Example response

{
   "id": "404.6a65440c19938da4a742f",
   "creationDate": 1757598829211,
   "author": {
      "id": "400.55b527e91959f9c328b76",
      "fullName": "Elias Abrache",
      "disabled": false,
      "BuddyIconSize_SMALL": "/svplaceholder/32/400.55b527e91959f9c328b76.webp",
      "BuddyIconSize_LARGE": "/svplaceholder/48/400.55b527e91959f9c328b76.webp",
      "BuddyIconSize_X_LARGE": "/svplaceholder/64/400.55b527e91959f9c328b76.webp"
   },
   "commentsCount": 0,
   "isLikable": true,
   "isEditable": true,
   "isRemovable": true,
   "message": "<p>Hello, World!</p>",
   "isModified": false,
   "likesCount": 0,
   "userLikes": false,
   "attachments": []
}

PUT

Edit a comment or a reply to a comment on a commentable node, such as a page, a comment on a timeline or a fileresource

Returns an object containing the newly updated comment

Requirements

  • The feature "social collaboration" and that social collaboration is enabled on the sv:site.
  • The caller must have a sv:userIdentity

Permissions

  • Update a comment or a reply on a node owned by a sv:userIdentity requires that the caller is authorized to READ the sv:site and is author of the comment or reply or is authorized to MANAGE_USER_IDENTITIES
  • Update a comment or a reply on a node owned by a sv:collaborationGroup requires that the caller is allowed to view the group and is authorized to READ the sv:collaborationGroupPage and is author of the comment or reply or is authorized to MANAGE_COLLABORATION_GROUP
  • Update a comment or a reply on a node owned by a sv:topic requires that the caller is a member of the topic and is the author of the comment or reply
  • Update a comment on a sv:page, sv:article, sv:collaborationGroupPage or a sv:sitePage requires that the caller is authorized to READ the node and is author of the comment or that the caller is authorized to WRITE on the node
  • Update a reply on a sv:pageComment requires that the caller is authorized to READ the node and is author of the reply or that the caller is authorized to WRITE on the page it resides on

Parameters

Name Type Default Values Description Since
message string The new message of the comment (plain text or Markdown-formatted plain text).

The max length of the message is determined by the social collaboration max character count setting (maxEntryCharacterCount property of the sv:site).

messageFormat String HTML HTML, PLAIN, JSON, JSON_TREE, MARKDOWN The data format for the message in the returned result (JSON_TREE since 2024.02.1, MARKDOWN since 2024.11.1). 8
escapeMessage boolean false HTML escape the message in the returned result (not applicable when messageFormat is PLAIN or MARKDOWN). 7

Example URL

420.1667fd8b15ad7c6902f3/comments/404.71505305163737a70fd8

Example input

{
   "message": "Fool of a Took!",
   "messageFormat": "JSON"
}

Example response

{
   "message": [
      {
         "type": "text",
         "text": "Fool of a Took!"
      }
   ]
}

DELETE

Remove a comment or a reply to a comment on a commentable node, such as a page, a post on a timeline or a fileresource

Returns an object containing status

Requirements

  • The feature "social collaboration" and that social collaboration is enabled on the sv:site, except when operating on page types.
  • The caller must have a sv:userIdentity

Permissions

  • Removing a comment or a reply on a node owned by a sv:userIdentity requires that the caller is authorized to READ the sv:site and is author of the comment or reply or is authorized to MANAGE_USER_IDENTITIES
  • Removing a comment or a reply on a node owned by a sv:collaborationGroup requires that the caller is allowed to view the group and is authorized to READ the sv:collaborationGroupPage and is author of the comment or reply or is authorized to MANAGE_COLLABORATION_GROUP
  • Removing a comment or a reply on a node owned by a sv:topic requires that the caller is a member of the topic and is the author of the comment or reply
  • Removing a comment on a sv:page, sv:article, sv:collaborationGroupPage or a sv:sitePage requires that the caller is authorized to READ the node and is author of the comment or that the caller is authorized to WRITE on the node
  • Removing a reply on a sv:pageComment requires that the caller is authorized to READ the node and is author of the reply or that the caller is authorized to WRITE on the page it resides on

Example URL

420.1667fd8b15ad7c6902f3/comments/404.71505305163737a70fd8

Example response

{
   "success": true
}
Did you find the content on this page useful?