更新时间:2023-12-18 GMT+08:00
分享

上传图片

描述

该接口用户上传网络研讨会高级设置用的图片。图片可用于网络研讨会的欢迎界面和企业Logo。

调试

您可以在API Explorer中调试该接口。

接口原型

表1 接口原型

请求方法

PUT

请求地址

/v1/wss/webinar/open/res/file

传输协议

HTTPS

请求参数

表2 参数说明

参数

是否必须

类型

位置

描述

X-Access-Token

String

Header

授权令牌。获取“执行App ID鉴权”响应的accessToken。

X-Request-Id

String

Header

请求requestId,用来标识一路请求,用于问题跟踪定位,建议使用UUID,若不携带,则后台自动生成。

Accept-Language

String

Header

语言参数,默认为中文zh-CN,英文为en-US。

Content-Type

String

Header

Body的媒体格式。取值为multipart/form-data。

file

File

formData

需要上传的图片文件。

状态码

表3 状态码说明

HTTP状态码

描述

200

操作成功。

400

参数异常。

401

未鉴权或鉴权失败。

403

权限受限。

500

服务端异常。

响应参数

表4 响应参数

参数

类型

描述

fileId

String

文件Id。

imageModeration

ImageModerationResult object

图片审核结果。

表5 ImageModerationResult数据结构

参数

类型

描述

suggestion

String

审核情况。

category_suggestions

category_suggestions object

各项内容的审核结果。

表6 category_suggestions数据结构

参数

类型

描述

politics

String

政治内容审核结果。

terrorism

String

暴恐内容审核结果。

porn

String

色情内容审核结果。

请求消息示例

PUT /v1/wss/webinar/open/res/file HTTP/1.1
Host: 251ba26eef46472d97fa4462d514b044.APIG.cn-north-7.huaweicloudapis.com
User-Agent: APIGatewayDebugClient/1.0
Accept: */*
Content-Type: multipart/form-data
X-Access-Token: cnr1519y4i5r5ikKZYTGqR5b2ybEJORGdm3EcPzU
X-APIG-Mode: debug

{
    "file":[binary]
}

响应消息示例

HTTP/1.1 200 OK
Transfer-Encoding: chunked
Cache-Control: no-cache
Connection: keep-alive
Content-Security-Policy: connect-src 'self' *.huaweicloud.com ;style-src 'self' 'unsafe-inline' 'unsafe-eval';object-src 'self'; font-src 'self' data:;
Content-Type: application/json; charset=UTF-8
Date: Mon, 17 May 2021 08:45:41 GMT
Pragma: no-cache
Server: api-gateway
Strict-Transport-Security: max-age=16070400; includeSubDomains
X-APIG-Latency: 85
X-APIG-Ratelimit-Api: remain:99,limit:100,time:1 minute
X-APIG-Ratelimit-Api-Allenv: remain:199,limit:200,time:1 second
X-APIG-Upstream-Latency: 84
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Envoy-Upstream-Service-Time: 59
X-Frame-Options: SAMEORIGIN
X-Request-Id: 48e47dc2e65e3bf85e00a60e2cba5ce7
X-Xss-Protection: 1;mode=block

{
    "fileId": "61B5D9E1DE8D411F98630AD018370C54",
    "imageModeration": {
        "suggestion": "pass",
        "category_suggestions": {
            "politics": "pass",
            "terrorism": "pass",
            "porn": "pass"
        }
    }
}

错误码

当您使用华为云会议服务端API时,如果遇到“WSS”开头的错误码,请参考华为云API错误中心

CURL命令示例

curl -k -i -X PUT -H 'X-Access-Token:cnr1519y4i5r5ikKZYTGqR5b2ybEJORGdm3EcPzU' -F 'file=@"/usr/pic/logo/default.png"' https://api.meeting.huaweicloud.com/v1/wss/webinar/open/res/file

分享:

    相关文档

    相关产品