{{getMsg('Help_YouAreHere')}}:
/
{{page.title}}
{{page.title}}
{{$root.getMsg("downLoadHelpAsPdf")}}
{{helpModel.downloadHelpPdfDataStatus}}
Bot-Message
A Bot-Message can only be send by administrative team users. They can not, however, read messages in channels due to the privacy concept. Bot-Messages can be used to inform users in all channels about important events, such as a server reboot.
POST /api/cowork/admin/admin/teams/<teamID>/channels/<channelID>/botmessage and PUT /api/cowork/admin/teams/<teamID>/channels/<channelID>/botmessage
Send a message to the given team using the Bot user and 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. See Attachment Description |
Note: Either the text
or attachments
field have to filled.
Example Request
# Request # Use user:password for authorization POST /api/cowork/admin/teams/3n1ytbwme7ngfyn9g9guwwurt/channels/3y8kdto0lnx3ig3mshwvrb9x7/botmessage HTTP/1.1 Accept: */* Authorization: Bearer VGhpcyBpcyBqdXN0IGEgZGVtbyBhY2Nlc3MgdG9rZW4u {"text":"Hey there."} # Response HTTP/1.1 200 OK Content-Type: application/json "00kunwfaycw5sqp8gc8kc0jms"
# cURL example curl --request POST \ --url https://127.0.0.1:9000/api/cowork/admin/teams/3n1ytbwme7ngfyn9g9guwwurt/channels/3y8kdto0lnx3ig3mshwvrb9x7/botmessage \ --header 'Authorization: Bearer <access_token>' \ --header 'Content-Type: multipart/form-data' \ --form 'json={"text":"Hi there","attachments":[{"name":"first image.jpg","lastModified":1680774451041,"attachmentType":"Unknown","previewWidth":100,"previewHeight":100},{"name":"second image.jpg","lastModified":1680774451041,"attachmentType":"Unknown","previewWidth":100,"previewHeight":100}]}' \ --form attachment0=@/Users/dev/Downloads/image1.jpg \ --form attachment1=@/Users/dev/Downloads/image2.jpg