appid:用于唯一标识第三方平台
appkey:摘要认证的salt(注意:构造请求数据并签名必须在开发者服务端完成,appkey不要保存在开发者客户端/前端中,也不能从开发者服务端下发)
secret:基本认证的调用凭证(开发者如需使用法狗狗结果页,在会话过期后可通过此凭证获取新token更新会话 )
接口请求host:
测试服:https://app-test.fagougou.com
正式服:https://app.fagougou.com
通知回调接口:(由第三方开发者配置或提供)
传入参数 | 是否必填 | 示例 | 字段说明 |
---|---|---|---|
appid | 是 | xxxxxxxxxxx | 开发者appid |
timestamp | 是 | 1712130669 | 当前时间(10位数字时间戳) |
nonce | 是 | ibuaiVcKdpRxfgtr | 16位随机字符串 |
sign | 是 | ******** | 签名(小32位。生成方式见下方示例) |
<!-- 当前demo所依赖客户端请求框架。也可以选择其它的httpclient框架 -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
<version>4.5.12</version>
</dependency>
字段名 | 位置 | 字段说明 | 取值范例 |
---|---|---|---|
Content-Type | Header | 固定值:application/json | application/json |
fgg-logid | Header | 统一日志id,当出现问题时可以提供此id给法狗狗研发人员协助定位问题 | 780d9ac6-573d-4293-b8e2-b68ad14069e2 |
字段名 | 位置 | 字段说明 | 取值范例 |
---|---|---|---|
appid | Header | 开发者appid | xxxxxxxxxxx |
timestamp | Header | 当前时间(10位数字时间戳) | 1712130669 |
nonce | Header | 16位随机字符串 | ibuaiVcKdpRxfgtr |
sign | Header | 签名,请参考下方签名算法 | ****** |
{
"status": "complete",
"message": "任务执行成功",
"taskId": "c89cbee0-b3e4-4734-9060-54eccbaa401e",
"type": "compare",
"similarity": 0,
"diffItemsCount": 0,
"addedCount": 0,
"changedCount": 0,
"removedCount": 0
}
类型 | code | msg |
---|---|---|
用户 | 2002 | 用户不存在 |
用户 | 2003 | 用户已存在 |
鉴权 | 6032 | 无效的appid |
鉴权 | 6033 | 无效的签名 |
鉴权 | 6034 | 无效的nonce |
鉴权 | 6035 | 签名已过期 |
鉴权 | 6036 | 验签失败 |