# DEMO示例
# 场景概述
本章节将为您演示如何使用UGC内容安全审核服务的文本、图片安全检测功能来做识别用户提交内容是否包含违规信息,如色情、广告、灌水、涉政、辱骂、暴恐等。
# 服务调用前置条件:
创建应用,获取appkey、appsecert;
获取服务调用token;
开通服务,scope授权通过;
以上步骤可参考前置准备
# 文本内容安全检测:
# 调用接口进行检测(注意authorization字段=["Bearer" +token],token为上一步获取的token);
curl -X POST "https://apigate.glodon.com/ugc/api/v1/scan/text" \
-H "authorization: Bearer XXXXXXX" \
-H "Content-Type: application/json" \
-d "{ \"text\": \"男女同同,集片,各种货,,[稀饭]。。avb▲10▲20 去掉 ▲\"}"
# 接口调用返回:
{
"code": 0,
"message": "success",
"data":{
"globalSuggestion": "block",
"dataId": "81c516ec-0227-4XXXXXXXXX",
"results":[{
"rate": 100.0,
"suggestion": "block",
"details":[{"label": "politics"}{"label": "porn"}],
"label": "porn","scene": "antispam"}],
"content": "男女同同,集片,各种货,,[稀饭]。。avb▲10▲20 去掉 ▲",
"taskId": "txt5QoM0icXXXXXXXXX"
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# 图片违规检测
# 调用接口进行检测(注意替换为自己的请求头部,authorization字段=["Bearer" +token]);
curl -X POST "https://apigate.glodon.com/ugc/api/v1/scan/image" \
-H "authorization: Bearer XXXXX" \
-H "Content-Type: application/json" \
-d "{ \"url\": \"https://img.alicdn.com/tfs/TB1k_g9l26H8KJjSspmXXb2WXXa-600-600.jpg\"}"
# 接口调用返回:
{
"code": 0,
"message": "success",
"data":{
"globalSuggestion": "pass",
"dataId": "8187b357-f6ce-4XXXXXXXXX",
"extras":{
},
"results":[{"rate": 0.015000916,
"suggestion": "pass",
"label": "normal",
"scene": "porn"},
{"rate": 100.0,
"suggestion": "pass","label": "normal",
"scene": "terrorism"}
],
"taskId": "img7kvVx5pXXXXXXXXX",
"url":"https://img.alicdn.com/tfs/TB1k_g9l26H8KJjSspmXXb2WXXa-600-600.jpg"
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# 视频违规检测(异步)
# 调用接口进行检测(注意替换为自己的请求头部,authorization字段=["Bearer" +token]);
curl -X POST "https://apigate.glodon.com/ugc/api/v1/asyncscan/video" \
-H "authorization: Bearer XXXXX" \
-H "Content-Type: application/json" \
-d "{ \"url\": \"http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4\",\"callback\":\"http://XXX.glodon.com/callback\",\"seed\":\"securitySeed\"}"
# 接口调用返回:
{
"code": 0,
"message": "success",
"data":{
"dataId": "18a52f34-5a2XXXXXXXXX",
"taskId": "vi7K894QtuHZXXXXXXXXX",
"url": "http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# 申诉
# 调用接口进行检测(注意替换为自己的请求头部,authorization字段=["Bearer" +token]);
# callback 申诉结果回调通知您的URL
# seed 该值用于回调通知请求中的签名
curl -X POST "https://apigate.glodon.com/ugc/api/v1/ugcFeedback" \
-H "authorization: Bearer XXXXX" \
-H "Content-Type: application/json" \
-d "{ \"name\": \"李四\",\"phone\":\"18611111111\",\"mail\":\"123@qq.com\",\"description\":\"xxx原因\",\"code\":\"123\",\"content\":\"123123\",\"type\":\"text\",\"callback\":\"http://172.16.1.179:18082/test\",\"seed\":\"SignSeedDemo\"}"
# 接口调用返回:
{
"code": 0,
"message": "success",
"data":{
"content": "123123",
"feedbackId": "f7bbe50a-1c3f-4c2e-ae3a-e7fa591d8f41"
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
← 前置准备 文本垃圾内容检测接口 →