智能小程序OPENCARD
开放类目

星座运势

用户在搜索星座运势时,搜索会展现“星座运势“卡片,提供某星座运势、财运指数等信息,满足用户的需求。

示意图

intent 上传接口

当前资源 intent 意图参数

key 类型 含义 示例/说明
constellation string 星座名 “摩羯座”
timespan string 时间周期 “今日”/“明日”/“本周”/“本月”/“2019 年” 等,可为空

通过平台上传 txt 文件

资源方需要将自己小程序能够覆盖的所有 intent 参数组合通过 txt 文件上传到平台上,txt 文件的具体要求参见接入流程-上传 intent 数据

当前资源分类 txt 上传文件内容示例如下:

1
2
3
4
{"constellation":"天蝎座","timespan":""}
{"constellation":"天秤座","timespan":"今日"}
{"constellation":"白羊座","timespan":"本周"}
{"constellation":"水瓶座","timespan":"2019年"}

通过开放 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 资源编号 5527

当前资源的 intent 参数参考上节 “intent 上传接口“。

举例:发送给 webhook 的 JSON (解密后)

1
2
3
4
5
6
7
8
9
{
"type": "sp_ala",
"srcid": "5527",
"surface": "mobile",
"intent": {
"constellation": "天秤座",
"timespan": ""
}
}

从 webhook 返回的结果

外层通用数据字段

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

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

key 类型 要求 说明
jump_url string 必选 卡片标题的跳转链接,跳转到展示星座运势详细信息的页面
tag_list array 必选 tag 区域,tag 数据必须 3 条
tag_list.text string 必选 tag 文案,例如”今日运势”/“明日运势”/“本周运势”,可根据意图 intent 调整 tag 顺序
tag_list.url string 必选 tag 的跳转链接
fortune_answer string 必选 运势概述
fortune_definition string 必选 运势定义
description string 必选 运势描述,具体描述,大于 30 字
composite_score number 必选 综合指数得分
composite_score_total int 必选 综合指数总分,总分为 5 分
love_score number 必选 爱情指数得分
love_score_total int 必选 爱情指数总分,总分为 5 分
money_score number 必选 财运指数得分
money_score_total int 必选 财运指数总分,总分为 5 分
cause_score number 必选 事业指数得分
cause_score_total int 必选 事业指数总分,总分为 5 分

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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{
"status": 0,
"msg": "",
"data": {
"tag_list": [
{
"text ": "今日运势",
"url": "/path/to/tag1"
},
{
"text ": "明日运势",
"url": "/path/to/tag2"
},
{
"text ": "本周运势",
"url": "/path/to/tag3"
}
],
"fortune_answer": "运势极佳",
"fortune_definition": "摩羯座今日运势",
"description": "摩羯座今日运势极佳,因为上升星座xxxx",
"composite_score": 4,
"composite_score_total": 5,
"love_score": 4,
"love_score_total": 5,
"money_score": 3,
"money_score_total": 5,
"cause_score": 4.5,
"cause_score_total": 5,
"jump_url": "/path/to/page"
}
}

审核常见问题

卡片内容与 intent 不相关

开发者提交的数据可能存在卡片展现的内容不符合 intent 体现的用户需求问题。以狮子座为例,intent 及对应卡片内容正确示例如下:

constellation timespan text1 text2 text3
狮子座 今日 狮子座今日运势
狮子座 明日 狮子座明日运势
狮子座 本周 狮子座本周运势
狮子座 本月 狮子座本月运势
狮子座 今年 狮子座今年运势

卡片内容表述不客观

卡片中文字部分对星座运势的表述应客观,避免添加过多修饰以至不符合用户搜索场景的情况。典型的错误示例如下:

类目 intent 卡片内容 是否通过 说明
星座运势 {“constellation”:”水瓶座”,”timespan”:”2019 年”} “进入新的 2019 年,水瓶座将迎来不同的……” 不通过 该陈述仅适用于 2019 年初
反 馈帮 助 回 到顶 部