Skip to content

[Conversation] Send Message

  • Endpoint Path: /api/fresns/v1/conversation/message
  • Method: POST
  • Request: application/json

Headers Optional Parameter

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

Body Params

KeyTypeRequiredDescription
uidOrUsernameNumber / StringrequiredUser uid or username
messageStringoptionalMessage Content
fidStringoptionalFile FID

Request Description

  • Choose either message or fid to pass as a parameter, but not both or neither.
  • To send a file, first use the file upload API to upload and obtain the fid as a parameter.

Return

json
{
    "code": 0,
    "message": "ok",
    "data": {
        "cmid": "String / Message ID",
        "user": {
            // Sender's user information
            // Common Data Structure -> User Info
        },
        "isMe": "Boolean / Whether sent by myself",
        "type": "String / text or file",
        "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