Logotype Sitevision Developer
Log in
Log in

ChannelMessages 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.

ChannelMessages

Get, create, update or delete sv:topic (channel) messages.

Applicable to: sv:topic.

GET

Returns either a collection of messages or a single message from a sv:topic

Requirements

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

Permissions

  • Retrieving messages from a private sv:topic requires that the caller is a member of the sv:topic.

Get a collection

Returns an array of objects containing messages for a sv:topic.

Parameters

Name Type Default Values Description
skip number 0 Any positive value Skips leading number of messages.
limit number 10 1 - 50 Limits the number of messages to return.
offsetEntryId string 439.xxx From which point to retrieve following messages.
messageFormat string JSON HTML, PLAIN, JSON, JSON_TREE, MARKDOWN The data format for the message in the returned result (MARKDOWN since 2024.11.1).

Example URL

436.1f04417518b6b85143b1c/channelmessages

Example response

[
    {
      "type": "topicentry",
      "message": [
        {
          "type": "link",
          "url": "https://github.com/sitevision/sitevision-apps/tree/main/packages/create-sitevision-app",
          "text": "create-sitevision-app"
        }
      ],
      "id": "439.26084f3118dd04577272",
      "creationDate": 1708597557367,
      "author": {
        "id": "400.c9230718a03a4dee41",
        "fullName": "John Doe",
        "disabled": false,
        "BuddyIconSize_SMALL": "/images/200.11e3482d18a4f98c8df31/1693553706231/john.webp",
        "BuddyIconSize_LARGE": "/images/200.11e3482d18a4f98c8df32/1693553706282/john.webp",
        "BuddyIconSize_X_LARGE": "/images/200.11e3482d18a4f98c8df30/1693553705992/john.webp"
      },
      "isModified": false,
      "reactions": [],
      "repliesCount": 0
    },
    {
      "type": "topicentry",
      "message": [
        {
           "type": "text",
           "text": "Hello, world!"
        }
      ],
      "id": "439.26084f3118dd04577271",
      "creationDate": 1708597280389,
      "author": {
        "id": "400.c9230718a03a4dee41",
        "fullName": "John Doe",
        "disabled": false,
        "BuddyIconSize_SMALL": "/images/200.11e3482d18a4f98c8df31/1693553706231/john.webp",
        "BuddyIconSize_LARGE": "/images/200.11e3482d18a4f98c8df32/1693553706282/john.webp",
        "BuddyIconSize_X_LARGE": "/images/200.11e3482d18a4f98c8df30/1693553705992/john.webp"
      },
      "isModified": false,
      "reactions": [],
      "repliesCount": 0
    }
]

Get a single message

Returns an object containing a specific message from a sv:topic

Example URL

436.1f04417518b6b85143b1c/channelmessages/439.26084f3118dd04577271

Example response

{
    "type": "topicentry",
    "message": [
      {
         "type": "text",
         "text": "Hello, world!"
      }
    ],
    "id": "439.26084f3118dd04577271",
    "creationDate": 1708597280389,
    "author": {
      "id": "400.c9230718a03a4dee41",
      "fullName": "John Doe",
      "disabled": false,
      "BuddyIconSize_SMALL": "/images/200.11e3482d18a4f98c8df31/1693553706231/john.webp",
      "BuddyIconSize_LARGE": "/images/200.11e3482d18a4f98c8df32/1693553706282/john.webp",
      "BuddyIconSize_X_LARGE": "/images/200.11e3482d18a4f98c8df30/1693553705992/john.webp"
    },
    "isModified": false,
    "reactions": [],
    "repliesCount": 0
  }

POST

Create a message in a sv:topic as the requesting sv:userIdentity.

Returns an object containing the newly created message.

Requirements

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

Permissions

  • Requires that the calling sv:userIdentity is a member of the sv:topic.

Parameters

Name Type Default Values Description
message string The message of the entry (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 JSON HTML, PLAIN, JSON, JSON_TREE, MARKDOWN The data format for the message in the returned result (MARKDOWN since 2024.11.1).

Example URL

436.1f04417518b6b85143b1c/channelmessages

Example input

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

Example response

{
   "type": "topicentry",
   "message": [
      {
         "type": "text",
         "text": "Hello, channel!"
      }
   ],
   "id": "439.26084f3118dd04577275e",
   "creationDate": 1708605003818,
   "author": {
      "id": "400.c9230718a03a4dee41",
      "fullName": "Robin Lagren",
      "disabled": false,
      "BuddyIconSize_SMALL": "/images/200.11e3482d18a4f98c8df31/1693553706231/robin.webp",
      "BuddyIconSize_LARGE": "/images/200.11e3482d18a4f98c8df32/1693553706282/robin.webp",
      "BuddyIconSize_X_LARGE": "/images/200.11e3482d18a4f98c8df30/1693553705992/robin.webp"
   },
   "isModified": false
}

PUT

Update a message.

Returns an object containing the updated message.

Requirements

  • The feature "social collaboration" and that social collaboration is enabled on the sv:site.
  • The caller must have a sv:userIdentity.
  • The targeted message must belong to the targeted sv:topic.
  • The targeted sv:topic must not be archived.

Permissions

  • Requires that the calling sv:userIdentity is the author of the message and member of the sv:topic where the message exists.

Parameters

Name Type Default Values Description
message string The new message of the entry (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 JSON HTML, PLAIN, JSON, JSON_TREE, MARKDOWN The data format for the message in the returned result (MARKDOWN since 2024.11.1).

Example URL

436.1f04417518b6b85143b1c/channelmessages/439.26084f3118dd04577271

Example input

{
   "message": "Fixed!"
}

Example response

{
   "type": "topicentry",
   "message": [
      {
         "type": "text",
         "text": "Fixed!"
      }
   ],
   "id": "439.26084f3118dd04577275e",
   "author": {
      "id": "400.c9230718a03a4dee41"
   },
   "isModified": true,
   "modifiedAt": 1708613038013
}

DELETE

Delete a message.

Returns an object containing status.

Requirements

  • The feature "social collaboration" and that social collaboration is enabled on the sv:site.
  • The caller must have a sv:userIdentity.
  • The targeted message must belong to the targeted sv:topic.
  • The targeted sv:topic must not be archived.

Permissions

  • Requires that the calling sv:userIdentity is the author of the message and member of the sv:topic where the message exists.

Example URL

436.1f04417518b6b85143b1c/channelmessages/439.26084f3118dd04577271

Example response

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