小雅OS开放平台文档

小雅OS开放平台文档

  • 快速入门
  • 客户端接入
  • 服务端接入

›API 接入

概述

  • 客户端接入

API 接入

  • WebSocket接口协议定义
  • Http接口协议定义
  • 调用样例
  • API 列表
  • 实体列表
  • 错误码

设备端

    Android SDK

    • 配置工程
    • 初始化
    • 功能
    • 回调
    • Demo 使用
    • 更新日志

    iOS SDK

    • 配置工程
    • 初始化
    • 功能
    • 回调
    • 更新日志

    C++ SDK

    • SDK获取方法
    • 环境要求
    • 目录结构
    • SDK架构
    • 调用示例
    • 接口文档

手机伴侣

    Android SDK

    • 接入准备
    • 账号模块
    • 内容模块
    • 反向控制
    • 设备管理模块
    • 技能模块
    • 蓝牙模块
    • 更新日志

    iOS SDK

    • 接入准备
    • 账号模块
    • 内容模块
    • 反向控制
    • 设备管理模块
    • 技能模块

内容页

    Android

    • 更新日志
    • 初始化

    iOS

    • 更新日志
    • 初始化

实体列表

指令数据

指令列表中可能会存在多个指令,调用方根据指令的type选择需要解析的指令使用。
指令会出现增加的情况、同一指令中可能会出现字段的增加。但不会字段的减少或变更。 调用方需要保证程序在出现无法识别的指令后也能正常工作。

directive说明
AudioPlayer.Play播放音频资源的指令

     

AudioPlayer.Play

该指令所有技能通用,返回的播放资源不一定是喜马拉雅资源。若仅需要获取喜马拉雅资源,建议在小雅OS开放平台中关闭喜马拉雅以外的技能。

metadata中的id、albumId的数据类型是字符串、且非必不为空。

{
    "type": "AudioPlayer.Play",
    "audioItem": {
        "stream": {
            "url": "http://fdfs.xmcdn.com/group21/M07/E1/9A/wKgJKFhaF1Hir09uABeqPmq8V3Y998.mp3", // 音频地址
            "token": "", // 目前无意义
            "offsetInMilliseconds": 0 // 音频偏移量,毫秒。注意: 由于喜马拉雅内部云历史机制只保留至秒级,若回传精确到毫秒,此处返回值会向前取整。
                                      // 例如回传的偏移量为45987,此处会返回45000。          
        },
        "metaData": {
            "id": "27299018", // 音频id
            "title": "",// 音频标题、非必不为空
            "albumId": "", // 专辑id,喜马拉雅资源包含专辑id、非必不为空
            "albumTitle": "", // 专辑标题,喜马拉雅资源包含专辑标题、非必不为空
            "artist": "", // 作者、非必不为空
            "art": {  // 背景图、非必不为空
                "small": "http://fdfs.xmcdn.com/group47/M0A/9C/59/wKgKk1tYNLzyfxrAAAIVC-YGMlU958_mobile_small.jpg",
                "middle": "",
                "large": ""
            }
        }
    }
}

Card

技能在某些时机,需要带屏幕的设备辅助显示一些信息,此时将会在协议中返回相应的数据。

例如:

技能登录

目前仅支持登录卡片,数据结构如下:

字段类型必填说明
uiJsonArray是要显示为登录卡片的信息
ui[].typestring是登录卡片固定值 skill_login
ui[].titlestring是主标题,一般为技能名称,参考上图
ui[].subTitlestring是子标题,一般为登录引导语,告诉用户如何登录。
ui[].iconstring是账号体系的图标,如果使用喜马拉雅账号登录,一般使用喜马拉雅的 icon 即可
ui[].loginDetailSkillLoginDetail是当前技能支持的登录信息
textstring是上图中的文字提示信息
{
    "ui": [
        {   
            "type": "skill_login",
            "title": "喜马拉雅有声技能",
            "subTitle": "请使用喜马拉雅账号登录",
            "icon": "http://fdfs.xmcdn.com/group64/M04/E8/5A/wKgMc12AkQPgfYyxAACeaNw-Emg484.png",
            "loginDetail": {
                "h5": {
                    "loginPage": "https://m.ximalaya.com/login"
                },  
                "status": 0, // 当前是否已经登录,未登录为0 登录为1
                "skillPtfId" : "xmly-xy1",
            }    
        }   
    ],  
    "text": "本专辑需要登录后才能收听哦""
}

登录信息的处理方式,请参考: 技能登录模式-h5

技能业务数据

目录

喜马资源

DomainIntent技能名称
ximaget_resource_kits获取当前设备的资源包列表
ximaget_albums_by_resource_id根据资源包ID获取热门专辑列表
ximaupload_play_records续播-回传播放记录
ximaget_tracks_in_current_page获取声音所在页面的声音列表信息
ximaget_tracks_by_album_id获取指定id专辑的音频列表
ximarecommendations获取专辑推荐列表
ximasearch_albums专辑搜索接口
ximaget_announcer_albums获取指定专辑的主播下的专辑列表接口
ximaget_relative_albums获取指定专辑的相关专辑列表接口
ximarecommendations_common小雅OS推荐专辑信息

喜猫资源

DomainIntent技能名称
xxmget_tracks_by_album_id获取指定专辑id的音频列表
xxmget_tracks_in_current_page获取声音所在页面的声音列表

客户端获取信息

DomainIntent技能名称
BizAppskillCenter获取技能中心信息
BizAppskillDetail获取技能详情

账号管理

DomainIntent技能名称
UcenterskillLogout退出技能登录
UcenterskillQrCodeLogin二维码授权技能登录

用户设备管理

DomainIntent技能名称
BizUsermobileRegister用户手机设备注册
BizUserspeakerRegister用户音箱注册
BizUsermobileDelete删除用户手机设备的绑定关系
BizUserspeakerList用户手机绑定的音箱列表信息
BizUserspeakerInfo用户手机绑定的音箱信息
BizUserspeakerUpdate更新用户手机绑定的音箱
BizUserspeakerDelete用户音箱设备解绑
BizUsermobileControlSpeakerUpdate变更音箱控制的设备
BizUserupdateDetectApp检测更新
BizUserapnsDeviceTokenRegisterios推送服务注册(app)
BizUserpushServiceRegister推送服务注册(app或者speaker)
BizUserupdateStatus音箱状态上报接口
BizUsergetStatus获取音箱状态

系统控制

DomainIntent技能名称
general_commandnext下一首歌曲
general_commandchange换一首歌曲
general_commandprevious上一首歌曲
general_commandmute静音
general_commandunmute取消静音
general_commandpause暂停
general_commandstop停止
general_commandquit退出
general_commandconfirm确认
general_commandcancel取消
general_commandpower_off关机
general_commandup_command调高音量
general_commanddown_command调低音量
general_commandmax_command音量调至最大
general_commandmin_command音量调至最小
general_commandset_command设置音量的值
general_commandask_volume查询当前音量
general_commandopen_command打开蓝牙
general_commandclose_command关闭蓝牙
general_commandswitch_command切换蓝牙
general_commandgo_to_sleep我要睡觉
general_commandleave_out我要离开
general_commandauto_next自动下一首歌曲

FM

DomainIntent技能名称
fmreport_break_second播放时间上报

闹钟

DomainIntent技能名称
alarmset_alarm设置闹钟
alarmview_alarm查看闹钟
alarmdelete_alarm/cancel_alarm删除闹钟/取消闹钟

提醒

DomainIntent技能名称
reminderset_reminder设置提醒
reminderview_reminder查看提醒
reminderdelete_reminder/cancel_reminder删除提醒/取消提醒

找手机

DomainIntent技能名称
find_my_phonefind_my_phone寻找手机
BizAppgetCellPhone获取手机号
BizAppsetCellphone设置手机号

我的快递

DomainIntent技能名称
BizAppgetMailExpressPhone快递绑定手机号查询
BizAppsendVerifyCode发送验证码
BizAppsetMailExpressPhone绑定手机号
expressview_express查快递

数学运算

DomainIntent技能名称
calculatorcalculator数学计算

整点报时

DomainIntent技能名称
settingopen_tell_time/close_tell_time打开或者关闭整点报时
BizClocklistForSpeaker获取整点列表

计时器

DomainIntent技能名称
timerset_timer设置计时器
timercancel_timer取消计时

时钟

DomainIntent技能名称
calendarsearch_calendar查询时间

音箱

DomainIntent技能名称
BizSpeakergetStatus获取音箱状态

打电话

DomainIntent技能名称
callsync_call_contacts同步通讯录
callcall_nickname昵称查找联系人
callcall打电话
callanswer接通电话
callrefuse拒接电话
callring_off挂断电话
callcontacts查看通讯录
callcall_record查看通话记录

喜马资源

     

获取当前设备的资源包列表

{
  "domain":"xima",
  "intent":"get_resource_kits",
  "slots":{}
}
QUERY参数类型必填说明
domainString是xima
intentString是get_resource_kits
slotsJsonObject否
返回值:

请求成功时, http状态码为200,response.data中包Page对象,对象中Items数组元素为ResourceKit类型的对象;

若请求出错,http状态码为500,返回ErrorResponse对象

     

根据资源包ID获取热门专辑列表

{
  "domain":"xima",
  "intent":"get_albums_by_resource_id",
  "slots":{"id":123,"offset":0,"limit":20}
}
QUERY参数类型必填说明
domainString是xima
intentString是get_albums_by_resource_id
slotsJsonObject是
slots.idlong是ResourceKit的id
slots.offsetInteger否首条记录的索引位置,默认为0
slots.limitInteger否返回的数量,最小为1,最大为50,默认为20
返回值:

请求成功时, http状态码为200,response.data中包含Page对象,对象中Items数组元素为Album类型的对象;

若请求出错,http状态码为500,返回ErrorResponse对象

     

续播-回传播放记录

{
  "domain":"xima",
  "intent":"upload_play_records",
  "slots":{"clientIp":"","playRecords":[{"contentType":1,"trackId": "183398349","albumId":"22512662","startedAt":1557824579000,"endedAt":1557824580000,"playedSecs":200}],"distributionChannel":""}
}
QUERY参数类型必填说明
domainString是xima
intentString是upload_play_records
slotsJsonObject是
slots.clientIpString是客户端的ip,若中间有服务端代理,需要上报真实客户的ip
slots.distributionChannelString否分销渠道名,如果将资源进行分销,可填入分销的渠道名
slots.playRecordsJsonObject是点播播放记录PlayRecord的列表(JSONArray)的序列化结果
返回值:

请求成功时,http状态码为200, response.data中包含以下字段

若请求出错,http状态码为500,返回ErrorResponse对象

字段类型说明
statusString状态码 200为正常
messageString返回ok

     

获取声音所在页面的声音列表信息

{
  "domain":"xima",
  "intent":"get_tracks_in_current_page",
  "slots":{"id":0,"albumId":0,"limit":0,"sort":"asc","contextSorted":true}
}
QUERY参数类型必填说明
domainString是xima
intentString是get_tracks_in_current_page
slotsJsonObject是
slots.idlong是指定音频的id
slots.albumIdlong是专辑的id
slots.limitInteger否返回的数量,最小为1,最大为50,默认为20
slots.sortString否返回结果的排序方式: asc-喜马拉雅正序,desc-喜马拉雅逆序,默认为 asc
slots.contextSortedboolean否是否需要根据专辑中声音的上下文关系进行排序, 默认为false
返回值:

请求成功时, http状态码为200,response.data中包含Page对象,对象中Items数组元素为Track类型的对象;

若请求出错,http状态码为500,返回ErrorResponse对象

     

获取指定id专辑的音频列表

{
  "domain":"xima",
  "intent":"get_tracks_by_album_id",
  "slots":{"id":123,"limit":0,"sort":"asc"}
}
QUERY参数类型必填说明
domainString是xima
intentString是get_tracks_by_album_id
slotsJsonObject是
slots.idlong是专辑的id
slots.offsetInteger否首条记录的索引位置,默认为0
slots.limitInteger否返回的数量,最小为1,最大为50,默认为20
slots.sortString否返回结果的排序方式: asc-喜马拉雅正序,desc-喜马拉雅逆序,默认为 asc
slots.contextSortedboolean否是否需要根据专辑中声音的上下文关系进行排序, 默认为false
返回值:

请求成功时, http状态码为200,response.data中包含Page对象,对象中Items数组元素为Track类型的对象;

若请求出错,http状态码为500,返回ErrorResponse对象

     

获取专辑推荐列表

{
  "domain":"xima",
  "intent":"recommendations",
  "slots":{"offset":0,"limit":20}
}
字段类型必填说明
domainString是xima
intentString是recommendations
slotsJsonObject否
slots.offsetInteger否首条记录的索引位置,默认为0
slots.limitInteger否返回结果中的最大条目数量,默认为5,最大不超过50
返回值:

请求成功时, http状态码为200,response.data中包含Page对象,对象中Items数组元素为Album类型的对象;

若请求出错,http状态码为500,返回ErrorResponse对象

     

专辑搜索接口

{
  "domain":"xima",
  "intent":"search_albums",
  "slots":{"keyword":"郭德纲","offset":0,"limit":20}
}
字段类型必填说明
domainString是xima
intentString是recommendations
slotsJsonObject是
slots.keywordString是需要搜索的关键词
slots.offsetInteger否首条记录的索引位置,默认为0
slots.limitInteger否返回结果中的最大条目数量,默认为5,最大不超过50
返回值:

请求成功时, http状态码为200,response.data中包含Page对象,对象中Items数组元素为Album类型的对象;

若请求出错,http状态码为500,返回ErrorResponse对象

     

获取指定专辑的主播下的专辑列表接口

{
  "domain":"xima",
  "intent":"get_announcer_albums",
  "slots":{"albumId":"123","offset":0,"limit":20}
}
字段类型必填说明
domainString是xima
intentString是get_announcer_albums
slotsJsonObject是
slots.albumIdInteger是专辑id
slots.offsetInteger否首条记录的索引位置,默认为0
slots.limitInteger否返回结果中的最大条目数量,默认为5,最大不超过50
返回值:

请求成功时, http状态码为200,response.data中包含Page对象,对象中Items数组元素为Album类型的对象;

若请求出错,http状态码为500,返回ErrorResponse对象

     

获取指定专辑的相关专辑列表接口

{
  "domain":"xima",
  "intent":"get_relative_albums",
  "slots":{"albumId":"11","offset":0,"limit":20}
}
字段类型必填说明
domainString是xima
intentString是get_relative_albums
slotsJsonObject是
slots.albumIdString是专辑id
slots.offsetInteger否首条记录的索引位置,默认为0
slots.limitInteger否返回结果中的最大条目数量,默认为5,最大不超过50
返回值:

请求成功时,http状态码为200,response.data中包含Page对象,对象中Items数组元素为Album类型的对象;

若请求出错,http状态码为500,返回ErrorResponse对象

     

小雅OS推荐专辑信息

{
  "domain":"xima",
  "intent":"recommendations_common",
  "slots":{"offset":0,"limit":20,"tags":"相声","deviceType":"web"}
}
字段类型必填说明
domainString是xima
intentString是recommendations_common
slotsJsonObject是
slots.offsetInteger否首条记录的索引位置,默认为0
slots.limitInteger否返回结果中的最大条目数量,默认为5,最大不超过50
slots.tagsInteger是推荐标签,多个逗号隔开。比如“相声”
slots.deviceTypeInteger否ios、android、linux、web、ecos、unix,默认是web
返回值:

请求成功时, http状态码为200,response.data中包含Page对象,对象中Items数组元素为Recommend类型的对象;

若请求出错,http状态码为500,返回ErrorResponse对象

     

获取指定专辑id的音频列表

{
  "domain":"xxm",
  "intent":"get_tracks_by_album_id",
  "slots":{"id":123,"offset":0,limit":0,"sort":"asc"}
}
QUERY参数类型必填说明
domainString是xxm
intentString是get_tracks_by_album_id
slotsJsonObject是
slots.idlong是专辑的id
slots.offsetInteger否首条记录的索引位置,默认为0
slots.limitInteger否返回的数量,最小为1,最大为50,默认为20
slots.sortString否返回结果的排序方式:asc-喜马拉雅正序,desc-喜马拉雅逆序,默认为asc
返回值:

请求成功时, http状态码为200,response.data中包含xxmPage对象,对象中Items数组元素为xxmTrack类型的对象;

若请求出错,http状态码为500,返回ErrorResponse对象

     

获取声音所在页面的声音列表

{
  "domain":"xxm",
  "intent":"get_tracks_in_current_page",
  "slots":{"id":0,"limit":0,"sort":"asc"}
}
QUERY参数类型必填说明
domainString是xxm
intentString是get_tracks_in_current_page
slotsJsonObject是
slots.idlong是指定音频的id
slots.limitInteger否返回的数量,最小为1,最大为50,默认为20
slots.sortString否返回结果的排序方式: asc-喜马拉雅正序,desc-喜马拉雅逆序,默认为 asc
返回值:

请求成功时, http状态码为200,response.data中包含xxmPage对象,对象中Items数组元素为xxmTrack类型的对象;

若请求出错,http状态码为500,返回ErrorResponse对象

客户端获取信息

     

获取技能中心信息

{
  "domain":"BizApp",
  "intent":"skillCenter",
  "slots":{}
}
QUERY参数类型必填说明
domainString是BizApp
intentString是skillCenter
slotsJsonObject否
返回值:

请求成功时, http状态码为200,response.data.skill_list中包含SkillList对象,其中skill_collect列表item结构为Skill对象;

若请求出错,http状态码为500,返回ErrorResponse对象

     

获取技能详情

{
  "domain":"BizApp",
  "intent":"skillDetail",
  "slots":{"skill_id":"os.skill.14"}
}
QUERY参数类型必填说明
domainString是BizApp
intentString是skillDetail
slotsJsonObject是
slots.skill_idString是技能ID
返回值:

请求成功时, http状态码为200,response.data中包含SkillDetail对象;

若请求出错,http状态码为500,返回ErrorResponse对象

账号管理

     

退出技能登录

{
  "domain":"Ucenter",
  "intent":"skillLogout",
  "slots":{"skillId":"os.skill.14"}
}
QUERY参数类型必填说明
domainString是Ucenter
intentString是skillLogout
slotsJsonObject是
slots.skillIdString是技能ID
返回值:

请求成功时, http状态码为200,response.data中包含SkillLoginDetail对象;

若请求出错,http状态码为500,返回ErrorResponse对象

     

二维码授权技能登录

{
  "domain":"Ucenter",
  "intent":"skillQrCodeLogin",
  "slots":{"qrId":"3DE4F2E57538458A9C87735C83A5D091"}
}
QUERY参数类型必填说明
domainString是Ucenter
intentString是skillQrCodeLogin
slotsJsonObject是
slots.qrIdString是二维码ID,可通过获取技能详情获得
返回值:

请求成功时, http状态码为200,response.data中包status字段;

若请求出错,http状态码为500,返回ErrorResponse对象

字段类型说明
statusString二维码登陆状态,waiting未登录,expired二维码过期,loggedIn登录成功。

用户设备管理

     

用户手机设备注册

{
  "domain":"BizUser",
  "intent":"mobileRegister",
  "slots":{}
}
QUERY参数类型必填说明
domainString是BizUser
intentString是mobileRegister
slotsJsonObject否
返回值:

请求成功时, http状态码为200,response.data中包MobileInfo对象;

若请求出错,http状态码为500,返回ErrorResponse对象

     

用户音箱注册

{
  "domain":"BizUser",
  "intent":"speakerRegister",
  "slots":{"ssid":123,"mac":"1d:12:c2:2d","name":"ab"}
}
QUERY参数类型必填说明
domainString是BizUser
intentString是mobileRegister
slotsJsonObject是
slots.ssidInteger否
slots.macString否
slots.nameString否
返回值:

请求成功时, http状态码为200,response.data中包speaker_id字段;

若请求出错,http状态码为500,返回ErrorResponse对象

字段类型说明
speaker_idInteger后台存储音箱的id值

     

删除用户手机设备的绑定关系

{
  "domain":"BizUser",
  "intent":"mobileDelete",
  "slots":{}
}
QUERY参数类型必填说明
domainString是BizUser
intentString是mobileDelete
slotsJsonObject否
返回值:

请求成功时, http状态码为200,response.data中包is_done字段;

若请求出错,http状态码为500,返回ErrorResponse对象

字段类型说明
is_donebooleantrue为删除成功;false为删除失败

     

用户手机绑定的音箱列表信息

{
  "domain":"BizUser",
  "intent":"speakerList",
  "slots":{}
}
QUERY参数类型必填说明
domainString是BizUser
intentString是speakerList
slotsJsonObject否
返回值:

请求成功时, http状态码为200,response.data中包含SpeakerList对象,对象中Items数组元素为Speaker类型的对象;

若请求出错,http状态码为500,返回ErrorResponse对象

{
    "speaker_list": [
        {
            "speaker_id": 20,
            "sn": "XYDFZT0003",
            "client_id": "os.client.sdkdemo",
            "product_id": "S_PROD1_7",
            "product_name": "",
            "rom_version": "5.0.2",
            "speaker_version": "0.0.6",
            "name": "",
            "ssid": "DFZT",
            "mac": "94:E0:D6:5B:C8:4F"
        },
        {
            "speaker_id": 27,
            "sn": "XYDFZT0004",
            "client_id": "os.client.sdkdemo",
            "product_id": "N_PROD1_7",
            "product_name": "",
            "rom_version": "5.0.2",
            "speaker_version": "0.0.8",
            "name": "小雅AI音箱",
            "ssid": "DFZT",
            "mac": "AC:20:31:66:E5:0A"
        },
        {
            "speaker_id": 30,
            "sn": "RX902000206",
            "client_id": "os.client.sdkdemo",
            "product_id": "N_PROD1_7",
            "product_name": "",
            "rom_version": "5.0.3",
            "speaker_version": "0.0.8",
            "name": "小雅AI音箱",
            "ssid": "DFZT",
            "mac": "AC:20:31:66:E5:0A"
        },
        {
            "speaker_id": 31,
            "sn": "RX902000033",
            "client_id": "os.client.sdkdemo",
            "product_id": "N_PROD1_7",
            "product_name": "",
            "rom_version": "5.0.2",
            "speaker_version": "0.0.8",
            "name": "小雅AI音箱",
            "ssid": "DFZT",
            "mac": "F8:58:6C:DE:ED:DA"
        }
    ]
}

     

用户手机绑定的音箱信息

{
  "domain":"BizUser",
  "intent":"speakerInfo",
  "slots":{"speaker_id":123}
}
QUERY参数类型必填说明
domainString是BizUser
intentString是speakerInfo
slotsJsonObject是
slots.clientIpInteger是数据库存储的音箱的id值
返回值:

请求成功时,http状态码为200, response.data中包含SpeakerInfo对象;

若请求出错,http状态码为500,返回ErrorResponse对象

     

更新用户手机绑定的音箱

{
  "domain":"BizUser",
  "intent":"speakerUpdate",
  "slots":{"name":"abc"}  
}
QUERY参数类型必填说明
domainString是BizUser
intentString是speakerUpdate
slotsJsonObject是
slots.nameString是音箱的名称
返回值:

请求成功时,http状态码为200, response.data中包含is_done字段;

若请求出错,http状态码为500,返回ErrorResponse对象

字段类型说明
is_donebooleantrue为删除成功;false为删除失败

     

用户音箱设备解绑

{
  "domain":"BizUser",
  "intent":"speakerDelete",
  "slots":{"sn":"123","client_id":"cb1"}
}
字段类型必填说明
domainString是BizUser
intentString是speakerDelete
slotsJsonObject否
slots.snString是音箱的序列号
slots.client_idString是客户id
返回值:

请求成功时,http状态码为200, response.data中包含is_done字段;

若请求出错,http状态码为500,返回ErrorResponse对象

字段类型说明
is_donebooleantrue为删除成功;false为删除失败

     

变更音箱控制的设备

{
  "domain":"BizUser",
  "intent":"mobileControlSpeakerUpdate",
  "slots":{"sn":"123","client_id":"ci1","product_id":"sprod3"}
}
字段类型必填说明
domainString是BizUser
intentString是mobileControlSpeakerUpdate
slotsJsonObject否
slots.snString是音箱的序列号
slots.client_idString是客户id
slots.product_idString是产品id
返回值:

请求成功时,http状态码为200, response.data中包含is_done字段;

若请求出错,http状态码为500,返回ErrorResponse对象

字段类型说明
is_donebooleantrue为删除成功;false为删除失败

     

App检测更新

{
  "domain":"BizUser",
  "intent":"updateDetect",
  "slots":{"pkg":"123","rom_version":"123","speaker_device_id":"123","speaker_version":"123"}
}
字段类型必填说明
domainString是BizUser
intentString是mobileControlSpeakerUpdate
slotsJsonObject否
slots.pkgString是
slots.rom_versionString是
slots.speaker_device_idString是
slots.speaker_versionString是

请求成功时, http状态码为200,response.data中包含Rom对象,Apk对象和Progress对象;

若请求出错,http状态码为500,返回ErrorResponse对象

     

ios推送服务注册(app)

{
  "domain":"BizUser",
  "intent":"apnsDeviceTokenRegister",
  "slots":{"mobile_id":"123","mobile_device_id":"123","apns_device_token":"123"}
}
QUERY参数类型必填说明
domainString是BizUser
intentString是apnsDeviceTokenRegister
slotsJsonObject是
slots.mobile_idString是手机ID 通过mobileRegister获得 用户未登陆状态下 mobile_id 可以为 0
slots.mobile_device_idString是手机device_id
slots.apns_device_tokenString是IOS平台分配给手机的deviceToken
返回值:

请求成功时,http状态码为200, response.data中包含is_done字段;

若请求出错,http状态码为500,返回ErrorResponse对象

字段类型说明
is_donebooleantrue为删除成功;false为删除失败

     

推送服务注册(app或者speaker)

{
  "domain":"BizUser",
  "intent":"pushServiceRegister",
  "slots":{"device_name":"123"}
}
QUERY参数类型必填说明
domainString是BizUser
intentString是pushServiceRegister
slotsJsonObject是
slots.device_nameString是设备名称
返回值:

请求成功时,http状态码为200, response.data中包含以下字段

若请求出错,http状态码为500,返回ErrorResponse对象

字段类型说明
successboolean
device_nameString
product_keyString
iot_idString
request_idString
device_secretString

     

音箱状态上报接口

{
  "domain":"BizUser",
  "intent":"updateStatus",
  "slots":{"volume":"12","bluetooth_status":"0","mic_status":"0","action_vod":"123","volume_status":"0","action":"123","speaker_device_id":"123","network_status":"0"}
}
QUERY参数类型必填说明
domainString是BizUser
intentString是updateStatus
slotsJsonObject是
slots.volumeString是音量
slots.bluetooth_statusString否蓝牙状态 0:关闭 1:只是打开但闲置 2:蓝牙打开处于播放状态
slots.mic_statusString是0表示禁麦,1表示开麦
slots.action_vodString是
slots.volume_statusString是声音状态 0:静音 1-100 具体大小
slots.actionString是
slots.speaker_device_idString是音箱设备ID
slots.network_statusString是网络状态 0:无网络 1:有网络
返回值:

请求成功时, http状态码为200,response.data中包is_update字段;

若请求出错,http状态码为500,返回ErrorResponse对象

字段类型说明
is_updatebooleantrue成功;false失败

     

获取音箱状态

{
  "domain":"BizUser",
  "intent":"getStatus",
  "slots":{}
}
QUERY参数类型必填说明
domainString是BizUser
intentString是getStatus
slotsJsonObject否
返回值:

请求成功时, http状态码为200,response.data中包含以下字段;

若请求出错,http状态码为500,返回ErrorResponse对象

字段类型说明
tipString
onlineStatusInteger1为在线,0为离线
networkStatusInteger网络状态 0:无网络 1:有网络
bluetoothStatusInteger蓝牙状态 0:关闭 1:只是打开但闲置 2:蓝牙打开处于播放状态
micStatusInteger禁麦状态 0:已禁麦 1:未禁麦
volumeInteger音量大小
actionString
action_keyString
action_vodJsonObject

系统控制

     

下一首歌曲

{
  "domain":"general_command",
  "intent":"next",
  "slots":{}
}
QUERY参数类型必填说明
domainString是general_command
intentString是next
slotsJsonObject否
返回值:

请求成功时, http状态码为200,response中包含OutputSpeech对象、Directives对象和data对象;

response.data中包含PlayerItemInfo对象;

若请求出错,http状态码为500,返回ErrorResponse对象

{
    "outputSpeech": {
        "type": "PlainText",
        "text": "好的,南征北战,生来倔强",
        "ssml": ""
    },
    "directives": [
        {
            "type": "AudioPlay.Play",
            "playBehavior": "ENQUEUE",
            "audioItem": {
                "stream": {
                    "url": "http://dlbcdn.ocm.ainirobot.com/246/003LtC4H15LRSE.mp3",
                    "token": "",
                    "offsetInMilliseconds": 0
                },
                "metaData": {
                    "title": "生来倔强",
                    "id": "246/003LtC4H15LRSE.mp3",
                    "albumTitle": "生来倔强",
                    "albumId": 0,
                    "artist": "南征北战",
                    "art": {
                        "small": "",
                        "middle": "",
                        "large": ""
                    }
                }
            }
        }
    ],
    "data": {
        "playerItemInfo": {
            "hot": 0,
            "artStyle": "",
            "useDealPlayerItem": false,
            "type": 1,
            "source": 11,
            "id": "246/003LtC4H15LRSE.mp3",
            "title": "生来倔强",
            "artistId": "0",
            "artist": "南征北战",
            "albumId": 0,
            "albumIncludeTracksCount": 0,
            "album": "生来倔强",
            "categoryId": "",
            "category": "",
            "breakSecond": 0,
            "doubanId": 0,
            "picSmall": "",
            "picMiddle": "",
            "picLarge": "",
            "isPaid": false,
            "isCouldPlay": 0,
            "duration": 0,
            "url": "http://dlbcdn.ocm.ainirobot.com/246/003LtC4H15LRSE.mp3",
            "sqUrl": "",
            "_urlHook": false,
            "_urlHookPlayed": false,
            "subSource": 0,
            "audioVoice": "0.271641",
            "sqAudioVoice": "",
            "ABtest": 0,
            "resType": 204,
            "triggerType": 1
        },
        "next": true,
        "demandType": 1,
        "count": 1,
        "offset": 1,
        "bi_report": {
            "trigger_type": "",
            "item_type": "101",
            "item_source": "orion",
            "item_id": "246/003LtC4H15LRSE.mp3",
            "item_title": "生来倔强",
            "item_paid_type": "0",
            "item_orig_price": "0",
            "item_cur_price": "",
            "trial_type": "",
            "item_purchased_status": "",
            "artist_id": "0",
            "artist": "南征北战",
            "album_id": "0",
            "album": "生来倔强"
        }
    }
}

     

换一首歌曲

{
  "domain":"general_command",
  "intent":"change",
  "slots":{}
}
QUERY参数类型必填说明
domainString是general_command
intentString是change
slotsJsonObject否
返回值:

请求成功时, http状态码为200,response中包含OutputSpeech对象、Directives对象和data对象;

response.data中包含PlayerItemInfo对象;

若请求出错,http状态码为500,返回ErrorResponse对象

{
    "outputSpeech": {
        "type": "PlainText",
        "text": "好的,南征北战,生来倔强",
        "ssml": ""
    },
    "directives": [
        {
            "type": "AudioPlay.Play",
            "playBehavior": "ENQUEUE",
            "audioItem": {
                "stream": {
                    "url": "http://dlbcdn.ocm.ainirobot.com/246/003LtC4H15LRSE.mp3",
                    "token": "",
                    "offsetInMilliseconds": 0
                },
                "metaData": {
                    "title": "生来倔强",
                    "id": "246/003LtC4H15LRSE.mp3",
                    "albumTitle": "生来倔强",
                    "albumId": 0,
                    "artist": "南征北战",
                    "art": {
                        "small": "",
                        "middle": "",
                        "large": ""
                    }
                }
            }
        }
    ],
    "data": {
        "playerItemInfo": {
            "hot": 0,
            "artStyle": "",
            "useDealPlayerItem": false,
            "type": 1,
            "source": 11,
            "id": "246/003LtC4H15LRSE.mp3",
            "title": "生来倔强",
            "artistId": "0",
            "artist": "南征北战",
            "albumId": 0,
            "albumIncludeTracksCount": 0,
            "album": "生来倔强",
            "categoryId": "",
            "category": "",
            "breakSecond": 0,
            "doubanId": 0,
            "picSmall": "",
            "picMiddle": "",
            "picLarge": "",
            "isPaid": false,
            "isCouldPlay": 0,
            "duration": 0,
            "url": "http://dlbcdn.ocm.ainirobot.com/246/003LtC4H15LRSE.mp3",
            "sqUrl": "",
            "_urlHook": false,
            "_urlHookPlayed": false,
            "subSource": 0,
            "audioVoice": "0.271641",
            "sqAudioVoice": "",
            "ABtest": 0,
            "resType": 204,
            "triggerType": 1
        },
        "next": true,
        "demandType": 1,
        "count": 1,
        "offset": 1,
        "bi_report": {
            "trigger_type": "",
            "item_type": "101",
            "item_source": "orion",
            "item_id": "246/003LtC4H15LRSE.mp3",
            "item_title": "生来倔强",
            "item_paid_type": "0",
            "item_orig_price": "0",
            "item_cur_price": "",
            "trial_type": "",
            "item_purchased_status": "",
            "artist_id": "0",
            "artist": "南征北战",
            "album_id": "0",
            "album": "生来倔强"
        }
    }
}

     

上一首歌曲

{
  "domain":"general_command",
  "intent":"previous",
  "slots":{}
}
QUERY参数类型必填说明
domainString是general_command
intentString是previous
slotsJsonObject否
返回值:

请求成功时, http状态码为200,response中包含OutputSpeech对象、Directives对象和data对象;

response.data中包含PlayerItemInfo对象;

若请求出错,http状态码为500,返回ErrorResponse对象

{
    "outputSpeech": {
        "type": "PlainText",
        "text": "好的,南征北战,生来倔强",
        "ssml": ""
    },
    "directives": [
        {
            "type": "AudioPlay.Play",
            "playBehavior": "ENQUEUE",
            "audioItem": {
                "stream": {
                    "url": "http://dlbcdn.ocm.ainirobot.com/246/003LtC4H15LRSE.mp3",
                    "token": "",
                    "offsetInMilliseconds": 0
                },
                "metaData": {
                    "title": "生来倔强",
                    "id": "246/003LtC4H15LRSE.mp3",
                    "albumTitle": "生来倔强",
                    "albumId": 0,
                    "artist": "南征北战",
                    "art": {
                        "small": "",
                        "middle": "",
                        "large": ""
                    }
                }
            }
        }
    ],
    "data": {
        "playerItemInfo": {
            "hot": 0,
            "artStyle": "",
            "useDealPlayerItem": false,
            "type": 1,
            "source": 11,
            "id": "246/003LtC4H15LRSE.mp3",
            "title": "生来倔强",
            "artistId": "0",
            "artist": "南征北战",
            "albumId": 0,
            "albumIncludeTracksCount": 0,
            "album": "生来倔强",
            "categoryId": "",
            "category": "",
            "breakSecond": 0,
            "doubanId": 0,
            "picSmall": "",
            "picMiddle": "",
            "picLarge": "",
            "isPaid": false,
            "isCouldPlay": 0,
            "duration": 0,
            "url": "http://dlbcdn.ocm.ainirobot.com/246/003LtC4H15LRSE.mp3",
            "sqUrl": "",
            "_urlHook": false,
            "_urlHookPlayed": false,
            "subSource": 0,
            "audioVoice": "0.271641",
            "sqAudioVoice": "",
            "ABtest": 0,
            "resType": 204,
            "triggerType": 1
        },
        "next": true,
        "demandType": 1,
        "count": 1,
        "offset": 1,
        "bi_report": {
            "trigger_type": "",
            "item_type": "101",
            "item_source": "orion",
            "item_id": "246/003LtC4H15LRSE.mp3",
            "item_title": "生来倔强",
            "item_paid_type": "0",
            "item_orig_price": "0",
            "item_cur_price": "",
            "trial_type": "",
            "item_purchased_status": "",
            "artist_id": "0",
            "artist": "南征北战",
            "album_id": "0",
            "album": "生来倔强"
        }
    }
}

     

静音

{
  "domain":"general_command",
  "intent":"mute",
  "slots":{}
}
QUERY参数类型必填说明
domainString是general_command
intentString是mute
slotsJsonObject否
返回值:

请求成功时, http状态码为200,response中包含OutputSpeech对象、Directives对象;

若请求出错,http状态码为500,返回ErrorResponse对象

{
    "outputSpeech": {
        "type": "PlainText",
        "text": "已静音",
        "ssml": ""
    },
    "directives": [
        {
            "type": "Speaker.SetMute",
            "payload": {
                "mute": true
            }
        }
    ]
}

     

取消静音

{
  "domain":"general_command",
  "intent":"unmute",
  "slots":{}
}
QUERY参数类型必填说明
domainString是BizUser
intentString是speakerInfo
slotsJsonObject否
返回值:

请求成功时, http状态码为200,response中包含Directives对象;

若请求出错,http状态码为500,返回ErrorResponse对象

{
    "directives": [
        {
            "type": "Speaker.SetMute",
            "payload": {
                "mute": false
            }
        }
    ]
}

     

暂停

{
  "domain":"general_command",
  "intent":"pause",
  "slots":{}
}
QUERY参数类型必填说明
domainString是general_command
intentString是pause
slotsJsonObject否
返回值:

请求成功时, http状态码为200,response中包含OutputSpeech对象、Directives对象;

若请求出错,http状态码为500,返回ErrorResponse对象

{
    "outputSpeech": {
        "type": "PlainText",
        "text": "已暂停",
        "ssml": ""
    },
    "card": {},
    "directives": [
        {
            "type": "System.Pause"
        }
    ]
}

     

停止

{
  "domain":"general_command",
  "intent":"stop",
  "slots":{}
}
QUERY参数类型必填说明
domainString是general_command
intentString是stop
slotsJsonObject否
返回值:

请求成功时, http状态码为200,response中包含OutputSpeech对象、Directives对象;

若请求出错,http状态码为500,返回ErrorResponse对象

{
    "outputSpeech": {
        "type": "PlainText",
        "text": "已停止",
        "ssml": ""
    },
    "card": {},
    "directives": [
        {
            "type": "System.Stop"
        }
    ]
}

     

退出

{
  "domain":"general_command",
  "intent":"quit",
  "slots":{}
}
QUERY参数类型必填说明
domainString是general_command
intentString是quit
slotsJsonObject否
返回值:

请求成功时, http状态码为200,response中包含OutputSpeech对象、Directives对象;

若请求出错,http状态码为500,返回ErrorResponse对象

{
    "outputSpeech": {
        "type": "PlainText",
        "text": "已停止",
        "ssml": ""
    },
    "card": {},
    "directives": [
        {
            "type": "System.Stop"
        }
    ]
}

     

确认

{
  "domain":"general_command",
  "intent":"confirm",
  "slots":{}
}
QUERY参数类型必填说明
domainString是general_command
intentString是confirm
slotsJsonObject否
返回值:

请求成功时, http状态码为200,response中包含OutputSpeech对象、Directives对象;

若请求出错,http状态码为500,返回ErrorResponse对象

{
    "outputSpeech": {
        "type": "PlainText",
        "text": "无效操作",
        "ssml": ""
    },
    "card": {},
    "directives": [
        {
            "type": "System.Confirm"
        }
    ]
}

     

取消

{
  "domain":"general_command",
  "intent":"cancel",
  "slots":{}
}
QUERY参数类型必填说明
domainString是general_command
intentString是cancel
slotsJsonObject否
返回值:

请求成功时, http状态码为200,response中包含Directives对象;

若请求出错,http状态码为500,返回ErrorResponse对象

{
    "directives": [
        {
            "type": "System.Confirm"
        }
    ]
}

     

关机

{
  "domain":"general_command",
  "intent":"power_off",
  "slots":{"duration_second":[],"duration_minute":[],"duration_hour":[]}
}
QUERY参数类型必填说明
domainString是general_command
intentString是mute
slotsJsonObject是
slots.duration_secondJsonArray否请求参数存在的时候,定时关机,间隔为秒
slots.duration_minuteJsonArray否请求参数存在的时候,定时关机,间隔为分钟
slots.duration_hourJsonArray否请求参数存在的时候,定时关机,间隔为小时
返回值:

请求成功时, http状态码为200,response中包含OutputSpeech对象、Directives对象和data对象;

其中data对象包含以下字段

若请求出错,http状态码为500,返回ErrorResponse对象

字段类型说明
is_power_off_nowboolean是否是现在关机
is_add_newboolean
listJsonArray
{
   "outputSpeech": {
      "type": "PlainText",
      "text": "好的,5分钟后我将进入休眠。",
      "ssml": ""
  },
  "card": {},
  "directives": [
      {
          "type": "System.PowerOff"
      }
  ],
  "data": {
      "is_power_off_now": false,
      "is_add_new": true,
      "list": [
          {
              "time_points": {
                  "type": "points",
                  "loop_type": "",
                  "loop_common": [],
                    "loop_points": [
                        {
                            "year": 2019,
                            "month": 6,
                            "day": 19,
                            "hour": 16,
                            "minute": 50,
                            "second": 7
                        }
                    ],
                    "legal_type": ""
                }
            }
        ]
    }
}

     

调高音量

{
  "domain":"general_command",
  "intent":"up_command",
  "slots":{"command_param":[{"slot_type":"123","text":"123","value":"123"}],"command_value":[{"slot_type":"123","text":"123","value":"123"}]}
}
QUERY参数类型必填说明
domainString是general_command
intentString是up_command
slotsJsonObject是
slots.command_paramJsonArray是
slots.command_param.slot_type
slots.command_param.text
slots.command_param.valueString是
slots.command_value.slot_type
slots.command_value.text
slots.command_value.valueString是设置音量的值
返回值:

请求成功时, http状态码为200,response中包含Directives对象、OutputSpeech和data对象;

其中data包含如下字段

若请求出错,http状态码为500,返回ErrorResponse对象

字段类型说明
valueJsonArray
feedback_hintJsonObject
{
    "outputSpeech": {
        "type": "PlainText",
        "text": "",
        "ssml": ""
    },
    "card": {},
    "directives": [
        {
            "type": "Speaker.AdjustVolume",
            "payload": {
                "operate": "up",
                "value": 6
            }
        }
   ],
   "data": {
        "value": [
            "6"
        ],
        "feedback_hint": {
            "type": 2,
            "action": 2
        }
    }
}

     

调低音量

{
  "domain":"general_command",
  "intent":"down_command",
  "slots":{"command_param":[{"slot_type":"123","text":"123","value":"123"}],"command_value":[{"slot_type":"123","text":"123","value":"123"}]}
}
QUERY参数类型必填说明
domainString是general_command
intentString是down_command
slotsJsonObject是
slots.command_paramJsonArray是
slots.command_param.slot_type
slots.command_param.text
slots.command_param.valueString是
slots.command_value.slot_type
slots.command_value.text
slots.command_value.valueString是设置音量的值
返回值:

请求成功时, http状态码为200,response中包含Directives对象、OutputSpeech和data对象;

其中data包含如下字段

若请求出错,http状态码为500,返回ErrorResponse对象

字段类型说明
valueJsonArray
feedback_hintJsonObject
{
    "outputSpeech": {
        "type": "PlainText",
        "text": "",
        "ssml": ""
    },
    "card": {},
    "directives": [
        {
            "type": "Speaker.AdjustVolume",
            "payload": {
                 "operate": "up",
                 "value": 6
            }
        }
   ],
   "data": {
      "value": [
          "6"
      ],
      "feedback_hint": {
          "type": 2,
          "action": 2
      }
   }
}

     

音量调至最大

{
  "domain":"general_command",
  "intent":"max_command",
  "slots":{}
}
QUERY参数类型必填说明
domainString是general_command
intentString是max_command
slotsJsonObject否
返回值:

请求成功时, http状态码为200,response中包含Directives对象、OutputSpeech对象;

若请求出错,http状态码为500,返回ErrorResponse对象

{
    "outputSpeech": {
        "type": "PlainText",
        "text": "",
        "ssml": ""
    },
    "directives": [
        {
            "type": "Speaker.AdjustVolume",
            "payload": {
                "operate": "max"
            }
        }
   ],
   "shouldEndSession": true
}

     

音量调至最小

{
  "domain":"general_command",
  "intent":"min_command",
  "slots":{}
}
QUERY参数类型必填说明
domainString是general_command
intentString是min_command
slotsJsonObject否
返回值:

请求成功时, http状态码为200,response中包含Directives对象、OutputSpeech对象;

若请求出错,http状态码为500,返回ErrorResponse对象

{
    "outputSpeech": {
        "type": "PlainText",
        "text": "",
        "ssml": ""
    },
    "directives": [
        {
            "type": "Speaker.AdjustVolume",
            "payload": {
                "operate": "min"
            }
        }
   ],
   "shouldEndSession": true
}

     

设置音量的值

{
  "domain":"general_command",
  "intent":"set_command",
  "slots":{"command_param":[{"slot_type":"123","text":"123","value":"123"}],"command_value":[{"slot_type":"123","text":"123","value":"123"}]}
}
QUERY参数类型必填说明
domainString是general_command
intentString是set_command
slotsJsonObject是
slots.command_paramJsonArray是
slots.command_param.slot_type
slots.command_param.text
slots.command_param.valueString是
slots.command_value.slot_type
slots.command_value.text
slots.command_value.valueString是设置音量的值
返回值:

请求成功时, http状态码为200,response中包含Directives对象、data对象;

其中data包含如下字段

若请求出错,http状态码为500,返回ErrorResponse对象

{
   "directives": [
      {
          "type": "Speaker.SetVolume",
          "payload": {
              "volume": "6"
          }
      }
   ],
  "data": {
      "value": [
          "6"
      ]
  }
}

     

查询当前音量

{
  "domain":"general_command",
  "intent":"ask_volume",
  "slots":{}
}
QUERY参数类型必填说明
domainString是general_command
intentString是ask_volume
slotsJsonObject是
返回值:

无返回数据

     

打开蓝牙

{
    "domain":"general_command",
    "intent":"open_command",
    "slots":{
        "command_param":[
            {
                "slot_type":"123",
                "text":"123",
                "value":"123"
            }
        ]
    }
}
QUERY参数类型必填说明
domainString是general_command
intentString是open_command
slotsJsonObject是
slots.command_paramJsonArray是
slots.command_param.slot_type
slots.command_param.text
slots.command_param.valueString是
返回值:

请求成功时, http状态码为200,response中包含Directives对象;

若请求出错,http状态码为500,返回ErrorResponse对象

{
    "directives": [
        {
            "type": "Bluetooth.Power",
            "payload": {
                "operate": "open"
            }
        }
   ]
}

     

关闭蓝牙

{
  "domain":"general_command",
  "intent":"close_command",
  "slots":{"command_param":[{"slot_type":"123","text":"123","value":"123"}]}
}
QUERY参数类型必填说明
domainString是general_command
intentString是close_command
slotsJsonObject是
slots.command_paramJsonArray是
slots.command_param.slot_type
slots.command_param.text
slots.command_param.valueString是
返回值:

请求成功时, http状态码为200,response中包含Directives对象;

若请求出错,http状态码为500,返回ErrorResponse对象

{
    "directives": [
            {
                "type": "Bluetooth.Power",
                "payload": {
                    "operate": "close"
                }
            }
     ]
}

     

切换蓝牙

{
    "domain":"general_command",
    "intent":"switch_command",
    "slots":{
        "command_param":[
            {
                "slot_type":"123",
                "text":"123",
                "value":"123"
            }
        ]
    }
}
QUERY参数类型必填说明
domainString是general_command
intentString是switch_command
slotsJsonObject是
slots.command_paramJsonArray是
slots.command_param.slot_type
slots.command_param.text
slots.command_param.valueString是
返回值:

请求成功时, http状态码为200,response中包含Directives对象;

若请求出错,http状态码为500,返回ErrorResponse对象

{
    "directives": [
            {
                "type": "Bluetooth.Connect",
                "payload": {
                    "operate": "switch"
                }
            }
     ]
}

     

我要睡觉

{
  "domain":"general_command",
  "intent":"go_to_sleep",
  "slots":{}
}
QUERY参数类型必填说明
domainString是general_command
intentString是go_to_sleep
slotsJsonObject否
返回值:

请求成功时, http状态码为200,response中包含Directives对象、OutputSpeech和data对象;

其中data包含如下字段

若请求出错,http状态码为500,返回ErrorResponse对象

字段类型说明
is_power_off_nowboolean
is_add_newboolean
listJsonArray
{
    "outputSpeech": {
        "type": "PlainText",
        "text": "好的,我将进入休眠。",
        "ssml": ""
    },
    "directives": [
        {
            "type": "System.PowerOff"
        }
    ],
     "data": {
        "is_power_off_now": true,
        "is_add_new": false,
        "list": []
    },
    "shouldEndSession": true
}

     

我要离开

{
  "domain":"general_command",
  "intent":"leave_out",
  "slots":{}
}
QUERY参数类型必填说明
domainString是general_command
intentString是leave_out
slotsJsonObject否
返回值:

请求成功时, http状态码为200,response中包含Directives对象、OutputSpeech和data对象;

其中data包含如下字段

若请求出错,http状态码为500,返回ErrorResponse对象

字段类型说明
is_power_off_nowboolean
is_add_newboolean
{
    "outputSpeech": {
        "type": "PlainText",
        "text": "主人再见,路上小心,注意安全,我等你回来哦。",
        "ssml": ""
    },
    "card": {},
    "directives": [
        {
            "type": "System.PowerOff"
        }
    ],
    "data": {
          "is_power_off_now": true,
          "is_add_new": false
    },
    "shouldEndSession": true
}

     

自动下一首歌曲

{
  "domain":"general_command",
  "intent":"auto_next",
  "slots":{}
}
QUERY参数类型必填说明
domainString是general_command
intentString是down_command
slotsJsonObject否
返回值:

请求成功时, http状态码为200,response中包含Directives对象、OutputSpeech和data对象;

其中data包含PlayerItemInfo对象

若请求出错,http状态码为500,返回ErrorResponse对象

{
    "outputSpeech": {
        "type": "PlainText",
        "text": "",
        "ssml": ""
    },
    "directives": [
        {
            "type": "AudioPlay.Play",
            "playBehavior": "ENQUEUE",
            "audioItem": {
                "stream": {
                    "url": "http://dlbcdn.ocm.ainirobot.com/246/003LtC4H15LRSE.mp3",
                    "token": "",
                    "offsetInMilliseconds": 0
                },
                "metaData": {
                    "title": "生来倔强",
                    "id": "246/003LtC4H15LRSE.mp3",
                    "albumTitle": "生来倔强",
                    "albumId": 0,
                    "artist": "南征北战",
                    "art": {
                        "small": "",
                        "middle": "",
                        "large": ""
                    }
                }
            }
        }
    ],
    "data": {
        "playerItemInfo": {
            "hot": 0,
            "artStyle": "",
            "useDealPlayerItem": false,
            "type": 1,
            "source": 11,
            "id": "246/003LtC4H15LRSE.mp3",
            "title": "生来倔强",
            "artistId": "0",
            "artist": "南征北战",
            "albumId": 0,
            "albumIncludeTracksCount": 0,
            "album": "生来倔强",
            "categoryId": "",
            "category": "",
            "breakSecond": 0,
            "doubanId": 0,
            "picSmall": "",
            "picMiddle": "",
            "picLarge": "",
            "isPaid": false,
            "isCouldPlay": 0,
            "duration": 0,
            "url": "http://dlbcdn.ocm.ainirobot.com/246/003LtC4H15LRSE.mp3",
            "sqUrl": "",
            "_urlHook": false,
            "_urlHookPlayed": false,
            "subSource": 0,
            "audioVoice": "0.271641",
            "sqAudioVoice": "",
            "ABtest": 0,
            "resType": 204,
            "triggerType": 1
        },
        "next": true,
        "demandType": 1,
        "count": 1,
        "offset": 1,
        "bi_report": {
            "trigger_type": "",
            "item_type": "101",
            "item_source": "orion",
            "item_id": "246/003LtC4H15LRSE.mp3",
            "item_title": "生来倔强",
            "item_paid_type": "0",
            "item_orig_price": "0",
            "item_cur_price": "",
            "trial_type": "",
            "item_purchased_status": "",
            "artist_id": "0",
            "artist": "南征北战",
            "album_id": "0",
            "album": "生来倔强"
        }
    }
}

FM

     

播放时间上报

{
  "domain":"fm",
  "intent":"report_break_second",
  "slots":{"trackId":"123","playedTime":123,"albumId":"123","totalTime":123}
}
QUERY参数类型必填说明
domainString是general_command
intentString是down_command
slotsJsonObject是
slots.trackIdString是音频id
slots.playedTimeInteger是当前播放的秒数
slots.albumIdString是专辑id
slots.totalTimeInteger是总秒数
返回值:

请求成功时, http状态码为200,response中包含OutputSpeech;

若请求出错,http状态码为500,返回ErrorResponse对象

{
    "outputSpeech": {
        "type": "PlainText",
        "text": "",
        "ssml": ""
    },
    "card": {},
    "directives": [],
    "data": {},
    "nextScene": null,
    "shouldEndSession": true
}

闹钟

     

调低音量

{
  "domain":"alarm",
  "intent":"set_alarm",
  "slots":{}
}
QUERY参数类型必填说明
domainString是alarm
intentString是set_alarm
slotsJsonObject否
返回值:

请求成功时, http状态码为200,response中包含Directives对象、OutputSpeech;

若请求出错,http状态码为500,返回ErrorResponse对象

{
    "outputSpeech": {
        "type": "PlainText",
        "text": "好的,几点呢?",
        "ssml": ""
    },
    "directives": [
        {
            "type": "Dialog.ElicitSlot",
            "slotToElicit": [
                "time"
            ]
        }
    ], 
    "shouldEndSession": false
}

     

查看闹钟

{
  "domain":"alarm",
  "intent":"view_alarm",
  "slots":{}
}
QUERY参数类型必填说明
domainString是alarm
intentString是view_alarm
slotsJsonObject否
返回值:

请求成功时, http状态码为200,response中包含Directives对象、和data对象;

其中data包含如下字段

若请求出错,http状态码为500,返回ErrorResponse对象

字段类型说明
statusInteger
weekJsonArray
textString
eventString
alarm_idInteger
legal_typeString
timeJsonObject
time.secondInteger
time.hourInteger
time.minuteInteger
dateJsonObject
date.yearInteger
date.dayInteger
date.monthInteger
typeInteger
sub_typeInteger
{
    "outputSpeech": {
            "type": "PlainText",
            "text": "查询到您有一个明天上午5点的闹钟。",
            "ssml": ""
        },
        "data": [
            {
                "week": [],
                "status": 0,
                "text": "2019年6月11日",
                "event": "",
                "alarm_id": 8192275,
                "legal_type": "",
                "time": {
                    "second": 0,
                    "hour": 5,
                    "minute": 0
                },
                "date": {
                    "year": 2019,
                    "day": 11,
                    "month": 6
                },
                "type": 1,
                "sub_type": 0
            }
        ],
        "shouldEndSession": true
}

     

删除闹钟/取消闹钟

删除所有的闹钟

{
    "domain":"alarm",
    "intent":"delete_alarm",
    "slots":{
        "is_all":[
            {
                "slot_type":"NORMAL",
                "text":"all",
                "value":"all"
            }
        ]
    }
}

删除某一个时间的闹钟

{
    "slots":{
        "time":[
            {
                "slot_type":"TIME",
                "text":"明天下午",
                "value":{
                    "sub_type":0,
                    "end":{
                        "date":{
                            "month":6,
                            "year":2019,
                            "day":25
                        },
                        "day_period":9,
                        "time":{
                            "hour":17,
                            "minute":59,
                            "second":59
                        }
                    },
                    "type":2,
                    "begin":{
                        "date":{
                            "month":6,
                            "year":2019,
                            "day":25
                        },
                        "day_period":9,
                        "time":{
                            "hour":12,
                            "minute":0,
                            "second":0
                        }
                    }
                }
            }
        ]
    }
}
QUERY参数类型必填说明
domainString是general_command
intentString是down_command
slotsJsonObject是槽位参数;slots为空时,进入多轮;slot有time参数数据时,删除具体时间的闹钟;slot有is_all参数数据时,删除所有闹钟;
slots.timeJsonArray是删除具体时间的闹钟时必须;
slots.time.slot_typeString是时间槽位;删除某一个时间点的闹钟
slots.time.textString是
slots.time.valueJsonObject是
slots.time.value.sub_typeInteger是0
slots.time.value.typeInteger是1
slots.time.value.beginJsonObject是闹钟具体时间的对象信息
slots.time.value.begin.dateJsonObject是日期对象信息
slots.time.value.begin.date.mouthInteger是月
slots.time.value.begin.date.yearInteger是年
slots.time.value.begin.date.dayInteger是日
slots.time.value.begin.timeJsonObject是时间对象信息
slots.time.value.begin.time.hourInteger是时
slots.time.value.begin.time.minuteInteger是分
slots.time.value.begin.time.secondInteger是秒
slots.time.value.begin.day_periodInteger是时间所属区间
slots.is_allJsonArray是删除所有闹钟时必须;
slots.is_all.slot_typeJsonObject是时间槽位;删除某一个时间点的闹钟
slots.is_all.textString是
slots.is_all.valueJsonObject是
返回值:

请求成功时, http状态码为200,response中包含OutputSpeech和data对象;

其中data包含如下字段

若请求出错,http状态码为500,返回ErrorResponse对象

字段类型说明
idsJsonArray返回闹钟的ids数组
{
    "outputSpeech": {
        "type": "PlainText",
        "text": "查询到您有一个今天晚上8点的闹钟。已经为您删除下午8点的闹钟。",
        "ssml": ""
     },
    "data": {
        "ids": [
            8192410
        ]
    },
    "shouldEndSession": true
}

提醒

     

设置提醒

多轮

{
    "intent": "reminder",
    "domain": "set_reminder",
    "slots": {}
}

time和slots参数都为必须,缺任一都会进入多轮

{
    "intent": "reminder",
    "domain": "set_reminder",
    "slots": {
        "time": [
            {
                "dict_name": "SEMANTIC_TAG_CHUNK_TIME",
                "slot_type": "NORMAL",
                "text": "每天5点",
                "value": {
                    "sub_type": 3,
                    "loop_value": [
                        {
                            "time": {
                                "hour": 5,
                                "minute": 0,
                                "second": 0
                            }
                        }
                    ],
                    "type": 3
                }
            }
        ],
        "event": [
            {
                "slot_type": "NORMAL",
                "text": "订饭",
                "value": "订饭"
            }
        ]
    }
}

固定时间

QUERY参数类型必填说明
domainString是reminder
intentString是set_reminder
slotsJsonObject是槽位参数;为空时,进入多轮;
slots.eventJsonArray是事件
slots.event.slot_typeString是
slots.event.textString是
slots.event.valueString是
slots.timeJsonArray是
slots.time.slot_typeString是时间槽位
slots.time.textString是时间文本信息
slots.time.valueJsonObject是
slots.time.value.sub_typeInteger是2
slots.time.value.typeInteger是1
slots.time.value.beginJsonObject是提醒具体时间的对象信息
slots.time.value.begin.dateJsonObject是日期对象信息
slots.time.value.begin.date.mouthInteger是月
slots.time.value.begin.date.yearInteger是年
slots.time.value.begin.date.dayInteger是日
slots.time.value.begin.timeJsonObject是时间对象信息
slots.time.value.begin.time.hourInteger是时
slots.time.value.begin.time.minuteInteger是分
slots.time.value.begin.time.secondInteger是秒
slots.command_value.valueString是设置音量的值
slots.command_value.valueString是设置音量的值
slots.command_value.valueString是设置音量的值
slots.command_value.valueString是设置音量的值
slots.command_value.valueString是设置音量的值

每天循环时间

QUERY参数类型必填说明
domainString是reminder
intentString是set_reminder
slotsJsonObject是槽位参数;为空时,进入多轮;
slots.eventJsonArray是事件
slots.event.slot_typeString是
slots.event.textString是
slots.event.valueString是
slots.timeJsonArray是
slots.time.slot_typeString是时间槽位
slots.time.textString是时间文本信息
slots.time.valueJsonObject是
slots.time.value.sub_typeInteger是2
slots.time.value.typeInteger是1
slots.time.0.value.loop_valueJsonObject是提醒具体时间的对象信息
slots.time.0.value.loop_value.timeJsonObject是日期对象信息
slots.time.0.value.loop_value.time.hourInteger是时
slots.time.0.value.loop_value.time.minuteInteger是分
slots.time.0.value.loop_value.time.secondInteger是秒
slots.time.0.value.loop_value.day_periodInteger是时间所属区间

每周循环

QUERY参数类型必填说明
domainString是reminder
intentString是set_reminder
slotsJsonObject是槽位参数;为空时,进入多轮;
slots.eventJsonArray是事件
slots.event.slot_typeString是
slots.event.textString是
slots.event.valueString是
slots.timeJsonArray是
slots.time.slot_typeString是时间槽位
slots.time.textString是时间文本信息
slots.time.valueJsonObject是
slots.time.value.sub_typeInteger是2
slots.time.value.typeInteger是1
slots.time.0.value.loop_valueJsonObject是提醒具体时间的对象信息
slots.time.0.value.loop_value.timeJsonObject是日期对象信息
slots.time.0.value.loop_value.time.hourInteger是时
slots.time.0.value.loop_value.time.minuteInteger是分
slots.time.0.value.loop_value.time.secondInteger是秒
slots.time.0.value.loop_value.day_periodInteger是时间所属区间
slots.time.0.value.loop_value.weekInteger是周循环具体
返回值:

请求成功时, http状态码为200,response中包含OutputSpeech和data对象;

其中data包含如下字段

若请求出错,http状态码为500,返回ErrorResponse对象

字段类型说明
weekJsonArray
statusInteger
textString提醒的具体日期
eventString时间的文本
timeJsonObject时间对象
time.secondInteger秒
time.hourInteger时
time.minuteInteger分
dateJsonObject日期对象
date.yearInteger年
date.dayInteger日
date.monthInteger月
legal_typeString是否按照法定节假日
typeInteger提醒的type参数值
idJsonArrayid值数组
{
    "outputSpeech": {
        "type": "PlainText",
        "text": "好的,我会在今天晚上8点提醒您开会。",
        "ssml": ""
     },
    "data": {
        "week": [],
        "status": 0,
        "sub_type": 0,
        "text": "2019年6月12日",
        "event": "开会",
        "legal_type": "",
        "time": {
            "second": 0,
            "hour": 20,
            "minute": 0
        },
        "date": {
            "year": 2019,
            "day": 12,
            "month": 6
        },
        "type": 1,
        "id": [
            8192424
        ]
    },
    "nextScene": null,
    "shouldEndSession": true
}

     

查看提醒

{
  "domain":"reminder",
  "intent":"view_reminder",
  "slots":{}
}
QUERY参数类型必填说明
domainString是reminder
intentString是view_reminder
slotsJsonObject否
返回值:

请求成功时, http状态码为200,response中包含OutputSpeech对象和data对象;

其中data对象有以下字段

若请求出错,http状态码为500,返回ErrorResponse对象

字段类型说明
weekJsonArray
statusInteger
textString提醒的具体日期
sub_typeInteger提醒sub_type参数值
eventString事件
timeJsonObject时间对象
time.secondInteger秒
time.hourInteger时
time.minuteInteger分
dateJsonObject日期对象
date.yearInteger年
date.dayInteger日
date.monthInteger月
legal_typeString是否按照法定节假日
typeInteger提醒的type参数值
{
    "outputSpeech": {
            "type": "PlainText",
            "text": "查询到两个提醒:今天晚上8点开会;今天晚上8点开会。",
            "ssml": ""
        },
    "data": [
        {
            "week": [],
            "status": 0,
            "text": "2019年6月12日",
            "event": "开会",
            "alarm_id": 8192402,
            "legal_type": "",
            "time": {
                "second": 0,
                "hour": 20,
                "minute": 0
            },
            "date": {
                "year": 2019,
                "day": 12,
                "month": 6
            },
            "type": 1,
            "sub_type": 0
        },
        {
            "week": [],
            "status": 0,
            "text": "2019年6月12日",
            "event": "开会",
            "alarm_id": 8192424,
            "legal_type": "",
            "time": {
                "second": 0,
                "hour": 20,
                "minute": 0
            },
            "date": {
                "year": 2019,
                "day": 12,
                "month": 6
            },
            "type": 1,
            "sub_type": 0
        }
    ],
    "nextScene": null,
    "shouldEndSession": true
}

     

删除提醒/取消提醒

{
  "domain":"reminder",
  "intent":"delete_reminder/cancel_reminder",
  "slots":{}
}
QUERY参数类型必填说明
domainString是reminder
intentString是delete_reminder/cancel_reminder
slotsJsonObject否
返回值:

请求成功时, http状态码为200,response中包含OutputSpeech对象和data对象;

其中data对象有以下字段

若请求出错,http状态码为500,返回ErrorResponse对象

字段类型说明
idsJsonArray返回提醒的ids数组
{
    "outputSpeech": {
            "type": "PlainText",
            "text": "已经为您删除所有提醒。",
            "ssml": ""
        },
    "data": {
        "ids": [
            8192429,
            8192430,
            8192431            
         ]
    },
    "shouldEndSession": true
}

找手机

     

寻找手机

{
  "domain":"find_my_phone",
  "intent":"find_my_phone",
  "slots":{}
}
QUERY参数类型必填说明
domainString是find_my_phone
intentString是find_my_phone
slotsJsonObject否
返回值:

请求成功时, http状态码为200,response中包OutputSpeech和data对象;

若请求出错,http状态码为500,返回ErrorResponse对象

{
    "outputSpeech":{
        "type":"PlainText",
        "text":"好的,开始拨打您的手机",
        "ssml":""
    },
    "card":{
        "text":"好的,开始拨打您的手机",
        "popup":null,
        "ui":[
            {
                "type":"TextButton",
                "bg":{
                    "image":null,
                    "color":"#F5F6F7",
                    "virtual":false
                },
                "attr":{
                    "title":"当前手机号码:15232896286",
                    "button":{
                        "text":"修改",
                        "link":"ovs://findmyphone/setphone"
                    }
                },
                "custom":null,
                "skillIcon":{
                    "image":"http://dl.update.ainirobot.com/speaker/pic/a0af4c5c04ae8c4f1d0395a7f10b60d0.png",
                    "name":"找我的手机"
                }
            }
        ],
        "linkAccount":null,
        "order":null,
        "ad":null
    },
    "data":{
        "xiaoYaCompatible":{
            "code":"200",
            "slots":{
                "cellphone":"15232896286",
                "verifycode":"7277"
            },
            "reportQueryHistory":"a:1:{i:0;O:29:"data\history\HistoryFindPhone":6:{s:19:"find_my_phone_title";s:15:"找我的手机";s:18:"find_my_phone_text";s:32:""小雅小雅,找我的手机"";s:21:"find_my_phone_pic_url";s:7:"pic_url";s:25:"find_my_phone_button_text";s:6:"设置";s:20:"find_my_phone_status";i:1;s:6:"mobile";s:11:"15232896286";}}"
        }
    },
    "shouldEndSession":true
}

     

获取手机号

{
  "domain":"BizApp",
  "intent":"getCellPhone",
  "slots":{}
}
QUERY参数类型必填说明
domainString是BizApp
intentString是getCellPhone
slotsJsonObject否
返回值:

请求成功时, http状态码为200,response中包OutputSpeech和data对象;

若请求出错,http状态码为500,返回ErrorResponse对象

{
    "outputSpeech":{
        "type":"PlainText",
        "text":"",
        "ssml":""
    },
    "card":{

    },
    "directives":[

    ],
    "data":{
        "cellphone":"15xxxxxxxxx"
    },
    "shouldEndSession":true
}

     

设置手机号

{
  "domain":"BizApp",
  "intent":"setCellphone",
  "slots":{"cellphone":"123"}
}
QUERY参数类型必填说明
domainString是BizApp
intentString是setCellphone
slotsJsonObject是
slots.cellphoneString是手机号码
返回值:

请求成功时, http状态码为200,response中包OutputSpeech和data对象;

若请求出错,http状态码为500,返回ErrorResponse对象

{
    "outputSpeech":{
        "type":"PlainText",
        "text":"",
        "ssml":""
    },
    "data":{
        "status":"success"
    },
    "shouldEndSession":true
}

我的快递

     

快递绑定手机号查询

{
  "domain":"BizApp",
  "intent":"getMailExpressPhone",
  "slots":{}
}
QUERY参数类型必填说明
domainString是BizApp
intentString是getMailExpressPhone
slotsJsonObject否
返回值:

请求成功时, http状态码为200,response中包OutputSpeech和data对象;

其中data中包含以下字段:

若请求出错,http状态码为500,返回ErrorResponse对象

字段类型说明
cellphoneString返回的手机号码

     

发送验证码

{
  "domain":"BizApp",
  "intent":"sendVerifyCode",
  "slots":{}
}
QUERY参数类型必填说明
domainString是xima
intentString是upload_play_records
slotsJsonObject否
返回值:

无

     

绑定手机号

{
  "domain":"BizApp",
  "intent":"setMailExpressPhone",
  "slots":{"mobile":"123","verifycode":"123"}
}
QUERY参数类型必填说明
domainString是BizApp
intentString是setMailExpressPhone
slotsJsonObject是
slots.mobileString是手机号码
slots.verifycodeString是验证码参数
返回值:

请求成功时, http状态码为200,response中包OutputSpeech和data对象;

其中data中包含以下字段:

若请求出错,http状态码为500,返回ErrorResponse对象

字段类型说明
statusString成功返回“success”;失败返回“faild”

     

查快递

{
  "domain":"express",
  "intent":"view_express",
  "slots":{"cellphone":"123"}
}
QUERY参数类型必填说明
domainString是express
intentString是view_express
slotsJsonObject是
slots.cellphoneString是手机号码
返回值:

请求成功时, http状态码为200,response中包OutputSpeech和data对象;

若请求出错,http状态码为500,返回ErrorResponse对象

数学运算

     

数学计算

{
  "domain":"calculator",
  "intent":"calculate",
  "slots":{}
}
QUERY参数类型必填说明
domainString是calculator
intentString是calculate
slotsJsonObject否
返回值:

请求成功时, http状态码为200,response中包OutputSpeech;

若请求出错,http状态码为500,返回ErrorResponse对象

{ "outputSpeech": {
            "type": "PlainText",
            "text": "这个难不倒我,1加二等于三",
            "ssml": ""
        },
"shouldEndSession": true}

整点报时

     

打开或者关闭整点报时

{
  "domain":"setting",
  "intent":"open_tell_time/close_tell_time",
  "slots":{}
}
QUERY参数类型必填说明
domainString是setting
intentString是open_tell_time/close_tell_time
slotsJsonObject否
返回值:

请求成功时, http状态码为200,response中包OutputSpeech和data对象;

若请求出错,http状态码为500,返回ErrorResponse对象

{
  "outputSpeech": {
              "type": "PlainText",
              "text": "已为您打开上午七点到晚上十点的整点报时,你可以使用小雅APP调整播报时间。",
              "ssml": ""
          },
  "data": {
      "xiaoYaCompatible": {
          "code": "200",
          "slots": []
      }
  },
  "shouldEndSession": true
}

     

获取整点列表

{
  "domain":"BizClock",
  "intent":"listForSpeaker",
  "slots":{}
}
QUERY参数类型必填说明
domainString是BizClock
intentString是listForSpeaker
slotsJsonObject否
返回值:

请求成功时, http状态码为200,response中包含OutputSpeech对象和data对象;

其中data对象有以下字段

若请求出错,http状态码为500,返回ErrorResponse对象

字段类型说明
listJsonArray列表数组
list.pre_clockString整点报时资源准备时间
list.play_clockString整点报时执行时间
list.textString音箱端播报的tts
list.scene_intentJsonArray整点报时以后串起的内容
{
  "outputSpeech": {
      "type": "PlainText",
      "text": "",
      "ssml": ""
  },
  "data": {
      "list": [
          {
              "pre_clock": "06:58:12",
              "play_clock": "07:00:00",
              "text": "小雅为你整点报时,现在是北京时间早上七点",
              "scene_intent": []
          },
          {
              "pre_clock": "07:58:43",
              "play_clock": "08:00:00",
              "text": "小雅为你整点报时,现在是北京时间早上八点",
              "scene_intent": []
          },
          {
              "pre_clock": "08:57:55",
              "play_clock": "09:00:00",
              "text": "小雅为你整点报时,现在是北京时间早上九点",
              "scene_intent": []
          },
          {
              "pre_clock": "09:59:12",
              "play_clock": "10:00:00",
              "text": "小雅为你整点报时,现在是北京时间早上十点",
              "scene_intent": []
          },
          {
              "pre_clock": "10:59:05",
              "play_clock": "11:00:00",
              "text": "小雅为你整点报时,现在是北京时间早上十一点",
              "scene_intent": []
          },
          {
              "pre_clock": "11:57:53",
              "play_clock": "12:00:00",
              "text": "小雅为你整点报时,现在是北京时间中午十二点",
              "scene_intent": []
          },
          {
              "pre_clock": "12:58:31",
              "play_clock": "13:00:00",
              "text": "小雅为你整点报时,现在是北京时间下午一点",
              "scene_intent": []
          },
          {
              "pre_clock": "13:55:52",
              "play_clock": "14:00:00",
              "text": "小雅为你整点报时,现在是北京时间下午两点",
              "scene_intent": []
          },
          {
              "pre_clock": "14:56:31",
              "play_clock": "15:00:00",
              "text": "小雅为你整点报时,现在是北京时间下午三点",
              "scene_intent": []
          },
          {
              "pre_clock": "15:55:15",
              "play_clock": "16:00:00",
              "text": "小雅为你整点报时,现在是北京时间下午四点",
              "scene_intent": []
          },
          {
              "pre_clock": "16:58:09",
              "play_clock": "17:00:00",
              "text": "小雅为你整点报时,现在是北京时间下午五点",
              "scene_intent": []
          },
          {
              "pre_clock": "17:56:09",
              "play_clock": "18:00:00",
              "text": "小雅为你整点报时,现在是北京时间晚上六点",
              "scene_intent": []
          },
          {
              "pre_clock": "18:56:40",
              "play_clock": "19:00:00",
              "text": "晚上七点,下面为你播报三分钟新闻",
              "scene_intent": []
          },
          {
              "pre_clock": "19:55:49",
              "play_clock": "20:00:00",
              "text": "小雅为你整点报时,现在是北京时间晚上八点",
              "scene_intent": []
          },
          {
              "pre_clock": "20:56:51",
              "play_clock": "21:00:00",
              "text": "小雅为你整点报时,现在是北京时间晚上九点",
              "scene_intent": []
          },
          {
              "pre_clock": "21:59:38",
              "play_clock": "22:00:00",
              "text": "小雅为你整点报时,现在是北京时间晚上十点",
              "scene_intent": []
          }
      ]
  },
  "shouldEndSession": true
}

计时器

     

设置计时器

hour倒计时

{
    "slots":{
        "duration_hour":[
            {
                "slot_type":"NORMAL",
                "text":"2",
                "value":"2"
            }
        ]
    }
}

minute倒计时

{
    "slots":{
        "duration_minute":[
            {
                "slot_type":"NORMAL",
                "text":"2",
                "value":"2"
            }
        ]
    }
}

second倒计时

{
    "slots":{
        "duration_second":[
            {
                "slot_type":"NORMAL",
                "text":"2",
                "value":"2"
            }
        ]
    }
}
QUERY参数类型必填说明
domainString是BizApp
intentString是getMailExpressPhone
slotsJsonObject是
slots.duration_hourJsonArray是倒计时为小时时,为必须
slots.duration_hour.slot_typeString
slots.duration_hour.textString
slots.duration_hour.valueString
slots.duration_minuteJsonArray是倒计时为分钟时,为必须
slots.duration_minute.slot_typeString
slots.duration_minute.textString
slots.duration_minute.valueString
slots.duration_secondJsonArray是倒计时为秒的时候为必须
slots.duration_second.slot_typeString
slots.duration_second.textString
slots.duration_second.valueString
返回值:

请求成功时, http状态码为200,response中包OutputSpeech和data对象;

其中data对象包含以下字段

若请求出错,http状态码为500,返回ErrorResponse对象

字段类型说明
timer_idInteger设置的计时id
start_tsInteger倒计时开始时间
last_secondsInteger倒计时的时间
ten_textString倒计时还有10s的tts文本
{
   "outputSpeech": {
      "type": "PlainText",
      "text": "好的,5分倒计时开始。",
      "ssml": ""
  },
  "data": {
      "timer_id": 539,
      "start_ts": 1560857003,
      "last_seconds": 300,
      "ten_text": "您的5分倒计时,还有10秒。"
  },
  "shouldEndSession": true
}

     

取消计时

{
  "domain":"timer",
  "intent":"cancel_timer",
  "slots":{}
}
QUERY参数类型必填说明
domainString是express
intentString是view_express
slotsJsonObject否
返回值:

请求成功时, http状态码为200,response中包OutputSpeech和data对象;

若请求出错,http状态码为500,返回ErrorResponse对象

{
   "outputSpeech": {
      "type": "PlainText",
      "text": "当前没有倒计时,如果想设置倒计时,请直接对我说,倒计时30秒。",
      "ssml": ""
  },
  "data": {
      "xiaoYaCompatible": {
          "code": "200",
          "slots": []
      }
  },
  "shouldEndSession": true
}

时钟

     

查询时间

{
  "domain":"calendar",
  "intent":"search_calendar",
  "slots":{}
}
QUERY参数类型必填说明
domainString是calendar
intentString是search_calendar
slotsJsonObject否
返回值:

请求成功时, http状态码为200,response中包OutputSpeech;

若请求出错,http状态码为500,返回ErrorResponse对象

{
  "outputSpeech": {
    "type": "PlainText",
    "text": "今天是农历己亥年五月十七",
    "ssml": ""
  },
  "shouldEndSession": true
}

     

获取音箱状态

{
  "domain":"BizSpeaker",
  "intent":"getStatus",
  "slots":{}
}
QUERY参数类型必填说明
domainString是BizSpeaker
intentString是getStatus
slotsJsonObject否
返回值:

请求成功时, http状态码为200,response中包OutputSpeech;

若请求出错,http状态码为500,返回ErrorResponse对象

{
  "outputSpeech": {
    "type": "PlainText",
    "text": "今天是农历己亥年五月十七",
    "ssml": ""
  },
  "shouldEndSession": true
}

     

同步通讯录

添加通讯录

{
  "slots":{
    "action":"add",
    "data":[
        {"nick_name":"小网"},
        {"nick_name":"小王","sort":1},
        {"nick_name":"小红"},
        {"nick_name":"小蓝"}
    ]
   },
   "domain":"call",
   "intent":"sync_call_contacts"
}
QUERY参数类型必填说明
domainString是call
intentString是sync_call_contacts
slotsJsonObject是
slots.actionString是手机号码
slots.dataJsonArray是通讯录信息
slots.data.nick_nameString是联系人昵称
slots.data.sortInteger否第一联系人,值大于0

更新通讯录

{
  "slots":{
    "action":"update",
    "data":[
        {"origin_name":"小马","nick_name":"小美"},
        {"origin_name":"小王","nick_name":"小李"}
    ]
   }
}
QUERY参数类型必填说明
domainString是call
intentString是sync_call_contacts
slotsJsonObject是
slots.actionString是手机号码
slots.dataJsonArray是通讯录信息
slots.data.origin_nameString是原联系人昵称
slots.data.nick_nameString否新昵称(nick_name与sort必选一个)
slots.data.sortInteger否联系人排序(nick_name与sort必选一个)

删除联系人

{
  "slots":{
    "action":"del",
    "data":[
        {"nick_name":"小美"},
        {"nick_name":"小李"},
        {"nick_name":"小红"}
    ]
   }
}
QUERY参数类型必填说明
domainString是call
intentString是sync_call_contacts
slotsJsonObject是
slots.actionString是手机号码
slots.dataJsonArray是通讯录信息
slots.data.nick_nameString是联系人昵称
返回值:

请求成功时, http状态码为200,response中包OutputSpeech;

若请求出错,http状态码为500,返回ErrorResponse对象

{
  "response": {
      "outputSpeech": {
          "type": null,
          "text": null,
          "ssml": null
      },
      "card": {},
      "directives": [],
      "data": {
          "syncCnt": 4
      },
      "nextScene": null,
      "shouldEndSession": true
  }
}

     

昵称查找联系人

{
  "slots":{
  "nick_name":"小王"
  },
  "domain":"call",
  "intent":"call_nickname"
}
QUERY参数类型必填说明
domainString是call
intentString是call_nickname
slotsJsonObject是
slots.nick_nameString是联系人昵称
返回值:

请求成功时, http状态码为200,response中包OutputSpeech;

若请求出错,http状态码为500,返回ErrorResponse对象

{
  "response": {
      "outputSpeech": {
          "type": "PlainText",
          "text": "已拨号给小王",
          "ssml": ""
      },
      "card": {},
      "directives": [],
      "data": {},
      "nextScene": null,
      "shouldEndSession": true
  }
}

     

打电话

{
   "slots":{},
   "domain":"call",
   "intent":"call"
}
QUERY参数类型必填说明
domainString是call
intentString是call
slotsJsonObject否
返回值:

请求成功时, http状态码为200,response中包OutputSpeech;

若请求出错,http状态码为500,返回ErrorResponse对象

{
  "response": {
      "outputSpeech": {
          "type": "PlainText",
          "text": "打电话给小王",
          "ssml": ""
      },
      "card": {},
      "directives": [
          {
              "type": "Call.NickName"
          }
      ],
      "data": {
          "contacts": "小王"
      },
      "nextScene": null,
      "shouldEndSession": true
  }
}

     

接通电话

{
   "slots":{},
   "domain":"call",
   "intent":"answer"
}
QUERY参数类型必填说明
domainString是call
intentString是answer
slotsJsonObject否
返回值:

请求成功时, http状态码为200,response中包OutputSpeech;

若请求出错,http状态码为500,返回ErrorResponse对象

{
  "response": {
      "outputSpeech": {
          "type": null,
          "text": null,
          "ssml": null
      },
      "card": {},
      "directives": [
          {
              "type": "Call.Answer"
          }
      ],
      "data": {},
      "nextScene": null,
      "shouldEndSession": true
  }
}

     

拒接电话

{
   "slots":{},
   "domain":"call",
   "intent":"refuse"
}
QUERY参数类型必填说明
domainString是call
intentString是refuse
slotsJsonObject否
返回值:

请求成功时, http状态码为200,response中包OutputSpeech;

若请求出错,http状态码为500,返回ErrorResponse对象

{
  "response": {
      "outputSpeech": {
          "type": null,
          "text": null,
          "ssml": null
      },
      "card": {},
      "directives": [
          {
              "type": "Call.Refuse"
          }
      ],
      "data": {},
      "nextScene": null,
      "shouldEndSession": true
  }
}

     

挂断电话

{
   "slots":{},
   "domain":"call",
   "intent":"ring_off"
}
QUERY参数类型必填说明
domainString是call
intentString是ring_off
slotsJsonObject否
返回值:

请求成功时, http状态码为200,response中包OutputSpeech;

若请求出错,http状态码为500,返回ErrorResponse对象

{
  "response": {
      "outputSpeech": {
          "type": null,
          "text": null,
          "ssml": null
      },
      "card": {},
      "directives": [
          {
              "type": "Call.RingOff"
          }
      ],
      "data": {},
      "nextScene": null,
      "shouldEndSession": true
  }

}

     

查看通讯录

{
   "slots":{},
   "domain":"call",
   "intent":"contacts"
}
QUERY参数类型必填说明
domainString是call
intentString是contacts
slotsJsonObject否
返回值:

请求成功时, http状态码为200,response中包OutputSpeech;

若请求出错,http状态码为500,返回ErrorResponse对象

{
  "response": {
      "outputSpeech": {
          "type": null,
          "text": null,
          "ssml": null
      },
      "card": {},
      "directives": [
          {
              "type": "Call.Contacts"
          }
      ],
      "data": {},
      "nextScene": null,
      "shouldEndSession": true
  }
}

     

查看通话记录

{
   "slots":{},
   "domain":"call",
   "intent":"call_record"
}
QUERY参数类型必填说明
domainString是call
intentString是call_record
slotsJsonObject否
返回值:

请求成功时, http状态码为200,response中包OutputSpeech;

若请求出错,http状态码为500,返回ErrorResponse对象

{
  "response": {
      "outputSpeech": {
          "type": null,
          "text": null,
          "ssml": null
      },
      "card": {},
      "directives": [
          {
              "type": "Call.Record"
          }
      ],
      "data": {},
      "nextScene": null,
      "shouldEndSession": true
  }
}

Model

     

Page

字段名类型描述
itemsarray of objects根据请求不同,返回对应的的类型
limitInteger一次响应返回的最大项数
offsetInteger从第几项开始返回数据
totalInteger可返回的数据的总项数
sortString排序类型名
{
    "total": 7,
    "offset": 0,
    "limit": 5,
    "sort": null,
    "items": []
}

     

xxmPage

字段名类型描述
itemsarray of objects根据请求不同,返回对应的的类型
{
    "items": []
}

     

Recommend

字段名类型描述
contentTypeInteger推荐类型 1 专辑 2 声音
albumAlbum专辑信息
trackTrack声音信息
recSrcString推荐埋点信息,用于前端埋点
recTrackString推荐埋点信息,用于前端埋点
recReasonString推荐理由
{
    "recSrc": "XYMR",
    "album": {
        "isSample": false,
        "announcer": {
            "avatarUrl": "https://imagev2.xmcdn.com/group1/M00/0B/3D/wKgDrlESHqyTqakZAADewk1yMt8360.jpg!op_type=3&columns=110&rows=110",
            "isVerified": true,
            "popularity": 0,
            "nickname": "郭德纲相声VIP",
            "id": 1000202
        },
        "title": "郭德纲相声经典",
        "shortIntro": "",
        "cover": {
            "small": {
                "width": 86,
                "url": "https://imagev2.xmcdn.com/group31/M07/20/F3/wKgJX1mBi5HAeDP_AAA1jHU5vC4866.jpg!op_type=3&columns=86&rows=86&magick=png",
                "height": 86
            },
            "middle": {
                "width": 140,
                "url": "https://imagev2.xmcdn.com/group31/M07/20/F3/wKgJX1mBi5HAeDP_AAA1jHU5vC4866.jpg!op_type=3&columns=140&rows=140&magick=png",
                "height": 140
            },
            "large": {
                "width": 290,
                "url": "https://imagev2.xmcdn.com/group31/M07/20/F3/wKgJX1mBi5HAeDP_AAA1jHU5vC4866.jpg!op_type=3&columns=290&rows=290&magick=png",
                "height": 290
            }
        },
        "uid": 1000202,
        "createdAt": 1501662098000,
        "shareCount": 5861,
        "isAuthorized": false,
        "isVipOnly": false,
        "isRecordsDesc": false,
        "isVipFree": false,
        "intro": "",
        "lastUpdateTrack": {
            "image": {
                "width": 140,
                "url": "http://imagev2.xmcdn.com/group31/M07/21/18/wKgJSVmBi5GwDYaxAAA1jHU5vC4048.jpg!op_type=3&columns=180&rows=180",
                "height": 140
            },
            "kind": "Track",
            "albumId": 9742774,
            "orderNum": -1,
            "source": 2,
            "title": "《歪唱太平歌词》侯震 郭德纲",
            "tags": "",
            "commentCount": 82,
            "duration": 2171,
            "uid": 1000202,
            "createdAt": 1502007878000,
            "playCount": 790771,
            "intro": "",
            "canDownload": true,
            "vipFirstStatus": 0,
            "id": 46430172,
            "isFavourite": false,
            "updatedAt": 1502007878000,
            "favoriteCount": 813
        },
        "qualityScore": 0.0,
        "canDownload": false,
        "id": 9742774,
        "updatedAt": 1568776867000,
        "freeTrackCount": 0,
        "includeTrackCount": 153,
        "kind": "album",
        "priceTypeId": 0,
        "isFinished": 1,
        "isSubscribe": false,
        "tags": "",
        "isPaid": false,
        "playCount": 227523055,
        "lastUpdatedTrackId": 46430172,
        "tracksNaturalOrdered": false,
        "subscribeCount": 556940,
        "listItemsRelationship": 0,
        "categoryId": 12,
        "favoriteCount": 0
    },
    "recTrack": "19.XYSROH_root.1932",
    "contentType": 1
}

     

Album

字段名类型描述
idlong专辑id
kindString固定值”album“
titleString专辑标题
categoryIdInteger专辑所属点播分类的id
tagsString专辑标签列表,包含运营标签和主播个人打的标签
shortIntroString专辑缩略简介
updatedAtlong专辑更新时间,unix毫秒时间戳
createdAtlong专辑创建时间,unix毫秒时间戳
playCountInteger专辑被播放总次数
favoriteCountInteger专辑被点赞总次数
subscribeCountInteger专辑被订阅总次数
shareCountInteger专辑被分享总次数
subscribeCountInteger专辑被订阅总次数
includeTrackCountInteger专辑包含音频总数
isFinishedInteger专辑是否完结, 0-无此属性;1-未完结;2-完结
isPaidboolean专辑是否是付费专辑
isSubscribeboolean专辑是否被订阅,喜马拉雅授权后有意义
canDownloadboolean专辑能否被下载到用户终端本地,禁止下载/缓存到服务器端
isRecordsDescboolean是否被人工改为逆序排列
coverCover专辑封面图
descriptionString营销简介
uidInteger作者uid
lastUpdatedTrackIdInteger最新声音id
{
    "id": 72281,
    "kind": "album",
    "title": "secret garden",
    "shortIntro": "xxx",
    "categoryId": 2,
    "tags": "",
    "updatedAt": 1421769600000,
    "createdAt": 1366992000000,
    "playCount": 0,
    "favoriteCount": 0,
    "shareCount": 0,
    "includeTrackCount": 16,
    "isFinished": 0,
    "canDownload": false,
    "subscribeCount": 213,
    "isPaid": false,
    "isSubscribe": false,
    "isRecordsDesc": false,
    "cover": {
        "small": {
            "height": 86,
            "width": 86,
            "url": "http://fdfs.test.ximalaya.com/group1/m01/04/60/wkgd3lgufreafnlfaaie638b4tw963_mobile_small.jpg"
        },
        "middle": {
            "height": 140,
            "width": 140,
            "url": "http://fdfs.test.ximalaya.com/group1/m01/04/60/wkgd3lgufreafnlfaaie638b4tw963_mobile_meduim.jpg"
        },
        "large": {
            "height": 290,
            "width": 290,
            "url": "http://fdfs.test.ximalaya.com/group1/m01/04/60/wkgd3lgufreafnlfaaie638b4tw963_mobile_large.jpg"
        }
    },
    "description": "每周两更",
    "uid": 23131,
    "lastUpdatedTrackId": 213133
}

     

xxmAlbum

字段名类型描述
idLong专辑id
kindString固定值”album“
titleString专辑标题
nickNameString主播昵称
shortIntroString专辑缩略简介
updatedAtLong专辑更新时间,unix毫秒时间戳
createdAtLong专辑创建时间,unix毫秒时间戳
playCountInteger专辑被播放总次数
trackCountInteger专辑包含的声音数量
isPaidBoolean专辑是否是付费专辑
isVipFreeBoolean专辑是否是vip免费
isRecordsDescBoolean是否被人工改为逆序排列
coverCover专辑封面图
uidInteger作者uid
{
    "kind": "album",
    "nickName": "米小圈",
    "title": "米小圈上学记|一二三年级",
    "cover": {
        "small": {
            "width": 86,
            "url": "https://imagev2.xmcdn.com/group47/M04/44/9A/wKgKm1tziUXAfYepAAEzQNBx6tI692.png!op_type=3&columns=86&rows=86&magick=png",
            "height": 86
        },
        "middle": {
            "width": 140,
            "url": "https://imagev2.xmcdn.com/group47/M04/44/9A/wKgKm1tziUXAfYepAAEzQNBx6tI692.png!op_type=3&columns=140&rows=140&magick=png",
            "height": 140
        },
        "large": {
            "width": 290,
            "url": "https://imagev2.xmcdn.com/group47/M04/44/9A/wKgKm1tziUXAfYepAAEzQNBx6tI692.png!op_type=3&columns=290&rows=290&magick=png",
            "height": 290
        }
    },
    "createdAt": 1482299340000,
    "isPaid": false,
    "playCount": 77934176,
    "uid": 68394601,
    "trackCount": 258,
    "shortInfo": "收听量破五亿的爆笑有趣广播剧,让孩子自此爱上上学",
    "isRecordsDesc": false,
    "isVipFree": false,
    "id": 210038,
    "updatedAt": 1588210922000
}

     

Track

字段名类型描述
idlong音频id
kindString类型, 固定值“track”
titleString标题
tagsString标签列表
createdAtlong创建时间
updatedAtlong更新时间
durationInteger音频时长,单位毫秒
playCountlong音频被播放总次数
favoriteCountlong音频被点赞总次数
commentCountlong音频被评论总次数
sourceInteger音频来源,1-用户原创,2-转采自其它专辑
coverImage封面图片
canDownloadboolean能否被下载到用户终端本地,禁止下载/缓存到服务器端
albumAlbum音频所属专辑
playInfoPlayInfo播放地址
{
    "id": 358558,
    "kind": "Track",
    "title": "张学友-用余生去爱",
    "tags": "",
    "createdAt": 1506063721000,
    "updatedAt": 1509075422000,
    "duration": 254,
    "playCount": 68,
    "favoriteCount": 0,
    "commentCount": 2,
    "source": null,
    "cover": null,
    "canDownload": false,
    "album": {
        "id": 120382,
        "kind": "album",
        "title": "讲不出再见",
        "intro": null,
        "categoryId": 4,
        "tags": "",
        "updatedAt": 1509075422000,
        "createdAt": 1506063715000,
        "playCount": 233,
        "favoriteCount": 0,
        "shareCount": 0,
        "includeTrackCount": 4,
        "isFinished": 0,
        "canDownload": false,
        "cover": null
    }
}

     

xxmTrack

字段名类型描述
idLong音频id
albumIdLong音频对应的专辑id
kindString类型, 固定值“track”
titleString标题
orderNumInteger章节序号
uidLong作者uid
createdAtLong创建时间
isPaidBoolean是否付费
isFreeBoolean是否试听
durationInteger音频时长,单位毫秒
playInfoPlayInfo播放地址
albumxxmAlbum专辑信息
{
    "id": 358558,
    "albumId": ,
    "kind": "Track",
    "title": "张学友-用余生去爱",
    "orderNum": 1,
    "uid": "",
    "createdAt": 1506063721000,
    "duration": 254,
    "isPaid": true,
    "isFree": false,
    "playInfo": {},
    "album": {}
}

     

Cover

字段名类型描述
smallImage分类封面小图
middleImage分类封面小图
largeImage分类封面小图
{
        "small": {
            "height": 86,
            "width": 86,
            "url": "group12/M07/17/A4/wKgDW1VxNCrzTwWVAAAJnAUfyR8545.png"
        },
        "middle": {
            "height": 140,
            "width": 140,
            "url": "group12/M07/17/A1/wKgDXFVxNB6wGFwmAAAJnAUfyR8949.png"
        },
        "large": {
            "height": 290,
            "width": 290,
            "url": ""
        }
}

     

Image

字段名类型描述
heightInteger高度值
widthInteger宽度值
urlStringurl地址
{
    "height": 86,
    "width": 86,
    "url": "group12/M07/17/A4/wKgDW1VxNCrzTwWVAAAJnAUfyR8545.png"
}

     

PlayRecord

字段名类型必填描述
contentTypeInteger是播放内容类型 1 点播 2 广播
albumIdlong是专辑id,content_type为1时有效
trackIdlong是音频id, content_type为1时有效
radioIdlong是广播电台id, content_type为2时有效
scheduleIdlong是广播电台时间表id, content_type为2时有效
playedSecsInteger是播放到多少毫秒或最后播放到的位置,相对于音频开始位置
startedAtlong是播放开始时刻,毫秒时间戳
endedAtlong是播放结束时刻,毫秒时间戳
{
    "contentType" : 1,
    "albumId": 1223,
    "trackId": 10837,
    "playedSecs": 300,
    "startedAt": 1504695227000,
    "endedAt": 1504695227000
}

     

PlayInfo

字段名类型描述
play32Resources32位mp3音频地址(注意:不是所有声音都会存在)
play64Resources64位mp3音频地址(注意:不是所有声音都会存在)
play24M4aResources24位码率m4a格式音频
play64M4aResources64位码率m4a格式音频
downloadUrlResources音频下载地址 (注意:不是所有声音都会存在)
{
    "play64M4a": {
        "size": 37021149,
        "url": "http://audio.xmcdn.com/group30/M02/3F/2C/wKgJXlmBkyqCCGafAjTl3bXNRQY773.m4a"
    },
    "downloadUrl": {
        "size": 14130036,
        "url": "http://download.xmcdn.com/group30/M05/3F/30/wKgJXlmBkzaDaqUaANebdDhPrOk981.m4a"
    },
    "play24M4a": {
        "size": 14130036,
        "url": "http://audio.xmcdn.com/group30/M05/3F/30/wKgJXlmBkzaDaqUaANebdDhPrOk981.m4a"
    },
    "play64": {
        "size": 36625278,
        "url": "http://fdfs.xmcdn.com/group31/M0A/21/89/wKgJX1mBkv2jSLHpAi7bfg8hHe0870.mp3"
    },
    "play32": {
        "size": 18312710,
        "url": "http://fdfs.xmcdn.com/group31/M0A/21/AB/wKgJSVmBkuLy4gy2ARduBg8ijJM085.mp3"
    }
}

     

Resources

字段名类型描述
urlString资源地址
sizeInteger资源占用存储空间的大小,以字节计算
{
    "url": "http://fdfs.cdn.com/12312/abc",
    "size": 1000
}

     

ResourceKit

字段名类型描述
idInteger资源ID
categoryIdInteger目录ID
nameString资源名称
descriptionString资源描述
logoString资源logo
{
    "id": 123,
    "categoryId": 1000,
    "name": "名称",
    "description": "描述",
    "logo": ""
}

     

SkillList

字段名类型描述
category_nameString类别名称
skill_collectJSONArray技能实体Skill列表
[
    {
        "category_name": "热门技能",
        "skill_collect": []
    }
]

     

Skill

字段名类型描述
skill_versionString技能版本
skill_nameString技能名称
skill_idString技能ID
skill_iconString技能图标
usage_detail_listJSONArray技能指令使用示例
{
    "skill_version": "v1.0",
    "skill_name": "提醒",
    "skill_id": "os.skill.17",
    "skill_icon": "http://fdfs.xmcdn.com/group55/M08/45/F0/wKgLf1ydxI6ju-iAAAAwB0Q2Ixg596.png",
    "usage_detail_list": [
        {
            "usage_detail": "帮我定个提醒"
        },
        {
            "usage_detail": "提醒我周六上午带宝宝打疫苗"
        },
        {
            "usage_detail": "定4月18号的提醒"
        },
        {
            "usage_detail": "提醒我周五聚餐"
        },
        {
            "usage_detail": "我后天有什么安排"
        },
        {
            "usage_detail": "删除明天的提醒"
        },
        {
            "usage_detail": "删除4月20号的提醒"
        }
    ]
}

     

SkillDetail

字段名类型描述
skill_versionString技能版本
skill_version_update_timelong技能版本更新时间
skill_updateString备用字段
skill_iconString技能图标
user_skill_scoreString备用字段
skill_usageJSONArray技能指令使用示例
score_numString备用字段
skill_companyString备用字段
skill_nameString技能名称
skill_introduceString技能简介
platform_idString备用字段
skill_loginString备用字段
skill_idString技能ID
skill_scoreString备用字段
skill_noString备用字段
skill_version_infoString技能版本介绍
skill_company_urlString备用字段
loginDetailSkillLoginDetail技能登录信息
{
    "skill_version": "v1.0",
    "skill_version_update_time": 1553830965000,
    "skill_update": 0,
    "skill_icon": "http://fdfs.xmcdn.com/group57/M0A/44/18/wKgLgVydw9bhkzAIAAAuF7djPdE529.png",
    "loginDetail": {
        "skillPtfId": "os.ptf.xmly.testsdkdemo",
        "qrcode": {
            "expiresIn": 600,
            "qrId": "3DE4F2E57538458A9C87735C83A5D091",
            "url": "https://mobile.ximalaya.com/passport-sign-mobile/qrcode/login/3DE4F2E57538458A9C87735C83A5D091?to=喜马拉雅"
        },
        "h5": {
            "loginPage": "http://api.uat.ximalaya.com/smart-os-gateway/xy-os-ucenter/open/skill-login/h5?osAccessToken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOjIzODYzLCJza2lsbElkIjoib3Muc2tpbGwuMTQiLCJpc3MiOiJ4eS1vcy11Y2VudGVyIiwiZGV2aWNlSWQiOiIyNGQ1N2NiYmNhMzlhYzQyIn0.RoAjs_ycFTL6KLthHkmAIh1wH0j1q3yXyTV_MtTe0-k"
        },
        "status": 0
    },
    "user_skill_score": 0,
    "skill_usage": [{
        "usage_type": "指令示例",
        "usage_detail_list": [{
                "usage_detail": "我想听郭德纲的相声"
            },
            {
                "usage_detail": "给我来一段评书"
            },
            {
                "usage_detail": "我要听广播"
            },
            {
                "usage_detail": "我想听睡前故事\n\n"
            }
        ]
    }],
    "score_num": 0,
    "skill_company": "",
    "skill_name": "有声内容",
    "skill_introduce": "我们拥有丰富的音频内容,涵盖相声段子、有声书、综艺娱乐、情感生活、评书、外语、培训讲座、广播剧、商业财经、健康养生、汽车、旅游、电影等20多个分类,快来点播吧",
    "platform_id": "",
    "skill_login": 0,
    "skill_id": "os.skill.14",
    "skill_score": 0,
    "skill_no": 0,
    "skill_version_info": "系统默认技能",
    "skill_company_url": ""
}

     

SkillLoginDetail

字段名类型描述
statusInteger登录状态 0未登录 1已登录 2无需登录
skillPtfIdString当前技能登录平台ID
h5JSONObjecth5登录方式
h5.loginPageString登录页面地址
qrcodeJSONObject二维码登录方式
qrcode.expiresInInteger二维码过期时间(秒)
qrcode.qrIdString二维码ID
qrcode.urlString二维码地址,客户端根据此地址生成二维码
{
  "skillPtfId": "os.ptf.xmly.testsdkdemo",
  "qrcode": {
    "expiresIn": 600,
    "qrId": "3DE4F2E57538458A9C87735C83A5D091",
    "url": "https://mobile.ximalaya.com/passport-sign-mobile/qrcode/login/3DE4F2E57538458A9C87735C83A5D091?to=喜马拉雅"
  },
  "h5": {
    "loginPage": "http://api.uat.ximalaya.com/smart-os-gateway/xy-os-ucenter/open/skill-login/h5?osAccessToken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOjIzODYzLCJza2lsbElkIjoib3Muc2tpbGwuMTQiLCJpc3MiOiJ4eS1vcy11Y2VudGVyIiwiZGV2aWNlSWQiOiIyNGQ1N2NiYmNhMzlhYzQyIn0.RoAjs_ycFTL6KLthHkmAIh1wH0j1q3yXyTV_MtTe0-k"
  },
  "status": 0
}

     

MobileInfo

字段名类型描述
device_idString设备id
client_ddString小雅os的客户id
sys_typeInteger设备类型,1:安卓;2:ios
app_versionStringapp版本
control_client_idString控制音响的client_id
control_snString控制音响的sn
statusInteger状态:1:正常;0:删除
create_dtString创建时间
update_dtString修改时间
mobile_idInteger数据库里存储手机信息的id值
{
        "mobile_info": {
            "device_id": "mobile_wt",
            "client_id": "os.client.000001",
            "sys_type": 1,
            "app_version": "1.0.0",
            "control_client_id": "",
            "control_sn": "",
            "status": 1,
            "create_dt": "2019-05-31 13:52:52",
            "update_dt": "2019-05-31 13:52:52",
            "mobile_id": 11
        }
}

     

SpeakerList

字段名类型描述
speaker_idString数据库里存储的id值
snString序列号
product_idIntegeros统一的product_id
product_nameString大雅和nano的名称
client_idStringos统一的client_id
rom_versionStringrom版本
speaker_versionString音箱apk版本
nameString音箱名称
ssidString链接ssid
macIntegermac地址
{
    "speaker_list": [
        {
            "speaker_id": 20,
            "sn": "XYDFZT0003",
            "client_id": "os.client.sdkdemo",
            "product_id": "S_PROD1_7",
            "product_name": "",
            "rom_version": "5.0.2",
            "speaker_version": "0.0.6",
            "name": "",
            "ssid": "DFZT",
            "mac": "94:E0:D6:5B:C8:4F"
        },
        {
            "speaker_id": 27,
            "sn": "XYDFZT0004",
            "client_id": "os.client.sdkdemo",
            "product_id": "N_PROD1_7",
            "product_name": "",
            "rom_version": "5.0.2",
            "speaker_version": "0.0.8",
            "name": "小雅AI音箱",
            "ssid": "DFZT",
            "mac": "AC:20:31:66:E5:0A"
        },
        {
            "speaker_id": 30,
            "sn": "RX902000206",
            "client_id": "os.client.sdkdemo",
            "product_id": "N_PROD1_7",
            "product_name": "",
            "rom_version": "5.0.3",
            "speaker_version": "0.0.8",
            "name": "小雅AI音箱",
            "ssid": "DFZT",
            "mac": "AC:20:31:66:E5:0A"
        },
        {
            "speaker_id": 31,
            "sn": "RX902000033",
            "client_id": "os.client.sdkdemo",
            "product_id": "N_PROD1_7",
            "product_name": "",
            "rom_version": "5.0.2",
            "speaker_version": "0.0.8",
            "name": "小雅AI音箱",
            "ssid": "DFZT",
            "mac": "F8:58:6C:DE:ED:DA"
        }
    ]
}

     

SpeakerInfo

字段名类型描述
speaker_idString数据库里存储的id值
snString序列号
product_idIntegeros统一的product_id
product_nameString大雅和nano的名称
client_idStringos统一的client_id
rom_versionStringrom版本
speaker_versionString音箱apk版本
nameString音箱名称
ssidString链接ssid
macIntegermac地址
{
    "speaker_info": {
        "speaker_id": 25,
        "sn": "YAMI00018A900117",
        "client_id": "os.client.000027",
        "product_id": "S_PROD4_80",
        "product_name": "",
        "rom_version": "0.0.1",
        "speaker_version": "0.0.6",
        "name": "小雅AI音箱",
        "ssid": "XMLY",
        "mac": "14:16:9E:2C:7D:DC"
    }
}

     

Rom

字段名类型描述
os_versionString
descString
urlString
hash_codeString
forced_updateboolean
update_descString
{
   "os_version": "",
   "desc": "",
   "url": "",
   "hash_code": "",
   "forced_update": false,
   "update_desc": ""
}

     

Apk

字段名类型描述
app_versionString
descString
show_versionString
urlString
hash_codeString
forced_updateboolean
update_descString
{
   "os_version": "",
   "desc": "",
   "url": "",
   "hash_code": "",
   "forced_update": false,
   "update_desc": ""
}

     

Progress

字段名类型描述
codeString
descString
{
  "code": "200",
  "desc": ""
}

     

OutputSpeech

字段名类型描述
typeString“PlainText 或者SSML”
textStringtype= “PlainText”时,值不能为空
ssmlStringtype= “SSML”时,值不能为空
{
  "type": "PlainText",
  "text": "好的,南征北战,生来倔强",
  "ssml": ""
}

     

Directives

字段名类型描述
typeStringAudioPlay.Play
playBehaviorStringENQUEUE
audioItemJsonObject播放器所需播放内容的信息
[
    {
        "type":"AudioPlay.Play",
        "playBehavior":"ENQUEUE",
        "audioItem":{
            "stream":{
                "url":"http://dlbcdn.ocm.ainirobot.com/246/003LtC4H15LRSE.mp3",
                "token":"",
                "offsetInMilliseconds":0
            },
            "metaData":{
                "title":"生来倔强",
                "id":"246/003LtC4H15LRSE.mp3",
                "albumTitle":"生来倔强",
                "albumId":0,
                "artist":"南征北战",
                "art":{
                    "small":"",
                    "middle":"",
                    "large":""
                }
            }
        }
    }
]

     

PlayItemInfo

字段名类型描述
hotInteger
artStyleString
useDealPlayerItemboolean
typeInteger
sourceInteger
idString
titleString
artistIdString
artistString
albumIdInteger
albumIncludeTracksCountInteger
albumString
categoryIdString
categoryString
breakSecondInteger
doubanIdInteger
picSmallString
picMiddleString
picLargeString
isPaidboolean
isCouldPlayInteger
durationInteger
urlString
sqUrlString
_urlHookboolean
_urlHookPlayedboolean
subSourceInteger
audioVoiceString
sqAudioVoiceString
ABtestInteger
resTypeInteger
triggerTypeInteger
{
    "hot":0,
    "artStyle":"",
    "useDealPlayerItem":false,
    "type":1,
    "source":11,
    "id":"246/003LtC4H15LRSE.mp3",
    "title":"生来倔强",
    "artistId":"0",
    "artist":"南征北战",
    "albumId":0,
    "albumIncludeTracksCount":0,
    "album":"生来倔强",
    "categoryId":"",
    "category":"",
    "breakSecond":0,
    "doubanId":0,
    "picSmall":"",
    "picMiddle":"",
    "picLarge":"",
    "isPaid":false,
    "isCouldPlay":0,
    "duration":0,
    "url":"http://dlbcdn.ocm.ainirobot.com/246/003LtC4H15LRSE.mp3",
    "sqUrl":"",
    "_urlHook":false,
    "_urlHookPlayed":false,
    "subSource":0,
    "audioVoice":"0.271641",
    "sqAudioVoice":"",
    "ABtest":0,
    "resType":204,
    "triggerType":1
}
← API 列表错误码 →
  • 指令数据
    • AudioPlayer.Play
  • Card
  • 技能业务数据
    • 目录
    • 喜马资源
    • 客户端获取信息
    • 账号管理
    • 用户设备管理
    • 系统控制
    • FM
    • 闹钟
    • 提醒
    • 找手机
    • 我的快递
    • 数学运算
    • 整点报时
    • 计时器
    • 时钟
  • Model
    • Page
    • xxmPage
    • Recommend
    • Album
    • xxmAlbum
    • Track
    • xxmTrack
    • Cover
    • Image
    • PlayRecord
    • PlayInfo
    • Resources
    • ResourceKit
    • SkillList
    • Skill
    • SkillDetail
    • SkillLoginDetail
    • MobileInfo
    • SpeakerList
    • SpeakerInfo
    • Rom
    • Apk
    • Progress
    • OutputSpeech
    • Directives
    • PlayItemInfo
北京小雅星空科技有限公司 京ICP备19010603号