Files
workavia-drive/tdrive/backend/node/test/http/tabs.http
T
Montassar Ghanmy e0615fa867 📁 Changed TDrive root folder (#16)
📁 Changed TDrive root folder
2023-04-11 10:04:29 +01:00

85 lines
2.0 KiB
HTTP

@company_id = bcfe2f79-8e81-42a3-b551-3a32d49b2b4c
@workspace_id = 3328552c-5ccd-4172-b84a-d876d56aa71a
@baseURL = http://localhost:3000
@tabsURL = {{baseURL}}/internal/services/channels/v1/companies/{{company_id}}/workspaces/{{workspace_id}}/channels
@channelsURL = {{baseURL}}/internal/services/channels/v1/companies/{{company_id}}/workspaces/{{workspace_id}}
# @name login
GET {{baseURL}}/api/auth/login
@authToken = {{login.response.body.token}}
@currentUserId = {{login.response.body.user.id}}
### List channel's tab with all websockets
GET {{tabsURL}}/{{channelId}}/tabs?websockets=true&limit=5
Content-Type: application/json
Authorization: Bearer {{authToken}}
### Create a channel
# @name createChannel
POST {{channelsURL}}/channels
Content-Type: application/json
Authorization: Bearer {{authToken}}
{
"resource": {
"name": "My channel",
"icon": "tdrive logo",
"description": "This channel allow tdrive's team to chat easily",
"channel_group": "tdrive",
"visibility": "public",
"is_default": true,
"archived": false
}
}
### Create a tab
# @name createTab
@channelId = {{createChannel.response.body.resource.id}}
POST {{tabsURL}}/{{channelId}}/tabs
Content-Type: application/json
Authorization: Bearer {{authToken}}
{
"resource": {
// WARNING : special caracter in tab's name does not work
"name": "My tabs name",
"configuration": "JSON"
}
}
### Get a single tab
@getId = {{createTab.response.body.resource.id}}
GET {{tabsURL}}/{{channelId}}/tabs/{{getId}}
Authorization: Bearer {{authToken}}
### Update a tab
@updateId = {{createTab.response.body.resource.id}}
POST {{tabsURL}}/{{channelId}}/tabs/{{updateId}}
Content-Type: application/json
Authorization: Bearer {{authToken}}
{
"resource": {
"name": "My tab updated",
"configuration": "JSON"
}
}
### Delete a tab
@deleteId = {{createTab.response.body.resource.id}}
DELETE {{tabsURL}}/{{channelId}}/tabs/{{deleteId}}
Authorization: Bearer {{authToken}}