@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}} ### Create a channel # @name createChannel POST {{channelsURL}}/channels Content-Type: application/json Authorization: Bearer {{authToken}} { "resource": { "name": "My channel", "icon": "twake logo", "description": "This channel allow twake's team to chat easily", "channel_group": "twake", "visibility": "public", "is_default": true, "archived": false } } ### Get a single channel @getId = {{createChannel.response.body.resource.id}} GET {{channelsURL}}/channels/{{getId}} Authorization: Bearer {{authToken}} ### Add current user as member to a channel (join channel) POST {{channelsURL}}/channels/{{getId}}/members Content-Type: application/json Authorization: Bearer {{authToken}} { "resource": { "user_id": "{{currentUserId}}" } } ### Mark the channel as read/unread POST {{channelsURL}}/channels/{{getId}}/read Content-Type: application/json Authorization: Bearer {{authToken}} { "value": true }