Help Center/ Meeting/ Server API Reference/ Meeting Control/ APIs/ Obtaining a Token for Establishing a WebSocket Connection
Updated on 2023-12-22 GMT+08:00

Obtaining a Token for Establishing a WebSocket Connection

Description

This API is used to obtain a temporary token for setting up a meeting control WebSocket connection.

Debugging

You can debug this API in API Explorer.

Prototype

Table 1 Prototype

Request Method

GET

Request Address

/v1/mmc/control/conferences/wsToken

Transport Protocol

HTTPS

Request Parameters

Table 2 Parameters

Parameter

Mandatory

Type

Location

Description

conferenceID

Yes

String

Query

Meeting ID.

X-Conference-Authorization

Yes

String

Header

Meeting control token, which can be obtained by calling the API for Obtaining a Meeting Control Token.

Status Codes

Table 3 Status codes

HTTP Status Code

Description

200

Operation successful.

400

Invalid parameters.

401

Authentication is not performed or fails.

403

Insufficient permissions.

500

Server exception.

Response Parameters

Table 4 Response parameters

Parameter

Type

Description

webSocketToken

String

Token for establishing a WebSocket connection (valid for one minute and valid only once).

Example Request

PUT /v1/mmc/control/conferences/wsToken?conferenceID=900825541
Connection: keep-alive
content-type: application/json
user-agent: WeLink-desktop
Host: api.meeting.huaweicloud.com
User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_191)
X-Conference-Authorization: cnr351949b429a0b74b032fc2e40977ce77a2037f0391a7a122

Example Response

HTTP/1.1 200 
Date: Wed, 18 Dec 2019 06:20:40 GMT
Content-Type: application/json;charset=UTF-8
Content-Length: 39
Connection: keep-alive
Expires: 0
Pragma: No-cache
Cache-Control: no-cache
http_proxy_id: 571b4dfceff545fae29aa14cea761079
Server: api-gateway
X-Request-Id: f78b007ec2dabf1498620131c7bc19e0

{
    "webSocketToken": "cnr6e88712f1c89a7b4e3b989596fc420fd43b45bf8ef35c1db"
}

Error Codes

If an error code starting with MMC or USG is returned when you use this API, rectify the fault by following the instructions provided in Huawei Cloud API Error Center.

Example cURL Command

curl -k -i -H 'content-type: application/json' -H 'x-conference-authorization: ******' -X GET https://api.meeting.huaweicloud.com/v1/mmc/control/conferences/wsToken?conferenceID=981530441