Get chat

Prev Next

This API retrieves chat messages. To view the usage flow in B2B PRISM Live Studio, see Chat process.

Note
  • Send, query, and delete chats during live streams.
  • Chat retrieval occurs approximately every 5 seconds until the live stream ends.
  • If the Send/Get/Delete chat APIs are not provided, the chat feature cannot be used.
  • It is possible to provide only the Send chat API. However, in this case, chats cannot be viewed.

Request

The method and URI are as follows:

POST /prism/v1/service/live/{liveId}/chat

Request headers

The following describes the headers.

Name Type Description Required
x-prism-access-token String Access token issued via OAuth 2.0 authorization Y

Request path parameters

The following describes the parameters.

Name Type Description Required
liveId String Live ID Y

Request body

The following describes the body.

Name Type Description Required
maxResults Number
  • Maximum number of chat messages to retrieve
  • The maximum value is 100. If the value is 0 or greater than 100, only 100 messages will be returned.
  • Y
    pageToken String
  • Use to retrieve data following the data retrieved from the previous page.
  • If pageToken != null, the list of chat messages following the specified pageToken is returned.
  • If pageToken = null & maxResults != 0, the most recent messages - maxCount are provided.
  • If pageToken = null & maxResults = 0, the most recent messages - 100 are provided.
  • N

    Response

    This section describes the response format.

    Note

    For the default response format, see API response default format.

    Name Type Description Required
    liveId String Live ID Y
    nextPageToken String
  • If you enter the nextPageToken obtained from a previous API call into pageToken and make a request, the results will start from the most recently entered chat messages.
  • If there are no new chat messages, nextPageToken will return the same value as the requested pageToken.
  • Y
    messages Object
  • Chat message list
  • If there are no chat messages, this field is returned as an empty array.
  • Y

    message dto

    The following describes the message dto.

    Name Type Description Required
    messageId String
  • Chat message ID.
  • If the chat deletion feature is not available, you do not need to provide the message ID.
  • N
    messageAt Date
  • Time the chat message was entered
  • Provided in ISO 8601 format
  • N
    authorId String
  • userId that entered the chat message
  • Y
    authorName String
  • The name of the user who entered the chat message.
  • Chat messages from users without a name can be ignored.
  • Y
    authorProfileThumbnail String
  • Thumbnail image of the user who entered the chat message.
  • If authorProfileThumbnail is missing, the thumbnail is not displayed.
  • N
    isLiveOwner Boolean
  • Whether the user in the chat is the current live streamer.
  • The ID may be displayed differently within PRISM.
  • If absent, it is displayed the same as a regular chat.
  • N
    isLiveManager Boolean
  • If manager feature is provided, whether the user in this chat is a manager.
  • The ID may be displayed differently within PRISM.
  • If absent, it is displayed the same as a regular chat.
  • N

    How to provide page token

    The following describes how to provide a page token.

    b2bpls-chats_page-token_ko

    Examples

    Here are some example syntaxes.

    Request example

    The following is a sample syntax.

    curl -X POST /prism/v1/service/live/{liveId}/chat
        -H "x-prism-access-token: {access-token}"
    

    Response example

    The following is a sample syntax.

    {
        "success": true,
        "errorCode": 0,
        "errorName": null,
        "message": null,
        "data": {
            "liveId": 6,
            "nextPageToken": 8239,
            "messages": [
                {
                    "messageId": 12,
                    "message": "Chat writing test 2023-09-05 11:10:27",
                    "messageAt": "2023-09-05T11:10:27+09:00",
                    "authorId": "admin",
                    "authorName": "Administrator",
                    "authorProfileThumbnail": null,
                    "isLiveOwner": true,
                    "isLiveManager": false
                },
                {
                    "messageId": 13,
                    "message": "Chat writing test 2023-09-05 11:25:11",
                    "messageAt": "2023-09-05T11:25:11+09:00",
                    "authorId": "admin",
                    "authorName": "Administrator",
                    "authorProfileThumbnail": null,
                    "isLiveOwner": true,
                    "isLiveManager": false
                }
            ]
        }
    }