Move API Reference (#23777)
* merge mattermost-api-reference unchanged * api: update repostiory paths * api: drop GitPod for api (for now) * api: improved node_modules target * api: relocate GitHub actions to root * Update .github/workflows/api.yml Co-authored-by: Antonis Stamatiou <stamatiou.antonis@gmail.com> * fix cache-dependency-path * adopt node-version-file * pin versions for uses * tidy steps/runs * api/.gitpod.yml: tidy * api: rm now unused .gitlab-ci.yml --------- Co-authored-by: Antonis Stamatiou <stamatiou.antonis@gmail.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
3f99b7618d
Коммит
d9614cbb12
116
api/v4/source/sharedchannels.yaml
Обычный файл
116
api/v4/source/sharedchannels.yaml
Обычный файл
@@ -0,0 +1,116 @@
|
||||
"/api/v4/sharedchannels/{team_id}":
|
||||
get:
|
||||
tags:
|
||||
- shared channels
|
||||
summary: Get all shared channels for team.
|
||||
description: |
|
||||
Get all shared channels for a team.
|
||||
|
||||
__Minimum server version__: 5.50
|
||||
|
||||
##### Permissions
|
||||
Must be authenticated.
|
||||
operationId: GetAllSharedChannels
|
||||
parameters:
|
||||
- name: team_id
|
||||
in: path
|
||||
description: Team Id
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
- name: page
|
||||
description: The page to select.
|
||||
in: query
|
||||
schema:
|
||||
type: integer
|
||||
default: 0
|
||||
- name: per_page
|
||||
description: The number of sharedchannels per page.
|
||||
in: query
|
||||
schema:
|
||||
type: integer
|
||||
default: 0
|
||||
responses:
|
||||
"200":
|
||||
description: Shared channels fetch successful. Result may be empty.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/SharedChannel"
|
||||
"400":
|
||||
$ref: "#/components/responses/BadRequest"
|
||||
"401":
|
||||
$ref: "#/components/responses/Unauthorized"
|
||||
"403":
|
||||
$ref: "#/components/responses/Forbidden"
|
||||
x-code-samples:
|
||||
- lang: Go
|
||||
source: |
|
||||
import "github.com/mattermost/mattermost-server/v5/model"
|
||||
|
||||
Client := model.NewAPIv4Client("https://your-mattermost-url.com")
|
||||
Client.Login("email@domain.com", "Password1")
|
||||
|
||||
teamID := "4xp9fdt77pncbef59f4k1qe83o"
|
||||
|
||||
shared_channels, err := Client.GetAllSharedChannels(teamID, 0, 100)
|
||||
- lang: curl
|
||||
source: |
|
||||
curl -X POST \
|
||||
'http://your-mattermost-url.com/api/v4/sharedchannels/4xp9fdt77pncbef59f4k1qe83o' \
|
||||
-H 'Authorization: Bearer kno8tcdotpbx3dj1gzcbx9jrqy'
|
||||
|
||||
"/api/v4/sharedchannels/remote_info/{remote_id}":
|
||||
get:
|
||||
tags:
|
||||
- shared channels
|
||||
summary: Get remote cluster info by ID for user.
|
||||
description: |
|
||||
Get remote cluster info based on remoteId.
|
||||
|
||||
__Minimum server version__: 5.50
|
||||
|
||||
##### Permissions
|
||||
Must be authenticated and user must belong to at least one channel shared with the remote cluster.
|
||||
operationId: GetRemoteClusterInfo
|
||||
parameters:
|
||||
- name: remote_id
|
||||
in: path
|
||||
description: Remote Cluster GUID
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
description: Remote cluster info retrieval successful
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/RemoteClusterInfo"
|
||||
"400":
|
||||
$ref: "#/components/responses/BadRequest"
|
||||
"401":
|
||||
$ref: "#/components/responses/Unauthorized"
|
||||
"403":
|
||||
$ref: "#/components/responses/Forbidden"
|
||||
"404":
|
||||
$ref: "#/components/responses/NotFound"
|
||||
x-code-samples:
|
||||
- lang: Go
|
||||
source: |
|
||||
import "github.com/mattermost/mattermost-server/v5/model"
|
||||
|
||||
Client := model.NewAPIv4Client("https://your-mattermost-url.com")
|
||||
Client.Login("email@domain.com", "Password1")
|
||||
|
||||
remoteID := "4xp9fdt77pncbef59f4k1qe83o"
|
||||
|
||||
info, err := Client.GetRemoteClusterInfo(remoteID)
|
||||
- lang: curl
|
||||
source: |
|
||||
curl -X POST \
|
||||
'http://your-mattermost-url.com/api/v4/sharedchannels/getremote/4xp9fdt77pncbef59f4k1qe83o' \
|
||||
-H 'Authorization: Bearer kno8tcdotpbx3dj1gzcbx9jrqy'
|
||||
|
||||
Ссылка в новой задаче
Block a user