{{getMsg('Help_YouAreHere')}}:
/
{{page.title}}
{{page.title}}
{{$root.getMsg("downLoadHelpAsPdf")}}
{{helpModel.downloadHelpPdfDataStatus}}
Messages
Request a list of messages entries in a channel. The response is a window of at most 200 messages. Using the parameter targetMessage
it is determined where the message window is located at. The response only contains the message IDs which can be queried in a subsequent request.
GET /api/cowork/teams/<teamID>/channels/<channelID>/messages
Returns a list of messages in the channel using the following form:
[ "<ID of the message>", ... ]
RESPONSE Fields | Value Type | Description |
---|---|---|
id | String | The GUID of the message, used for details and further operations |
Parameter: targetMessage
The targetMessage
parameter determines the windowing of the message list. The following options are available:
targetMessage Value |
Description |
---|---|
empty or GUID of last message in channel | The last message in a channel as well as at most 100 messages before the last message are returned |
GUID of first message in channel | The first message in the channel, as well as at most 99 additional message that are chronologically after the first message is returned |
GUID | The message with the GUID as well as at most 100 messages that are chronologically before this message, and at most 99 messages that are chronologically after the targetMessage are returned. |
Example Request
# Request # Use user:password for authorization GET /api/cowork/teams/3n1ytbwme7ngfyn9g9guwwurt/channels/epmlsh7trr535mrs9z7xcfn1w/messages HTTP/1.1 Accept: */* Authorization: Bearer VGhpcyBpcyBqdXN0IGEgZGVtbyBhY2Nlc3MgdG9rZW4u # Response HTTP/1.1 200 OK Content-Type: application/json [ "id": "00kunwfaycw5sqp8gc8kc0jms", ... ]
POST /api/cowork/teams/<teamID>/channels/<channelID>/messages and PUT /api/cowork/teams/<teamID>/channels/<channelID>/messages
Send a new message using the following JSON. The response is the ID of the newly created message.
{ "text": "<The text to send to the channel>", "attachments": [ <attachment descriptions> ], }
REQUEST Fields | Value Type | Description |
---|---|---|
text | String | The optional text message to send to the channel |
attachments | String | Optional list of attachments to send along with the message |
Note: Either the text
or attachments
field have to filled.
Example Request
# Request # Use user:password for authorization POST /api/cowork/teams/3n1ytbwme7ngfyn9g9guwwurt/channels/3y8kdto0lnx3ig3mshwvrb9x7/messages HTTP/1.1 Accept: */* Authorization: Bearer VGhpcyBpcyBqdXN0IGEgZGVtbyBhY2Nlc3MgdG9rZW4u {"text":"Hey there."} # Response HTTP/1.1 200 OK Content-Type: application/json "00kunwfaycw5sqp8gc8kc0jms"