智能小程序OPENCARD
开放类目

扫码搜教辅

用户在搜索教辅相关内容时,搜索会展现“扫码搜教辅“卡片,提供查找教辅的能力,满足用户对于教辅相关的泛需求。

示意图

intent 上传接口

当前资源 intent 意图参数

key 类型 含义 示例/说明
toolname string 具体工具名称 “扫码搜教辅”

通过平台上传 txt 文件

资源方需要将自己小程序能够覆盖的所有 intent 参数组合通过 txt 文件上传到平台上,txt 文件的具体要求参见接入流程-上传 intent 数据
当前资源分类 txt 上传文件内容示例如下:

1
2
{"toolname":"扫码搜教辅"}
{"toolname":"扫书码"}

intent上传图片

通过开放 API 上传

详细接入方式参见 API上传方式

Webhook API

发送给 webhook 的请求

公共字段

key 类型 含义 数据说明
type string 请求类型 在小程序阿拉丁下永远为 “sp_ala”
surface string 搜索场景 mobile: 支持小程序的移动搜索,web_h5: 支持 H5 的移动搜索
srcid string 资源编号 每个资源分类不同
intent object 搜索意图参数 JSON 对象,每个资源分类不同

当前资源 srcid 资源编号

key 类型 含义 设定
srcid string 资源编号 48000

当前资源的 intent 参数参考上节 “intent 上传接口“。
举例:发送给 webhook 的 JSON (解密后)

1
2
3
4
5
6
7
8
{
"type": "sp_ala",
"srcid": "48000",
"surface": "mobile",
"intent": {
"toolname":"扫码搜教辅"
}
}

从 webhook 返回的结果

外层通用数据字段

key 类型 含义 示例/说明
status integer 结果状态码,0 代表正确,1 代表无结果, 2 代表请求参数错误,3 代表内部服务错误 0
msg string 出错消息,当非 0 时提供 “”
data object 要返回的资源数据内容 JSON 对象,每个资源分类不同

当前资源分类的 data object 字段内容:

key 类型 要求 说明
jump_url string 必选 卡片标题的跳转链接,链接内容需要与卡片内容有相关性
name string 必选 工具名称
description string 必选 工具描述
button_text string 必选 按钮文案,例:”立即查找”
image string 必选 扫码搜教辅,像素1140*456

举例:从 webhook 返回的 JSON (加密前)

1
2
3
4
5
6
7
8
9
10
11
{
"status": 0,
"msg": "",
"data": {
"name":"扫书码搜解答",
"description":"一键查找全学科教辅书解答",
"button_text":"立即查找",
"image": "http://static.open.baidu.com/media/ch1000/jpg/bannerpicture.jpg" ,
"jump_url": "/pages/home/index"
}
}

反 馈帮 助 回 到顶 部