You need to enable JavaScript to run this app.
导航

添加或更新推拉流鉴权

最近更新时间2023.10.23 16:13:59

首次发布时间2023.09.25 14:32:22

添加或更新推拉流鉴权信息。更新时,会对所有的鉴权参数做全量覆盖更新

注意事项

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

请求说明

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

请求参数

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

Query

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

Body

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

Vhost

String

live.push.example.com

域名空间名称。

说明

参数 DomainVhost 传且仅传一个。

Domain

String

live.push.example.com

推/拉流域名。

说明

参数 DomainVhost 传且仅传一个。

AppStringlive应用名称,默认为所有应用名称,由 1 到 30 位数字、字母、下划线及"-"和"."组成。

SceneType

String

push

鉴权场景类型。

  • push:推流鉴权;
  • pull:拉流鉴权;
AuthDetailListArray of AuthDetailList-鉴权详情,数量阈值为 100。
ValidDurationInteger60有效时长,单位为 s,默认值为 604800,取值范围为 [60,2592000]。

PushPullEnable

Boolean

true

鉴权状态。创建推拉流鉴权时,默认值为 false;更新推拉流鉴权时,缺省情况表示不修改推拉流鉴权状态。

  • false:关闭推拉流鉴权;
  • true:开启推拉流鉴权。

AuthDetailList

参数类型是否必选示例值描述
SecretKeyString1*****1自定义鉴权密钥。支持数字和大小写字母,最大长度 100 个字符。
EncryptionAlgorithmStringmd5对称加密算法,仅支持 md5、md5_custom。

AuthField

JSON Map

{ "volcSecret":"sign", "volcTime":"expire" }

该参数在推/拉流鉴权时生效,表示自定义推拉流地址中,鉴权参数 volcSecret 和 volcTime 的名称。缺省情况下表示:

{
		"volcSecret":"volcSecret",
  	"volcTime":"volcTime"
}

您可以自定义参数名,例如,

{
		"volcSecret":"sign",
  	"volcTime":"expire"
}

EncryptField

Array of String

["key","volcTime","Domain"]

该参数在推/拉流鉴权时生效,表示加密字段。使用不同的对称加密算法 EncryptionAlgorithm,加密字段存在差异。

  • 当使用 md5 时:默认加密字段为 ["AppName","StreamName","key","expireTime"],且不支持修改;
  • 当使用 md5_custom 时:默认无加密字段,但推荐至少包含 keyvolcTime。同时您还可以自定义 DomainAppNameStreamName 等字段。 例如,选择 key、volcTime 和 Domain 作为加密字段,则取值为 ["key","volcTime","Domain"]

返回参数

本接口无特有的返回参数。更多信息请见返回结构

示例

请求示例

POST https://live.volcengineapi.com?Action=UpdateAuthKey&Version=2023-01-01
{
  "Vhost": "live.example.net",
  "App": "test",
  "SceneType": "push",
  "AuthDetailList": [
    {
      "EncryptionAlgorithm": "md5",
      "SecretKey": "1*****1",
      "AuthField": {
        "volcSecret": "sign",
        "volcTime": "expire"
      }
    }
  ],
  "ValidDuration": 100,
  "PushPullEnable": true
}

返回示例

{
  "ResponseMetadata": {
    "RequestId": "201806041104200100100232280022D30",
    "Action": "UpdateAuthKey",
    "Version": "2023-01-01",
    "Service": "live",
    "Region": "cn-north-1"
  }
}

错误码

下表仅列出本接口特有的错误码。更多信息请参见公共错误码获取详细信息。

状态码错误码错误信息说明
200CommonErr-未分类错误。建议重试,如果仍返回该错误码,请联系技术支持
400InvalidParam-输入的参数无效或不符合要求,请参照请求参数说明进行检查。
400InvalidParam.BindErrorRequest parameter error, please check input data参数未通过校验,请检查参数类型是否正确。
400InvalidParam.Length%s should not be longer than %d参数长度错误,请检查错误消息中指定参数的长度是否超过限制。
403RequestForbidden-请求被拒绝,当前账号下无请求的资源(域名空间、域名、应用、配置模版、证书)。
403RequestForbidden.AccountIDNotAllowthis AccountID does not have permission to access the corresponding resource, please check the request parameters请求被拒绝,当前账号下无请求的资源(域名空间、域名、应用、配置模版、证书)。
403RequestForbidden.BillingStatusBilling status is not available for the AccountID, please activate the service or recharge.未开通视频直播服务或账号欠费,造成账单不可用,请检查服务开通情况和账号欠费情况。
404ResourceNotFound-未找到资源(域名空间、域名、应用、配置模版、证书)。建议重试,如果仍返回该错误码,请联系技术支持
404ResourceNotFound.VhostNotExistvhost not found未找到域名空间(Vhost)。请检查传入的域名空间是否与实际使用的域名空间一致。
500InternalErroran internal error occurred, please contact the administrator.出现内部错误,请联系技术支持
500InternalError.DBan internal error related to database occurred, please contact the administrator.出现与数据库相关的内部错误,请联系技术支持
502InternalServiceErroran internal error occurred, please contact the administrator.服务间出现错误,请联系技术支持
502InternalServiceError.BadResponsean internal error occurred, please contact the administrator.服务间出现错误,请联系技术支持
504InternalServiceTimeoutInternal Service is timeout. please contact the administrator.内部服务超时,请联系技术支持