Mute or unmute streaming
Use this method to mute or unmute the current streaming.
Prototype
- Method:
POST
- Endpoint:
https://api.sd-rtn.com/:region/:version/projects/:appId/rtls/ingress/online-streams/mute/:sid
Request parameters
Authentication
-
HTTP Basic Authentication
Every time you send an HTTP request, you must pass in a credential in the
Authorization
field in the HTTP request header. See RESTful Authentication on how to generate it.Basic authentication is a simple authentication scheme built into the HTTP protocol. To use it, send your HTTP requests with an
Authorization
header that contains the word Basic followed by a space and a base64-encoded stringusername:password
.Example:
Authorization: Basic ZGVtbzpwQDU1dzByZA==
-
HTTP HMAC Authentication
Every time you send an HTTP request, you must pass in an API key in the
Authorization
field in the HTTP request header. See RESTful Authentication on how to generate it.Example:
Authorization: 123
Path parameters
Parameter | Data type | Required/Optional | Description |
---|---|---|---|
region | String | Required | Create an area for pushing the streaming key. Agora supports creation of stream keys by region. Currently, the following regions are supported:
Important Make sure that:
|
version | String | Required | The API version. Use v1 . |
appId | String | Required | The app ID provided by Agora to each developer. After creating a project in Agora Console, you can get an app ID. The app ID is a unique identifier for a project. |
sid | String | Required | The streaming session ID is the unique identifier for each initiated streaming task. It can be obtained by querying the streaming list or receiving the payload of the message notification callback. |
Headers
Header | Data type | Description |
---|---|---|
X-Request-ID | String | The UUID (Universally Unique Identifier) of the request. After passing in this field, the Agora server will return this field in the response header. It is recommended to assign X-Request-ID a value. If no value is assigned, the Agora server will automatically generate a UUID and pass it in. |
Request body
The request body consists of a JSON Object type settings
and includes the following fields:
Parameter | Data type | Required/Optional | Description |
---|---|---|---|
videoMuted | boolean | Required | Whether to mute the video stream:
|
audioMuted | boolean | Required | Whether to mute the audio stream:
|
Request example
Response parameters
Headers
Header | Data type | Description |
---|---|---|
X-Request-ID | String | The UUID (Universally Unique Identifier) of the request. The value is in its X-Request-ID header. If a request error occurs, print the value in the log to troubleshoot the problem. A 401 (Unauthorized) response status code means that there is no such field in the response header. |
Response body
For details about possible response status codes, see Response status codes.
If the status code is not 200
, the request fails. See the message
field in the response body for the reason for this failure.
If the status code is 200
, the request succeeds, and the response body includes the following parameters:
Parameter | Type | Description |
---|---|---|
status | String | The status of this request. success means the request succeeds. |
-
The successful execution of this request only confirms that the command is sent to the gateway node handling the stream; it does not guarantee that the mute/unmute operation was successful. The operation is executed asynchronously in the background.
-
Typically, the mute/unmute action takes effect within approximately one second. If the operation does not work as expected, retry the API call.
-
By default, each stream starts unmuted (audio and video are published normally). Each API call applies to the current stream. If the streamer disconnects and restarts the stream, the new stream resets to the initial unmuted state.
Response example
The following is a response example for a successful request:
To explore the RESTful API parameters, obtain sample code in various client languages, or test Media Gateway requests, refer to the Postman API reference.