diff options
Diffstat (limited to 'model/client.go')
-rw-r--r-- | model/client.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/model/client.go b/model/client.go index e54f61347..affdb54aa 100644 --- a/model/client.go +++ b/model/client.go @@ -1898,3 +1898,14 @@ func (c *Client) SamlCertificateStatus(filename string) (map[string]interface{}, return StringInterfaceFromJson(r.Body), nil } } + +// GetWebrtcToken if Successful returns a map with a valid token, stun server and turn server with credentials to use with +// the Mattermost WebRTC service, otherwise returns an AppError. Must be authenticated user. +func (c *Client) GetWebrtcToken() (map[string]string, *AppError) { + if r, err := c.DoApiPost("/webrtc/token", ""); err != nil { + return nil, err + } else { + defer closeBody(r) + return MapFromJson(r.Body), nil + } +} |