Skip to main content

You are viewing Agora Docs forBetaproducts and features. Switch to Docs

Set global template

This method sets a global flow configuration template, that is, the template that applies to all streaming keys under the app ID.

Prototype

  • Method: PUT
  • Endpoint: https://api.agora.io/:region/v1/projects/:appId/rtls/ingress/appconfig
Note
Before calling this API, create a flow configuration template.

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 string username: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

ParameterData typeRequired/OptionalDescription
appIdStringRequiredThe 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.
regionStringRequiredCreate an area for pushing the streaming key. Agora supports creation of stream keys by region. Currently, the following regions are supported:
  • na: North America
  • eu: Europe
  • ap: Asia, except mainland China
  • cn: Mainland China
Important
Make sure that:
  • The region value is the same as for the input source stream.
  • The domain names for setting the region parameter and streaming are the same.
  • The region value is in the lowercase.

Headers

HeaderData typeDescription
X-Request-IDStringThe 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:

ParameterData typeRequired/OptionalDescription
defaultStreamTemplateStringRequiredThe flow configuration template ID.
Note
For users of the beta version: Previously this API could also be used to set the transcoding parameters. Now it is recommended that you use the template creation API instead. If you have used this API to set transcoding, the current flow is the following:
  • If you reset defaultStreamTemplate, the transcoding previously set through this API will automatically become invalid, and the parameters in the new template will prevail.
  • If you do not reset defaultStreamTemplate, the transcoding previously set through this API will remain as the default global configuration for this app ID.

Request example


_6
curl --location -g --request PUT 'https://api.agora.io/{{region}}/v1/projects/{{appId}}/rtls/ingress/appconfig' \
_6
--data '{
_6
"settings": {
_6
"defaultStreamTemplate": "720p"
_6
}
_6
}'

Response parameters

Headers

HeaderData typeDescription
X-Request-IDStringThe 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:

ParameterTypeDescription
statusStringThe status of this request. success means the request succeeds.

Response example

The following is a response example for a successful request:


_3
{
_3
"status": "success"
_3
}

Info

To explore the RESTful API parameters, obtain sample code in various client languages, or test Media Gateway requests, refer to the Postman API reference.

vundefined