众趣APP端取消原因回调接口
APP端取消原因回调接口
功能说明:
在APP端取消模型时,接入方提供取消的具体原因接口,方便众趣app选择和使用
实现步骤:
- 接入方参照本文档进行开发
- 接入方按照本文档中的格式,提供数据接收接口的地址到众趣
- 众趣方审核后开通此功能
- 开通后,每次模型取消,众趣后台将调用此接口提供给app使用
数据接收接口规则:
- 接口应该以类似以下格式给出
http://customer-host.com/callback/recive_model_data?app_id=xxxxx&app_secret=yyyyy
-
app_id
和app_secret
这两个参数用于完成验签。验签的具体实现请看下文验签规则
。 -
数据接收接口必须支持
POST
方法 -
数据接收接口必须能够处理
Content-Type
值为application/json;charset=utf-8
的请求 -
业务数据将会以
json
的格式包含在POST请求体中 -
当数据接收接口响应的
http status
值为200时,视为接口调用成功。
验签规则:
-
使用提供的
app_id
和app_secret
两个参数实现验签功能 -
众趣调用客户数据接收接口时,在url中添加
timestamp
和key
以及app_id
这三个参数完成校验。接口调用时,url中不会包含app_secret
这个参数。 -
timestamp
参数为调用时的时间戳,单位为秒 -
key
参数为string类型,生成规则为MD5(app_id + timestamp + "s" + app_secret)
-
可以根据以下计算验证代码计算结果
app_id = "test_app_id"
timestamp = "1623053298"
app_secret = "test_app_secret"
key = MD5(app_id + timestamp + "s" + app_secret)
则key的值为:
3c38699b311aa850a0a6f548f0bf5ebe
模型数据demo及参数:
{
"code":1,
"msg":"",
"data":[
{
"reason":"",
"required":true
}
]
}
字段解释
字段名 | 类型 | 是否必传 | 含义 |
---|---|---|---|
code | int | 是 | 状态码 |
msg | string | 是 | 状态值 |
data | array | 是 | 数据数组 |
-reason | string | 否 | 取消原因 |
-required | json | 否 | 是否必填子原因 |