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:
Jesse Hallam
2023-08-03 12:45:10 -03:00
committed by GitHub
parent 72b648cf81
commit 885802eae7
23 changed files with 847 additions and 5224 deletions

View File

@@ -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'