You need to enable JavaScript to run this app.
导航
更新观看限制配置信息
最近更新时间:2024.09.06 11:05:52首次发布时间:2024.09.06 11:05:52

您可通过此接口更新指定直播间的以下观看限制配置信息:公开、密码、白名单、自定义、手机号。

注意事项

请求频率:单用户请求频率限制为 10 次/秒

请求说明

  • 请求方式:POST
  • 请求地址:https://livesaas.volcengineapi.com/?Action=UpdateViewingRestriction&Version=2023-08-01

请求参数

下表仅列出该接口特有的请求参数和部分公共参数。更多信息详见公共参数

Query

参数类型是否必选示例值描述
ActionStringUpdateViewingRestriction接口名称。当前 API 的名称为 UpdateViewingRestriction
VersionString2023-08-01接口版本。当前 API 的版本为 2023-08-01

Body

参数类型是否必选示例值描述
ActivityIdLong1770****81234直播间 ID。您可通过调用 ListActivityAPI 接口获取 ID。

IsSubViewingRestrictionEnable

Boolean

true

是否开启次观看限制。默认值为 false。取值如下:

  • true:开启
  • false:不开启
ViewingRestrictionObject of ViewingRestriction-主观看限制的配置信息。

SubViewingRestriction

Object of ViewingRestriction

-

次观看限制的配置信息。

说明

仅在 IsSubViewingRestrictionEnable 取值为 true 时,该参数生效。

ViewingRestriction

参数类型是否必选示例值描述

ViewingAccountType

Integer

1

观看限制。取值如下:

  • 1:公开
  • 2:密码
  • 3:白名单
  • 4:自定义
  • 5:手机号

ViewingRestrictionButtonTitle

String

公开观看

观看按钮文案。长度为 1 到 12 个字符。默认为“观看限制 + 观看”,例如公开观看

说明

仅在 IsSubViewingRestrictionEnable 取值为 true 时,该参数生效。

CommentRestriction

Object of CommentRestriction

-

评论限制配置信息。

说明

仅在 ViewingAccountType 取值为 12 时,该参数生效。

PasswordViewingRestriction

Object of PasswordViewingRestriction

-

密码观看限制配置信息。

说明

仅在 ViewingAccountType 取值为 2 时,该参数生效。

WhiteListViewingRestriction

Object of WhiteListViewingRestriction

-

白名单观看限制配置信息。您可通过调用 InsertWhitelist 接口添加观众白名单。

说明

仅在 ViewingAccountType 取值为 3 时,该参数生效。

CustomViewingRestriction

Object of CustomViewingRestriction

-

自定义观看限制配置信息。

说明

仅在 ViewingAccountType 取值为 4 时或 IsAllowCustom 取值为 true 时,该参数生效。

PhoneViewingRestriction

Object of PhoneViewingRestriction

-

手机号观看限制配置信息。

说明

仅在 ViewingAccountType 取值为 5 时,该参数生效。

CommentRestriction

参数类型是否必选示例值描述

IsAllowPublic

Boolean

true

评论限制是否为公开。默认值为 false。取值如下:

  • true:公开
  • false:非公开

说明

  • 该参数取值为 true 时, 必须将 IsAllowCustom 的取值设置为 false
  • IsAllowPublicIsAllowWechatIsAllowCustom 取值必有一个为 true

IsAllowWechat

Boolean

true

评论限制是否为微信。默认值为 false。取值如下:

  • true:微信
  • false:非微信

说明

IsAllowPublicIsAllowWechatIsAllowCustom 取值必有一个为 true

IsAllowCustom

Boolean

false

评论限制是否为自定义。默认值为 false。取值如下:

  • true:自定义
  • false:非自定义

说明

  • 该参数取值为 true 时, 必须将 IsAllowPublic 的取值设置为 false
  • IsAllowPublicIsAllowWechatIsAllowCustom 取值必有一个为 true

PasswordViewingRestriction

参数类型是否必选示例值描述

Password

String

123456

观看密码。长度为 4 到 12 个字符。支持以下字符:

  • 大写字母 A - Z
  • 小写字母 a - z
  • 数字 0 - 9
PromptString欢迎观看本场直播提示文案。长度为 1 到 20 个字符。默认值为欢迎观看本场直播

WhiteListViewingRestriction

参数类型是否必选示例值描述
WelcomeTitleString欢迎观看本场直播欢迎标题。长度为 1 到 20 个字符。默认值为欢迎观看本场直播
InputPromptString请输入校验信息输入提示。长度为 1 到 20 个字符。默认值为请输入校验信息

EnableTrial

Boolean

true

是否开启试看功能。默认值为 false。取值如下:

  • true:开启
  • false:不开启

TrialTime

Integer

1

试看时间。默认值为 1。单位为分钟。取值如下:

  • 1
  • 5
  • 10
  • 15
  • 20
  • 25
  • 30

说明

仅在 EnableTrial 取值为 true 时,该参数生效。

CustomViewingRestriction

参数类型是否必选示例值描述
CustomAppStringApp A登录账号 App,即您自有账号系统的名称。
CustomUrlStringhttp://myDomain/auth登录链接,即您的自有账号系统登录页面的链接。链接需包含协议头。
ErrorRedirectUrlStringhttp://myDomain/auth?error=1错误重定向地址,即自定义鉴权校验失败后,进入的鉴权校验失败页面的地址。长度为 1 到 256 个字符。链接需包含协议头。

PhoneViewingRestriction

参数类型是否必选示例值描述
PromptString欢迎观看本场直播提示文案。默认值为欢迎观看本场直播

IsPhoneListMode

Boolean

true

是否开启白名单模式功能。默认值为 false。取值如下:

  • true:开启
  • false:不开启

说明

将参数值设置为 true 后,可调用 InsertPhoneList 接口添加白名单手机号。

EnableSMS

Boolean

false

是否开启短信提醒功能。默认值为 false。取值如下:

  • true:开启
  • false:不开启

EnableTrial

Boolean

true

是否开启试看功能。默认值为 false。取值如下:

  • true:开启
  • false:不开启

TrialTime

Integer

1

试看时间。默认值为 1。单位为分钟。取值如下:

  • 1
  • 5
  • 10
  • 15
  • 20
  • 25
  • 30

说明

仅在 EnableTrial 取值为 true 时,该参数生效。

返回参数

参数类型示例值描述
ActivityIdLong1770****81234直播间 ID。
ViewingRestrictionObject of ViewingRestriction-主观看限制的配置信息。

SubViewingRestriction

Object of ViewingRestriction

-

次观看限制的配置信息。

说明

仅在 IsSubViewingRestrictionEnable 取值为 true 时,该参数有值。

ViewingRestriction

参数类型示例值描述

ViewingAccountType

Integer

1

观看限制。取值如下:

  • 1:公开
  • 2:密码
  • 3:白名单
  • 4:自定义
  • 5:手机号

ViewingRestrictionButtonTitle

String

公开观看

观看按钮文案。

说明

仅在 IsSubViewingRestrictionEnable 取值为 true 时,该参数有值。

CommentRestriction

Object of CommentRestriction

-

评论限制配置信息。

说明

仅在 ViewingAccountType 取值为 12 时,该参数有值。

PasswordViewingRestriction

Object of PasswordViewingRestriction

-

密码观看限制配置信息。

说明

仅在 ViewingAccountType 取值为 2 时,该参数有值。

WhiteListViewingRestriction

Object of WhiteListViewingRestriction

-

白名单观看限制配置信息。

说明

仅在 ViewingAccountType 取值为 3 时,该参数有值。

CustomViewingRestriction

Object of CustomViewingRestriction

-

自定义观看限制配置信息。

说明

仅在 ViewingAccountType 取值为 4 时或 IsAllowCustom 取值为 true 时,该参数有值。

PhoneViewingRestriction

Object of PhoneViewingRestriction

-

手机号观看限制配置信息。

说明

仅在 ViewingAccountType 取值为 5 时,该参数有值。

CommentRestriction

参数类型示例值描述

IsAllowPublic

Boolean

true

评论限制是否为公开。取值如下:

  • true:公开
  • false:非公开

说明

该参数取值为 true 时, IsAllowCustom 的取值必为 false

IsAllowWechat

Boolean

true

评论限制是否为微信。取值如下:

  • true:微信
  • false:非微信

IsAllowCustom

Boolean

false

评论限制是否为自定义。取值如下:

  • true:自定义
  • false:非自定义

说明

该参数取值为 true 时, IsAllowPublic 的取值必为 false

PasswordViewingRestriction

参数类型示例值描述
PasswordString123456观看密码。
PromptString欢迎观看本场直播提示文案。

WhiteListViewingRestriction

参数类型示例值描述
WelcomeTitleString欢迎观看本场直播欢迎标题。
InputPromptString请输入校验信息输入提示。

EnableTrial

Boolean

true

是否开启试看功能。取值如下:

  • true:开启
  • false:未开启

TrialTime

Integer

1

试看时间。单位为分钟。

说明

EnableTrial 取值为 false 时,该参数取值为 0

CustomViewingRestriction

参数类型示例值描述
CustomAppStringApp A登录账号 App,即您自有账号系统的名称。
CustomUrlStringhttp://myDomain/auth登录链接,即您的自有账号系统登录页面的链接。
ErrorRedirectUrlStringhttp://myDomain/auth?error=1错误重定向地址,即自定义鉴权校验失败后,进入的鉴权校验失败页面的地址。
SecretKeyString/u/hii/:naSecret Key,用于计算校验签名(Sign值),计算方法详见回调参数

PhoneViewingRestriction

参数类型示例值描述
PromptString欢迎观看本场直播提示文案。

IsPhoneListMode

Boolean

true

是否开启白名单模式功能。取值如下:

  • true:开启
  • false:未开启

EnableTrial

Boolean

true

是否开启试看功能。取值如下:

  • true:开启
  • false:未开启

TrialTime

Integer

1

试看时间。单位为分钟。

说明

当 EnableTrial 取值为 false 时,该参数取值为 0

EnableSMS

Boolean

false

是否开启短信提醒功能。取值如下:

  • true:开启
  • false:未开启

请求示例

POST https://livesaas.volcengineapi.com/?Action=UpdateViewingRestriction&Version=2023-08-01

{
    "ActivityId": 1770****81234,
    "IsSubViewingRestrictionEnable": true,
    "ViewingRestriction": {
        "ViewingAccountType": 1,
        "ViewingRestrictionButtonTitle": "公开观看",
        "CommentRestriction": {
            "IsAllowPublic": true,
            "IsAllowWechat": true,
            "IsAllowCustom": false
        },
        "PasswordViewingRestriction": {
            "Password": "",
            "Prompt": ""
        },
        "WhitelistViewingRestriction": {
            "WelcomeTitle": "",
            "InputPrompt": "",
            "EnableTrial": false,
            "TrialTime": 0
        },
        "CustomViewingRestriction": {
            "CustomApp": "",
            "CustomUrl": "",
            "ErrorRedirectUrl": ""
        },
        "PhoneViewingRestriction": {
            "Prompt": "",
            "EnableTrial": false,
            "TrialTime": 0,
            "EnableSMS": false,
            "IsPhoneListMode": false
        }
    },
    "SubViewingRestriction": {
        "ViewingAccountType": 2,
        "ViewingRestrictionButtonTitle": "密码观看",
        "CommentRestriction": {
            "IsAllowPublic": false,
            "IsAllowWechat": true,
            "IsAllowCustom": true
        },
        "PasswordViewingRestriction": {
            "Password": "123456",
            "Prompt": "欢迎观看本场直播"
        },
        "WhitelistViewingRestriction": {
            "WelcomeTitle": "",
            "InputPrompt": "",
            "EnableTrial": false,
            "TrialTime": 0
        },
        "CustomViewingRestriction": {
            "CustomApp": "App A",
            "CustomUrl": "http://myDomain/auth",
            "ErrorRedirectUrl": "http://myDomain/auth?error=1"
        },
        "PhoneViewingRestriction": {
            "Prompt": "",
            "EnableTrial": false,
            "TrialTime": 0,
            "EnableSMS": false,
            "IsPhoneListMode": false
        }
    }
}

返回示例

{
    "ResponseMetadata": {
        "Action": "UpdateViewingRestriction",
        "Region": "cn-north-1",
        "RequestId": "202303101311****AEE6215ADC71105DF5",
        "Service": "livesaas",
        "Version": "2023-08-01",
        "SystemTime": 1685969459
    },
    "Result": {
        "ActivityId": 1770****81234,
        "ViewingRestriction": {
            "ViewingAccountType": 1,
            "ViewingRestrictionButtonTitle": "公开观看",
            "CommentRestriction": {
                "IsAllowPublic": true,
                "IsAllowWechat": true,
                "IsAllowCustom": false
            },
            "PasswordViewingRestriction": {
                "Password": "",
                "Prompt": ""
            },
            "WhitelistViewingRestriction": {
                "WelcomeTitle": "",
                "InputPrompt": "",
                "EnableTrial": false,
                "TrialTime": 0
            },
            "CustomViewingRestriction": {
                "CustomApp": "",
                "CustomUrl": "",
                "ErrorRedirectUrl": "",
                "SecretKey": ""
            },
            "PhoneViewingRestriction": {
                "Prompt": "",
                "EnableTrial": false,
                "TrialTime": 0,
                "EnableSMS": false,
                "IsPhoneListMode": false
            }
        },
        "SubViewingRestriction": {
            "ViewingAccountType": 2,
            "ViewingRestrictionButtonTitle": "密码观看",
            "CommentRestriction": {
                "IsAllowPublic": false,
                "IsAllowWechat": true,
                "IsAllowCustom": true
            },
            "PasswordViewingRestriction": {
                "Password": "123456",
                "Prompt": "欢迎观看本场直播"
            },
            "WhitelistViewingRestriction": {
                "WelcomeTitle": "",
                "InputPrompt": "",
                "EnableTrial": false,
                "TrialTime": 0
            },
            "CustomViewingRestriction": {
                "CustomApp": "App A",
                "CustomUrl": "http://myDomain/auth",
                "ErrorRedirectUrl": "http://myDomain/auth?error=1",
                "SecretKey": "/u/hii/:na"
            },
            "PhoneViewingRestriction": {
                "Prompt": "",
                "EnableTrial": false,
                "TrialTime": 0,
                "EnableSMS": false,
                "IsPhoneListMode": false
            }
        }
    }
}

错误码

访问公共错误码错误码获取详细信息。