Help Center> SparkRTC> API Reference> Examples> Automatic recording configuration> Updating the Automatic Recording Configuration
Updated on 2022-10-08 GMT+08:00

Updating the Automatic Recording Configuration

Function

This API is used to update the automatic recording configuration. Tenants can enable or disable automatic single-stream recording on demands.

Constraints

After the automatic recording function is enabled, it takes effect only for newly created rooms and does not take effect for rooms that have been created before the automatic recording function is enabled.

The stream name of a single-stream automatic recording job is as follows:

{appid}_{roomid}_{userid}_{media_type}_{video_type}

The value of {media_type} can be v (video recording) or av (audio and video recording).

The value of {video_type} can be m (recording video streams) or a (recording presentation streams).

The possible combination can be _av_m (automatic recording of video and audio) ord _v_a (automatic recording of presentation video without audio).

URI

PUT /v2/apps/{app_id}/auto-record-mode

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

app_id

Yes

String

Application ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

Content type.

X-Auth-Token

No

String

User token. This parameter is mandatory when token authentication is used. It can be obtained by calling the IAM API that is used for obtaining a user token. The value of X-Subject-Token in the response header is the user token.

Authorization

No

String

Authentication information. This parameter is mandatory when AK/SK-based authentication is used.

X-Sdk-Date

No

String

Time when the request is sent. This parameter is mandatory when AK/SK-based authentication is used.

X-Project-Id

No

String

Project ID. This parameter is mandatory when AK/SK-based authentication is used.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

mode

Yes

String

Recording mode.

  • AUTO_RECORD_OFF: Automatic recording is disabled.

  • AUTO_INDIVIDUAL_RECORD: Enable single-stream automatic recording. In this case, record_rule_id must be not empty.

record_rule_id

No

String

Recording rule ID.

Response Parameters

Status code: 200

Table 4 Response header parameters

Parameter

Type

Description

X-request-Id

String

Request ID for task tracing.

Table 5 Response body parameters

Parameter

Type

Description

app_id

String

Application ID.

auto_record_mode

AppAutoRecordMode object

Automatic recording configuration.

Table 6 AppAutoRecordMode

Parameter

Type

Description

mode

String

Recording mode.

  • AUTO_RECORD_OFF: Automatic recording is disabled.

  • AUTO_INDIVIDUAL_RECORD: Automatic recording is enabled for single streams. In this case, record_rule_id must not be left empty.

record_rule_id

String

Recording rule ID.

update_time

String

Update time, for example, 2006-01-02T15:04:05.075Z. The time zone is UTC.

Status code: 400

Table 7 Response header parameters

Parameter

Type

Description

X-request-Id

String

Request ID for task tracing.

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Description.

Status code: 404

Table 9 Response header parameters

Parameter

Type

Description

X-request-Id

String

Request ID for task tracing.

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Description.

Status code: 500

Table 11 Response header parameters

Parameter

Type

Description

X-request-Id

String

Request ID for task tracing.

Table 12 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Description.

Example Requests

PUT https://rtc-api.myhuaweicloud.com/v2/apps/{app_id}/auto-record-mode

{
  "mode" : "AUTO_RECORD_OFF"
}

Example Responses

Status code: 200

The job is created, and the application summary information is returned, including app_id.

{
  "app_id" : "123456789abcdefghijklmno",
  "auto_record_mode" : {
    "mode" : "AUTO_RECORD_OFF",
    "update_time" : "2020-07-26T07:53:05.075Z"
  }
}

Status code: 400

Failed to update the automatic recording job because the request cannot be understood by the server or parameters are incorrect.

{
  "error_code" : "RTC.00001003",
  "error_msg" : "InvalidParameterValue"
}

Status code: 404

Failed to update the automatic recording job because the application does not exist.

{
  "error_code" : "RTC.00001003",
  "error_msg" : "InvalidParameterValue"
}

Status code: 500

Failed to update the automatic recording job due to server error.

{
  "error_code" : "RTC.00002xxx",
  "error_msg" : "InternalError"
}

Status Codes

Status Code

Description

200

The job is created, and the application summary information is returned, including app_id.

400

Failed to update the automatic recording job because the request cannot be understood by the server or parameters are incorrect.

404

Failed to update the automatic recording job because the application does not exist.

500

Failed to update the automatic recording job due to server error.

Error Codes

See Error Codes.