Chat / Platform API
Current version: v3
    Chat Platform API v3
    Chat Platform API
    Chat
    Platform API
    Home
    /
    Chat
    /
    Platform API
    /
    Message

    List threaded replies of a parent message

    Retrieves replies of a specific parent message.


    HTTP request

    GET https://api-{application_id}.sendbird.com/v3/{channel_type}/{channel_url}/messages
    

    Parameters

    The following table lists the parameters that this action supports.

    Parameters
    RequiredTypeDescription

    channel_type

    string

    Specifies the type of the channel. Acceptable values are open_channels and group_channels.

    channel_url

    string

    Specifies the URL of the target channel.

    parent_message_id

    long

    Specifies the unique ID of the parent message to retrieve messages. The parent message and their direct replies are retrieved only when both parent_message_id and message_ts are specified.

    message_ts

    long

    Specifies the timestamp to be the reference point of the query in Unix milliseconds format.

    include_replies

    boolean

    (Deprecated) Determines whether to include replies as messages in the results. If set to true, all messages including replies, ones without replies, and ones with a thread of replies are returned in the results in chronological order. (Default: false)

    OptionalTypeDescription

    include_reply_type

    string

    Specifies the type of message to include in the results.
    - NONE (default): All messages that are not replies. These messages may or may not have replies in its thread.
    - ALL: All messages including threaded and non-threaded parent messages as well as its replies.
    - ONLY_REPLY_TO_CHANNEL: Messages that are not threaded. Only the parent messages and replies that were sent to the channel are included.

    include_parent_message_info

    boolean

    Determines whether to include the information of the parent messages in the result. (Default:false)

    include_thread_info

    boolean

    Determines whether to include the thread information in the response. (Default: false)

    prev_limit

    int

    Specifies the number of previously sent messages to retrieve before the specified message timestamp. This parameter works in conjunction with the message_ts property. Acceptable values range from 0 to 200. (Default: 15)

    next_limit

    int

    Specifies the number of sent messages to retrieve after the specified message timestamp. This parameter works in conjunction with the message_ts property. Acceptable values range from 0 to 200. (Default: 15)

    include

    boolean

    Determines whether to include the messages sent exactly on the specified message_ts in the results. (Default: true)

    reverse

    boolean

    Determines whether to sort the results in reverse chronological order. If set to true, messages appear in reverse chronological order where the newest comes first and the oldest last. (Default: false)

    sender_id

    string

    Restricts the search scope to only retrieve messages that are sent by a specified user.

    sender_ids

    string

    Restricts the search scope to only retrieve messages sent by one or more users with the specified IDs listed in a comma-separated string.

    operator_filter

    string

    Restricts the search scope to only retrieve messages sent by operators or non-operator members of the channel. Acceptable values are all, operator, and nonoperator. (Default: all)

    message_type

    string

    Specifies a message type to retrieve. Acceptable values are MESG, FILE, and ADMM. If not specified, the scope of retrieval is set to all messages.

    custom_type

    string

    Specifies the custom type of messages to retrieve. If not specified, all messages are retrieved.

    including_removed

    boolean

    Determines whether to include removed messages from a channel in the results. (Default: false)

    include_reactions

    boolean

    Determines whether to include reactions added to messages in a channel in the results. (Default: false)

    with_sorted_meta_array

    boolean

    Determines whether to include the sorted_metaarray property in the response. (Default: false)

    include_parent_message_text

    boolean

    (Deprecated) Determines whether to include the text of parent messages as the parent_message_text property in the results. This property can be used to simultaneously display the content of parent messages and their thread of replies. (Default: false)


    Response

    If the parent_message_id and message_ts are specified and the request is successful, this action returns a list of message resources containing a parent message and its replies in the response body.

    {
        "messages": [
            {
                "message_id": 1954,
                "type": "MESG",
                "is_silent": false,
                "custom_type": "sports",
                "channel_url": "uefa_footballgroup_g_001",
                "user": {
                    "user_id": "katherine456",
                    "nickname": "Katherine",
                    "profile_url": "",
                    "metadata": {}
                },
                "mention_type": "users",
                "mentioned_users": [],
                "is_removed": false,
                "message": "What time does the game start?",
                "translations": {},
                "data": "{\"font\":\"arial\"}",
                "created_at": 1590785393908,
                "updated_at": 0,
                "file": {},
                "message_survival_seconds": -1
            },
            {
                "message_id": 1955,
                "type": "MESG",
                "parent_message_id": 1954,
                "is_silent": false,
                "custom_type": "Sports",
                "channel_url": "uefa_footballgroup_g_001",
                "user": {
                    "user_id": "jeff789",
                    "nickname": "Jeff",
                    "profile_url": "",
                    "metadata": {}
                },
                "mention_type": "users",
                "mentioned_users": [],
                "message": "At 1pm",
                "translations": {},
                "data": "{\"font\":\"arial\"}",
                "created_at": 1590785393962,
                "updated_at": 0,
                "file": {},
                "message_survival_seconds": -1
            }
        ]
    }
    

    In the case of an error, an error object is returned. A detailed list of error codes is available here.