tag推送

更新时间:2024-04-01 19:14:57

适用产品

内容管理

接口描述

针对客户下有开启tag开关的域名内的有标识的tag的文件进行推送。

调用频率

单用户调用频率:30/5min

推荐使用 Open API在线调试

Open API在线调试功能提供可视化界面在线调试API、支持生成代码示例、快速检索查看API文档等能力。前往调试

请求参数

Body 参数

参数名称描述
*tagString
tag的值: 1.多个tag值有,隔开,最大允许30个值 2.每个tag值最大长度为128字符 3.不允许特殊字符,特殊字符是指:中文,空格符及*''(),:;<=>?@[]{}<>
actionString
刷新动作 1、不填的话默认是删除 2、0代表删除;1代表过期

返回参数

Body 参数

参数名称描述
CodeString
表示任务创建结果的状态码
MessageString
表示任务提交后,系统的响应消息
itemIdString
调用一次接口并提交任务成功后,将返回一个iteamId,是当次提交任务的唯一标识,通过itemId可批量查询任务的状态(成功/失败)。

错误码

错误代码(code)描述(message)HTTP状态码语义
Successhandle success200任务提交成功
ParseParameterErrorparse parameter json error400json解析出错
UserNameInvalidThe userName is empty or not enabled or non-primary400用户名为空或用户未启用或者非主账号
ActionInvalidaction must be 0 or 1400操作类型必须0或者1
TagIsEmptytag can not empty400tag不能为空
SingleTagLengthLessThan128a single tag cannot exceed 128 characters400单个tag长度不能超过128字符
TagCountLessThan30the number of tags cannot exceed 30400tag的数量不能超过30个
TagValueIsIllegalthe tag value cannot contain special characters or Chinese400tag值不能包含特殊字符或者中文
ExceedDailyLimitthe user[userName] daily purge tags exceeds the limit[count]400用户[用户名]每日推送tag数超过上限[2000]
ExceedDailyLimitthe user[userName] daily purge tags exceeds the limit[count]400若传入的头部带时区,那么提示包含对应时区的时间区间,例如 the number of url regular out of 2018-10-17 01:00:00GMT+09:00~2018-10-18 00:59:59GMT+09:00 limit(500)
NotEnableTagPurgethe user[userName] does not enable any channel tag purge400用户[用户名]没有开启任何频道tag推送
NotFindAppgGroupthe user[userName] does not find any application group400用户[用户名]未找到tag推送对应的应用服务组
SystemExceptionsystem exception500系统内部异常

示例

JSON
JSON
请求示例
复制代码 复制成功
#!/bin/bash
username="username_exmaple"
apiKey="apiKey_exmaple"
date=`env LANG="en_US.UTF-8" date -u "+%a, %d %b %Y %H:%M:%S GMT"`
password=`echo -en "$date" | openssl dgst -sha1 -hmac $apiKey -binary | openssl enc -base64`
curl -i --url "https://open.chinanetcenter.com/api/content/tag/purge" \
-X "POST" \
-u "$username:$password" \
-H "Date:$date" \
-H "Content-Type: application/json" \
-d'{
          "tag": "abc,edf,wcs",
          "action": "0"
}'
返回示例
复制代码 复制成功
{
   "Code":Success,
   "Message":"handle success",
   "itemId":"64ec364dd81d4052a3534c1e86167950"
}
本篇文档内容对您是否有帮助?
有帮助
我要反馈
提交成功!非常感谢您的反馈,我们会继续努力做到更好!