Update template
This method updates a flow configuration template.
Prototype
- Method:
PATCH - Endpoint:
https://api.agora.io/:region/v1/projects/:appId/rtls/ingress/stream-templates/:templateId
- This interface can only be called if the flow configuration template already exists.
- Modifications to a flow configuration template will only take effect after the stream is re-pushed. Considering the synchronization delay between the gateway and the database, wait 3 minutes after calling this interface before re-pushing the stream.
Request parameters
Authentication
-
HTTP Basic Authentication
Every time you send an HTTP request, you must pass in a credential in the
Authorizationfield 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
Authorizationheader 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
Authorizationfield in the HTTP request header. See RESTful Authentication on how to generate it.Example:
Authorization: 123
Path parameters
| Parameter | Data type | Required/Optional | Description |
|---|---|---|---|
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. |
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:
|
templateId | String | Required | The flow configuration template ID. The value can only include the following characters: a-z, A-Z, 0-9, and the length cannot exceed 12 bytes. The value of the flow configuration template ID can be set according to your business use-case. For example, "720p" and "1080p" for different target resolutions, or "gameA" and "gameB"for different game use-cases. |
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 | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
transcoding | Object | Optional | Audio and video transcoding parameter configuration.
| ||||||||||||||||||||||||||||||||||||
jitterBuffer | Object | Optional | Network jitter buffer. Only takes effect when video transcoding is enabled.
|
- To ensure a successful request, do not set the required fields to
nullor leave them empty. - The parameters supported for the update are the following:
transcoding.video,transcoding.audio, andjitterBuffer. This means that, for example, if you only want to update thefpsfield oftranscoding.video, you need to pass in the entiretranscoding.videofield with the modifiedfpsfield and other fields unchanged. transcoding.video,transcoding.audio, andjitterBufferare independent of each other. If onlytranscoding.videois passed in, then only its parameters will be updated and the parameters oftranscoding.audioandjitterBufferwill not be affected.
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. |
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.