mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Updated API Code Samples (#24141)
* api: remove PHP code samples * api: remove Curl code samples * api: remove Go code samples * link out to marketplace exclusively for community-built drivers * absolute path to V4_SRC * programmatically extract x-codeSamples * initial batch of examples * Update api/server/main.go Co-authored-by: Alejandro García Montoro <alejandro.garciamontoro@gmail.com> * Update api/server/main.go Co-authored-by: Alejandro García Montoro <alejandro.garciamontoro@gmail.com> * Update api/server/main.go Co-authored-by: Alejandro García Montoro <alejandro.garciamontoro@gmail.com> * updated examples --------- Co-authored-by: Alejandro García Montoro <alejandro.garciamontoro@gmail.com>
This commit is contained in:
@@ -45,23 +45,6 @@
|
||||
$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:
|
||||
@@ -97,20 +80,3 @@
|
||||
$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'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user