CoWork
The CoWork Web API is an interface to access teams, channels, and messages from CoWork. It allows administration of teams and channels for users with either the Team Admin or CoWork Administration permissions.
Requests have to be sent as HTTP requests with the scheme https://[HOST]:[PORT]/api/cowork/[Command]. To access the CoWork Web API a user has to have the required permissions - which have to be set in the Users and Groups manager. All clients have to be authenticated in order to use the API.
Note: The CoWork Web API can be used only by users who have the Web API and CoWork permission set.
Features
The CoWork Web API exposes the following features:
-
Listing teams, channels, and messages a user has access to
-
Create teams if the user is a CoWork admin
-
Create channels if the user is a team admin
-
Update teams and channel information
-
Send messages and attachments to channels
-
Delete messages
Commands
The following commands are available for the CoWork Web API:
| Command | Description |
|---|---|
| Administrative Commands | |
| /admin | Access administrative context |
| /admin/teams | List of teams the admin can manage |
| /admin/teams/<teamID> | Team details |
| /admin/teams/<teamID>/channels | List of available channels in a team that the admin can manage |
| /admin/teams/<teamID>/channels/<channelID> | Channel details |
| /admin/teams/<teamID>/channels/<channelID>/botmessage | Send a bot message into the channel |
| User Commands | |
| /search | Search for messages in CoWork |
| /user | Show and update current user's status |
| /teams | List of available teams |
| /teams/directmessages | List of users's direct message channels |
| /teams/directmessages/<userID> | Details of a direct message channel |
| /teams/directmessages/<userID>/leave | Leave a direct message channel |
| /teams/<teamID> | Team details |
| /teams/<teamID>/channels | List of available channels in a team |
| /teams/<teamID>/channels/<channelID> | Channel details |
| /teams/<teamID>/channels/<channelID>/leave | Alternative handler to leave a direct message channel |
| /teams/<teamID>/channels/<channelID>/members | List of member users and their status |
| /teams/<teamID>/channels/<channelID>/messages | List messages in a channel |
| /teams/<teamID>/channels/<channelID>/messages/<messageID> | Message Details |
| /teams/<teamID>/channels/<channelID>/messages/<messageID>/attachments | List of attachments in a message |
| /teams/<teamID>/channels/<channelID>/messages/<messageID>/attachments/<attachmentsID> | Download an attachment along with its details |
Calls
The following commands are available for the CoWork Calls Web API:
| Command | Description |
|---|---|
| Team Channel Commands | |
| /teams/<teamID>/channels/<channelID>/calls | List ongoing calls in the channel |
| /teams/<teamID>/channels/<channelID>/calls/join | Join the call in a channel |
| /teams/<teamID>/channels/<channelID>/calls/leave | Leave the call in a channel |
| /teams/<teamID>/channels/<channelID>/calls/raise | Raise the hand in an ongoing call of a channel |
| /teams/<teamID>/channels/<channelID>/calls/audio | Update the muted and silenced state of a call in the channel |
| /teams/<teamID>/channels/<channelID>/calls/video | Change video of an ongoing call |
| /teams/<teamID>/channels/<channelID>/calls/reaction | Send a reaction to the call of a channel |
| User Commands | |
| /user/calls | List ongoing calls of the user |
| /user/calls/join | Join the call in the currently open channel |
| /user/calls/leave | Leave a call of the user |
| /user/calls/raise | Raise the hand in an ongoing call of the user |
| /user/calls/audio | Update the muted and silenced state of a call of the user |
| /user/calls/video | Change video of an ongoing call |
| /user/calls/reaction | Send a reaction to the call of the user |
