@company_id = bcfe2f79-8e81-42a3-b551-3a32d49b2b4c @workspace_id = 3328552c-5ccd-4172-b84a-d876d56aa71b @user_id = 3328552c-5ccd-4172-b84a-d876d56aa71c @baseURL = http://localhost:3000 @channelsURL = {{baseURL}}/internal/services/channels/v1/companies/{{company_id}}/workspaces/{{workspace_id}} @directChannelsURL = {{baseURL}}/internal/services/channels/v1/companies/{{company_id}}/workspaces/direct # @name login GET {{baseURL}}/api/auth/login @authToken = {{login.response.body.token}} @currentUserId = {{login.response.body.user.id}} ### List workspace channels with all websockets GET {{channelsURL}}/channels?websockets=true&limit=5 Content-Type: application/json Authorization: Bearer {{authToken}} ### List user channels with all websockets @authToken = {{login.response.body.token}} GET {{channelsURL}}/channels?websockets=true&mine=true&limit=5 Content-Type: application/json Authorization: Bearer {{authToken}} ### Create a private channel # @name createChannel POST {{channelsURL}}/channels Content-Type: application/json Authorization: Bearer {{authToken}} { "resource": { "name": "My private channel", "icon": "twake logo", "description": "A private channel", "channel_group": "twake", "visibility": "private", "is_default": true, "archived": false } } ### Get the private channel @getId = {{createChannel.response.body.resource.id}} GET {{channelsURL}}/channels/{{getId}} Authorization: Bearer {{authToken}} ### Get members of the private channel GET {{channelsURL}}/channels/{{getId}}/members?websockets=true Content-Type: application/json Authorization: Bearer {{authToken}} ### Get current user as member GET {{channelsURL}}/channels/{{getId}}/members/{{currentUserId}} Content-Type: application/json Authorization: Bearer {{authToken}} ### Current user quits the private channel will fail because he is the only one in it DELETE {{channelsURL}}/channels/{{getId}}/members/{{currentUserId}} Content-Type: application/json Authorization: Bearer {{authToken}}