Skip to content

[Conversation] Messages

  • Endpoint Path: /api/v2/conversation/{conversationId}/messages
  • Method: GET
  • Request: Rest + Query

Headers Optional Parameter

Parameter NamePublic Mode (Required)Private Mode (Required)
X-Fresns-Aidrequiredrequired
X-Fresns-Aid-Tokenrequiredrequired
X-Fresns-Uidrequiredrequired
X-Fresns-Uid-Tokenrequiredrequired

Rest Params

Parameter NameTypeRequiredDescription
conversationIdNumberrequiredConversation ID

Query Params

Parameter NameTypeRequiredDescription
orderDirectionStringoptionalSort by direction, default desc
asc,desc
pageListDirectionStringoptionalDirection of array sorting in each page list, default latest
latest,oldest
whitelistKeysStringoptionalWhitelist key names, only returns key-value pairs for the given key names
Multiple separated by English commas, supports "dot notation" for multi-dimensional arrays
Valid only for the user parameter
blacklistKeysStringoptionalBlacklist key names, removes specified key-value pairs from the returned data
Multiple separated by English commas, supports "dot notation" for multi-dimensional arrays
Valid only for the user parameter
pageSizeNumberoptionalNumber of items per page (default 15 items)
pageNumberoptionalPage number (default 1)

Return

json
{
    "code": 0,
    "message": "ok",
    "data": {
        "pagination": {
            "total": "Number / How much data in total",
            "pageSize": "Number / How much data on each page",
            "currentPage": "Number / Current page number",
            "lastPage": "Number / Last page number"
        },
        "list": [
            {
                "id": "Number / Message ID",
                "user": {
                    // Sender's user information, empty if the user has been deactivated.
                    // Common Data Structure -> User Info
                },
                "isMe": "Boolean / Whether sent by myself",
                "type": "Number / 1. Text message 2. File message",
                "content": "String / Message content",
                "file": {
                    // File message specific
                    // Common Data Structure -> File Info
                },
                "datetime": "String / Sent time",
                "datetimeFormat": "String / Formatted sent time",
                "timeAgo": "String / Humanization time",
                "readStatus": "Boolean / Read status"
            }
        ]
    }
}

Released under the Apache-2.0 License