Skip to content

众趣APP端取消原因回调接口

APP端取消原因回调接口

功能说明:

在APP端取消模型时,接入方提供取消的具体原因接口,方便众趣app选择和使用

实现步骤:

  1. 接入方参照本文档进行开发
  2. 接入方按照本文档中的格式,提供数据接收接口的地址到众趣
  3. 众趣方审核后开通此功能
  4. 开通后,每次模型取消,众趣后台将调用此接口提供给app使用

数据接收接口规则:

  1. 接口应该以类似以下格式给出
http://customer-host.com/callback/recive_model_data?app_id=xxxxx&app_secret=yyyyy
  1. app_idapp_secret这两个参数用于完成验签。验签的具体实现请看下文验签规则

  2. 数据接收接口必须支持POST方法

  3. 数据接收接口必须能够处理Content-Type值为application/json;charset=utf-8的请求

  4. 业务数据将会以json的格式包含在POST请求体中

  5. 当数据接收接口响应的http status值为200时,视为接口调用成功。

验签规则:

  1. 使用提供的app_idapp_secret两个参数实现验签功能

  2. 众趣调用客户数据接收接口时,在url中添加timestampkey以及app_id这三个参数完成校验。接口调用时,url中不会包含app_secret这个参数。

  3. timestamp参数为调用时的时间戳,单位为

  4. key参数为string类型,生成规则为MD5(app_id + timestamp + "s" + app_secret)

  5. 可以根据以下计算验证代码计算结果

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 是否必填子原因