Message Details

Request the details of a message in a channel. The response contains the text as well as an attachment overview. The message text can be either be formatted as HTML or returned as plain text.

GET /api/cowork/teams/<teamID>/channels/<channelID>/messages/<messageID>

Returns the message using the following form:

{
    "id":          "<ID of the message>",
    "created":     <timestamp of creation date and time>,
    "modified":    <timestamp of modification date and time>,
    "userId":      "<GUID of user who wrote the message>",
    "attachments": [
        {
            "id":         "<GUID of attachment>",
            "name":       "<Name of attachment file>",
            "properties": { <Map of attachment properties> }
        },
        ...
    ]
}
RESPONSE Fields Value Type Description
id String The GUID of the message, used for details and further operations
created Number The timestamp of the creation date and time of the message
modified Number The timestamp of the modification date and time of the message
userId String the GUID of the user who created the message
attachments List attachments List of attachment information
attachments.id String the GUID of the attachment
attachments.name String the file name of the attachment
attachments.properties Map A key / value map of additional properties

Parameter: format

The parameter format=html enables you to return the message text rendered as HTML instead of plain text including raw Markdown.

Example Request

# Request
# Use user:password for authorization
GET /api/cowork/teams/3n1ytbwme7ngfyn9g9guwwurt/channels/epmlsh7trr535mrs9z7xcfn1w/messages/00kunwmi6kgxy4j5qmft7uz0y HTTP/1.1
Accept: */*
Authorization: Bearer VGhpcyBpcyBqdXN0IGEgZGVtbyBhY2Nlc3MgdG9rZW4u
 
# Response
HTTP/1.1 200 OK
Content-Type: application/json
{
    "id": "00kunwmi6kgxy4j5qmft7uz0y",
    "text": "This is the message text",
    "created": 1634031935796,
    "modified": 1634031935796,
    "userId": "sys02qmoxwlwprnnovhrxtx7n",
    "attachments": [
        "id": "00kunwoaknjy4vca8c7cukxdo",
        "name": "what an image.gif",
        "properties" : [
        ]
    ]
}

POST /api/cowork/admin/teams/<teamID>/channels/<channelID>/messages/<messageID> and PUT /api/cowork/admin/teams/<teamID>/channels/<channelID>/messages/<messageID>

Send a message update using the following JSON. The response is a the updated message.

{
    "text": "<The text to send to the channel>",
}
REQUEST Fields Value Type Description
text String The optional text message to send to the channel

Note: Only the text field is allowed.

Note: Only the original message creator is allowed to modify the text.

Example Request

# Request
# Use user:password for authorization
POST /api/cowork/teams/3n1ytbwme7ngfyn9g9guwwurt/channels/3y8kdto0lnx3ig3mshwvrb9x7 /messages/00kunwmi6kgxy4j5qmft7uz0y HTTP/1.1
Accept: */*
Authorization: Bearer VGhpcyBpcyBqdXN0IGEgZGVtbyBhY2Nlc3MgdG9rZW4u
 
{"text":"Hey there."}
 
 
# Response
HTTP/1.1 200 OK
Content-Type: application/json
{
    "id": "00kunwfaycw5sqp8gc8kc0jms",
    "text": "Hey there",
    "created": 1634031935796,
    "modified": 1634031935796,
    "userId": "sys02qmoxwlwprnnovhrxtx7n",
    "attachments": [
        "id": "00kunwoaknjy4vca8c7cukxdo",
        "name": "what an image.gif",
        "properties" : [
        ]
    ]
}