@soszrg
2018-06-08T09:02:11.000000Z
字数 17863
阅读 661
V3.1
/v3_1/enduser/getVerCode/
所有标明jwt认证的接口,需要在请求header中添加Authorization头域,值为:jwt token,如下示例:
Authorization: jwt eyJhbGciOiJ...
| code | 说明 |
|---|---|
| 10100 | token过期 |
| 10101 | token错误 |
POST /enduser/getVerCode/
请求参数
| 参数名 | 类型 | 必须 | 说明 |
|---|---|---|---|
| app_id | string | 是 | FogCloud后台注册app时生成的id |
| login_name | string | 是 | 注册用的手机号码或者邮箱 |
返回值
{"meta": {"message": "Send message to phone successfully.","code": 0},"data": {}}
错误码
| 错误代码 | 错误说明 |
|---|---|
| 10000 | 参数错误:参考Response中的message字段 |
| 10250 | app id无效,在服务器找不到对应app |
| 10050 | 内部错误 |
| 10750 | 未开通阿里大于短信的组件 |
POST /enduser/verCode/
请求参数
| 参数名 | 类型 | 必须 | 说明 |
|---|---|---|---|
| app_id | string | 是 | FogCloud后台注册app时生成的id |
| login_name | string | 是 | 注册用的手机号码或者邮箱 |
| vc_type | int | 否 | 验证码类型:0 注册;1 修改密码;2 重置密码;默认为0 |
返回值
{"meta": {"message": "Send message to phone successfully.","code": 0},"data": {}}
错误码
| 错误代码 | 错误说明 |
|---|---|
| 10000 | 参数错误:参考Response中的message字段 |
| 10250 | app id无效,在服务器找不到对应app |
| 10250 | 用户不存在 |
| 10253 | 用户已经注册 |
| 10050 | 内部错误 |
| 10750 | 未开通阿里大于短信的组件 |
POST /enduser/checkVerCode/
请求参数
| 参数名 | 类型 | 必须 | 说明 |
|---|---|---|---|
| app_id | string | 是 | FogCloud后台注册app时生成的id |
| login_name | string | 是 | 注册用的手机号码或者邮箱 |
| vercode | string | 是 | 验证码 |
| password | string | 否 | 登录密码,可以为空 |
| time_zone | string | 否 | 时区 |
返回值
{"meta": {"message": "signup ok","code": 0},"data": {"token": "eyJhbGciOiJIUzI1N...","client_id": "b6d21b047bed11e78d170016..."}}
字段说明
| 返回值字段 | 字段类型 | 字段说明 |
|---|---|---|
| token | string | jwt token |
| client_id | string | 用户在服务器的唯一标识,同enduser_id |
错误码
| 错误代码 | 错误说明 |
|---|---|
| 10000 | 参数错误:参考Response的message字段 |
| 10250 | app id无效,在服务器找不到对应app |
| 10252 | 用户被禁用 |
| 10300 | 验证码过期 |
| 10301 | 验证码错误 |
| 10050 | 服务器内部错误:缺少或者有多个MqttClient |
注意事项
POST /enduser/login/
请求参数
| 参数名 | 类型 | 必须 | 说明 |
|---|---|---|---|
| login_name | string | 是 | 注册用的手机号码或者邮箱 |
| password | string | 是 | 用户登录密码 |
| app_id | string | 是 | FogCloud后台注册app时生成的appid |
| time_zone | string | 否 | 时区 |
| extend | json string | 否 | 扩展字段 |
返回值
{"meta": {"message": "ok","code": 0},"data": {"token": "eyJhbGciOiJIUzI1N...","client_id": "b6d21b047bed11e78d170016..."}}
返回值字段说明
| 字段 | 类型 | 说明 |
|---|---|---|
| token | string | JWT token |
| client_id | string | 用户在服务器的唯一标识,同enduserid |
错误码
| 错误代码 | 错误说明 |
|---|---|
| 10000 | 参数错误:参考Response的message字段 |
| 10250 | 用户不存在 |
| 10251 | 用户密码错误 |
| 10252 | 用户被禁用 |
GET /enduser/mqttInfo/
请求参数
无
返回值
{"meta": {"message": "mqtt info","code": 0},"data": {"endpoint": "8d69e5821...""login_name": "8d69e58212cd11e7a...","client_id": "d53azsf...""mqtt_port": 1883,"password": "iLBZ48jfB6tUBIoS8MS...","mqtt_host": "8d69e58212cd11e7...e.com","ssl_port": 1884}}
返回值字段说明
| 字段 | 类型 | 说明 |
|---|---|---|
| endpoint | string | MqttServer实例ID |
| login_name | string | 登录名 |
| client_id | string | 用户在服务器的唯一标识,同enduserid |
| password | string | 登录密码 |
| mqtt_host | string | MqttServer实例地址 |
| mqtt_port | string | 数据非加密端口 |
| ssl_port | string | 数据加密端口 |
错误码
无
POST /enduser/refreshToken/
请求参数
| 参数名 | 类型 | 必须 | 说明 |
|---|---|---|---|
| token | string | 是 | jwt token |
返回值
{"meta": {"message": "ok","code": 0},"data": {"token": "eyJhbGciOiJIUzI1N...","client_id": "b6d21b047bed11e78d170016..."}}
返回值字段说明
| 字段 | 类型 | 说明 |
|---|---|---|
| token | string | JWT token |
| client_id | string | mqtt client_id,同enduser_id。 |
错误码
| 错误代码 | 错误说明 |
|---|---|
| 10000 | 参数错误:缺少参数或者参数类型错误等 |
| 10101 | token错误 |
| 10102 | token已过刷新有效期,无法刷新 |
| 10250 | token对应的用户没找到 |
| 10252 | 用户被禁用 |
POST /enduser/verifyToken/
请求参数
| 参数名 | 类型 | 必须 | 说明 |
|---|---|---|---|
| token | string | 是 | jwt token |
返回值
{"meta": {"message": "ok","code": 0},"data": {"token": "eyJhbGciOiJIU...","client_id": "2faf79d67cb111e7b..."}}
返回值字段说明
| 字段 | 类型 | 说明 |
|---|---|---|
| token | string | JWT token |
| client_id | string | mqtt client_id,同enduser_id |
错误码
| 错误代码 | 错误说明 |
|---|---|
| 10000 | 参数错误:缺少参数或者参数类型错误等 |
| 10101 | token错误 |
| 10102 | token已过刷新有效期,无法刷新 |
| 10250 | token对应的用户没找到 |
| 10252 | 用户被禁用 |
PUT /enduser/updatePassword/
请求参数
| 参数名 | 类型 | 必须 | 说明 |
|---|---|---|---|
| vercode | string | 是 | 六位验证码 |
| password | string | 是 | 新密码,至少4个字符,最多20个字符 |
返回值
{"meta": {"message": "Update password ok.","code": 0},"data": {}}
错误码
| 错误代码 | 错误说明 |
|---|---|
| 10000 | 参数错误:参考Response的message字段 |
| 10300 | 验证码过期 |
| 10301 | 验证码错误 |
PUT /enduser/resetPassword/
请求参数
| 参数名 | 类型 | 必须 | 说明 |
|---|---|---|---|
| app_id | string | 是 | 应用ID |
| login_name | string | 是 | 注册时的邮箱或者手机号,最少6位 |
| vercode | string | 是 | 六位验证码 |
| password | string | 是 | 新密码,至少4个字符,最多20个字符 |
| time_zone | string | 否 | 时区 |
返回值
{"meta": {"message": "Reset password ok.","code": 0},"data": {}}
错误码
| 错误代码 | 错误说明 |
|---|---|
| 10000 | 参数错误:参考Response的message字段 |
| 10300 | 验证码过期 |
| 10301 | 验证码错误 |
| 10252 | 用户被禁用 |
POST /enduser/bindDevice/
{"type":"bind_info","data":{"device_id":"abxs..."}}
请求参数
| 参数名 | 类型 | 必须 | 说明 |
|---|---|---|---|
| device_id | string | 是 | 设备ID |
| extend | json string | 否 | 扩展字段 |
返回值
{"meta": {"message": "Bind superuser to device successfully.","code": 0},"data": {"superuser": "1761211...","device_alias": "test"}}
或者
{"meta": {"message": "Rebind device to this User","code": 0},"data": {"superuser": "1761211...","device_alias": "test"}}
或者
{"meta": {"message": "Device has superuser.","code": 10352},"data": {"superuser": "1761211...","device_alias": "test"}}
返回值字段说明
| 字段 | 类型 | 说明 |
|---|---|---|
| superuser | string | 当前超级用户手机号或邮箱 |
| device_alias | string | 设备名字,默认为产品名字 |
错误码
| 错误代码 | 错误说明 |
|---|---|
| 10000 | 参数错误:参考Response的message字段 |
| 10200 | 设备ID错误,找不到对应设备 |
| 10300 | App没有跟设备对应的产品建立绑定关系 |
| 10351 | 已经绑定该设备 |
| 10352 | 设备已经绑定超级用户 |
GET /enduser/deviceList/
请求参数
无
返回值
{"meta":{"message":"device list by user","code":0},"data":[{"product_id": "ajfax...""product_icon":"https://pro_icon.png","device_name":"hall","mac":"123qwe","role":1,"online":false,"product_name":"light","device_id":"7d0d843..."},{"product_id": "bxfax...""product_icon":"https://pro_icon1.png","device_name":"bedroom","mac":"123qwe","role":1,"online":true,"product_name":"light","device_id":"7d0d843..."}]}
返回值字段说明
| 字段 | 类型 | 说明 |
|---|---|---|
| product_id | string | 产品id |
| device_id | string | 设备id |
| product_icon | string | 产品图标URL |
| device_name | string | 设备名字 |
| mac | string | mac地址 |
| role | int | 授权级别:1为超级用户;2为管理员;3为普通用户 |
| online | bool | 在离线状态:false为离线,true为在线 |
| product_name | string | 产品名字 |
错误码
无
PUT /enduser/unbindDevice/
请求参数
| 参数名 | 类型 | 必须 | 说明 |
|---|---|---|---|
| device_id | string | 是 | 设备ID |
返回值
{"meta":{"message":"Unbind user successfully.","code":0},"data":{}}
错误码
| 错误代码 | 错误说明 |
|---|---|
| 10000 | 参数错误:参考Response的message字段 |
| 10350 | 用户与设备之间没有绑定关系 |
| 10050 | 内部错误 |
GET /enduser/deviceInfo/
请求参数
| 参数名 | 类型 | 必须 | 说明 |
|---|---|---|---|
| device_id | string | 是 | 设备ID |
返回值
{"meta":{"message":"Device info","code":0},"data":{"dsn":"test01","device_image":"http://fog-pub-test...","product":{"name":"test","product_id":"5a9643142...","model":"HCB_M2"},"alias":"测试","new_version":"1.1.4","binding_time":"2018-05-28 15:59:47.129392","is_online":false,"is_ota":false,"current_version":"1.1.4","device_id":"7c1544595ca..."}}
字段说明
| 字段 | 类型 | 说明 |
|---|---|---|
| dsn | string | 设备MAC或串号 |
| device_image | string | 设备icon |
| product | json | 产品信息 |
| name | string | 产品名字 |
| product_id | string | 产品ID |
| model | string | 产品型号 |
| alias | string | 设备别名 |
| new_version | string | 云端固件最新版本 |
| current_version | string | 设备当前固件版本,与new_version对比来判断当前是否有新固件需要更新 |
| binding_time | string | 绑定时间 |
| is_online | bool | 设备是否在线 |
错误码
| 错误代码 | 错误说明 |
|---|---|
| 10000 | 参数错误:参考Response的message字段 |
| 10200 | 设备ID错误,找不到设备 |
| 10350 | 用户跟设备没有绑定 |
PUT /enduser/updateBindRole/
请求参数
| 参数名 | 类型 | 必须 | 说明 |
|---|---|---|---|
| device_id | string | 是 | 设备ID |
| enduser_id | string | 是 | 用户ID |
| role | int | 是 | 授权级别,值只能为2或者3 |
返回值
{"meta":{"message":"update ok","code":0},"data":{"enduserid":"78212..."}}
错误码
| 错误代码 | 错误说明 |
|---|---|
| 10000 | 参数错误:参考Response的message字段 |
| 10200 | 设备ID错误 |
| 10250 | 要更新的用户不存在 |
| 10350 | 用户与设备之间没有绑定关系 |
| 10353 | 需要管理员或者超级用户权限 |
PUT /enduser/removeBindRole/
请求参数
| 参数名 | 类型 | 必须 | 说明 |
|---|---|---|---|
| device_id | string | 是 | 设备ID |
| enduser_id | string | 是 | 用户ID |
返回值
{"meta":{"message":"Remove successfully.","code":0},"data":{"enduser_id":"782127..."}}
错误码
| 错误代码 | 错误说明 |
|---|---|
| 10000 | 参数错误:参考Response的message字段 |
| 10350 | 用户与设备之间没有绑定关系 |
| 10353 | 需要管理员或者超级用户权限 |
| 10050 | 异常错误 |
POST /enduser/transferAdmin/
请求参数
| 参数名 | 类型 | 必须 | 说明 |
|---|---|---|---|
| device_id | string | 是 | 设备ID |
| enduser_id | string | 是 | 新超级用户的ID |
返回值
{"meta":{"message":"Transfer superuser successfully.","code":0},"data":{"enduserid":"7821272..."}}
错误码
| 错误代码 | 错误说明 |
|---|---|
| 10000 | 参数错误:参考Response的message字段 |
| 10200 | 设备ID错误,找不到对应设备 |
| 10250 | 用户ID错误(需要同一个app的用户) |
| 10350 | 用户与设备之间没有绑定关系 |
| 10353 | 需要管理员或者超级用户权限 |
POST /enduser/grantDevice/
请求参数
| 参数名 | 类型 | 必须 | 说明 |
|---|---|---|---|
| vercode | string | 是 | 授权码 |
| binding_type | string | 否 | 用户分组,可选值home,guest和other |
| device_id | string | 是 | 设备ID |
| extend | json string | 否 | 扩展字段 |
返回值
{"meta": {"message": "Grant successfully.","code": 0},"data": {"binding_type": "home","role": 2,"binding_time": "2016-10-28 15:41:35.817000","status": 1,"is_deleted": false,"alias": "test","extra": {},"enduser": "afgxrty...","app": "c57a6240-4e...","device": "tywww..."}}
返回值字段说明
| 字段 | 类型 | 说明 |
|---|---|---|
| binding_type | string | 用户属组:home,sa,other,guest四种 |
| role | int | 授权级别 |
| binding_time | string | 绑定时间 |
| alias | string | 设备名字,默认为产品名字 |
| extra | json string | 扩展属性 |
| app | string | App ID |
错误码
| 错误代码 | 错误说明 |
|---|---|
| 10000 | 参数错误:参考Response中的message字段 |
| 10300 | App跟产品没有建立绑定关系 |
| 10200 | 设备ID错误,找不到对应设备 |
| 10400 | 授权码过期 |
| 10401 | 授权码错误 |
| 10050 | 内部错误 |
POST /enduser/shareCode/
请求参数
| 参数名 | 类型 | 必须 | 说明 |
|---|---|---|---|
| device_id | string | 是 | 设备ID |
| role | int | 是 | 授权级别:2→管理员 3→普通用户 |
| valid_times | int | 否 | 验证码是否一次有效,0为一次有效,非0为十分钟有效 |
返回值
{"meta": {"message": "Generate captcha successfully.","code": 0},"data": {"vercode": "ac137a1e-9cda-11e6-993c-dc536017523b"}}
错误码
| 错误代码 | 错误说明 |
|---|---|
| 10000 | 参数错误:参考Response的message字段 |
| 10200 | 设备ID错误,找不到对应设备 |
| 10353 | 权限错误:需要管理员或者超级管理员权限 |
GET /enduser/userInfo/
请求参数
无
返回值
{"meta":{"message":"get user info ok","code":0},"data":{"enduser_id":"b6d21b047bed11e...","last_login":"2017-08-09T15:39:32.742454","phone":"","phone_area":"+86","phone_verified":false,"email":"test1231@126.com","email_verified":true,"nick_name":"","real_name":"","gender":"","city":"","avatar":"","note":"","is_active":true,"date_joined":"2017-08-08T11:57:36.258161","is_virtual":false,"is_online":false,"online_times":0,"app_id":"2c357408-7730-11e7-8d17-00163e03b4d6""user_id":"","tmall_flag": True}}
返回值字段说明
| 字段 | 类型 | 说明 |
|---|---|---|
| last_login | string | 最后登录时间 |
| enduser_id | string | 终端用户ID |
| phone | string | 注册手机号 |
| phone_area | string | 手机号归属地,如“+86”:中国 |
| phone_verified | bool | 手机号认证标识 |
| string | 注册邮箱 | |
| email_verified | bool | 邮箱认证标识 |
| nick_name | string | 昵称 |
| real_name | string | 实名 |
| gender | string | 性别 |
| city | string | 城市 |
| avatar | string | 头像链接 |
| note | string | 备注 |
| is_active | bool | 是否激活 |
| date_joined | string | 注册时间 |
| is_virtual | bool | 是否为虚拟用户:true为虚拟用户,false非虚拟用户 |
| app | string | App ID |
| open_id | string | 微信用户ID,用于微信用户 |
| user_id | string | 天猫登录ID |
| tmall_flag | bool | 天猫开启flag:True→开,False→关 |
错误码
无
PUT /enduser/userInfo/
请求参数
| 参数名 | 类型 | 必须 | 说明 |
|---|---|---|---|
| nick_name | string | 否 | 昵称 |
| real_name | string | 否 | 实名 |
| gender | string | 否 | 性别 |
| city | string | 否 | 城市 |
| avatar | string | 否 | 头像URL |
| note | string | 否 | 备注 |
| tmall_flag | string | 否 | 天猫flag |
| extend | string | 否 | 扩展字段 |
返回值
{"meta":{"message":"get user info ok","code":0},"data":{"enduser_id":"b6d21b047bed11e...","last_login":"2017-08-09T15:39:32.742454","phone":"","phone_area":"+86","phone_verified":false,"email":"test1231@126.com","email_verified":true,"nick_name":"","real_name":"","gender":"","city":"","avatar":"","note":"","is_active":true,"date_joined":"2017-08-08T11:57:36.258161","is_virtual":false,"is_online":false,"online_times":0,"app_id":"2c357408-7730-11e7-8d17-00163e03b4d6"}}
返回值字段说明
| 字段 | 类型 | 说明 |
|---|---|---|
| last_login | string | 最后登录时间 |
| enduser_id | string | 终端用户ID |
| phone | string | 注册手机号 |
| phone_area | string | 手机号归属地,如“+86”:中国 |
| phone_verified | bool | 手机号认证标识 |
| string | 注册邮箱 | |
| email_verified | bool | 邮箱认证标识 |
| nick_name | string | 昵称 |
| real_name | string | 实名 |
| gender | string | 性别 |
| city | string | 城市 |
| avatar | string | 头像链接 |
| note | string | 备注 |
| is_active | bool | 是否激活 |
| date_joined | string | 注册时间 |
| is_virtual | bool | 是否为虚拟用户:true为虚拟用户,false非虚拟用户 |
| app | string | App ID |
| open_id | string | 微信用户ID,用于微信用户 |
错误码
无
GET /enduser/enduserList/
请求参数
| 参数名 | 类型 | 必须 | 说明 |
|---|---|---|---|
| device_id | string | 是 | 设备ID |
返回值
{"meta":{"message":"Get user list successfully.","code":0},"data":[{"real_name":"","enduser_id":"78212721-759e-11e6-b860-f8cab81d2727","app":"c57a6240-4e6e-11e6-96c8-dc536017523b","is_active":true,"phone":"13026532187","role":2,"nick_name":"","email":""},{"real_name":"","enduser_id":"f2e836cf-57c4-11e6-96bb-f8cab81d2727","app":"c57a6240-4e6e-11e6-96c8-dc536017523b","is_active":true,"phone":"","role":3,"nick_name":"","email":"zhangrg@mxchip.com"}]}
返回值字段说明
| 字段 | 类型 | 说明 |
|---|---|---|
| enduser_id | string | 用户ID |
| app | string | App ID |
| role | int | 授权级别:1为超级用户;2为管理员;3为普通用户 |
| is_active | bool | 用户状态:true为可用,false为禁用 |
| phone | string | 用户注册手机号 |
| string | 用户注册邮箱 | |
| nick_name | string | 用户昵称 |
| real_name | string | 用户实名 |
错误码
| 错误码 | 说明 |
|---|---|
| 10000 | 参数错误:参考Response的message字段 |
| 10353 | 用户不是管理员或者超级用户 |
PUT /enduser/updateDeviceAlias/
请求参数
| 参数名 | 类型 | 必须 | 说明 |
|---|---|---|---|
| device_id | string | 是 | 设备ID |
| alias | string | 是 | 设备别名,长度限制为100个字符 |
返回值
{"meta":{"message":"Update alias successfully.","code":0},"data":{}}
错误码
| 错误码 | 说明 |
|---|---|
| 10000 | 参数错误:参考Response的message字段 |
| 10350 | 用户与设备间没有绑定关系 |
PUT /enduser/otaPush/
请求参数
| 参数名 | 类型 | 必须 | 说明 |
|---|---|---|---|
| device_id | string | 是 | 设备ID |
返回值
{"meta":{"message":"OTA push ok.","code":0},"data":{}}
错误码
| 错误码 | 说明 |
|---|---|
| 10000 | 参数错误:参考Response的message字段 |
| 10200 | 设备id错误,找不到设备 |
| 10350 | 用户与设备之间没有建立绑定关系 |
| 10207 | 设备已经是最新版本,不需要OTA |
GET /enduser/weather/caiyun/
请求参数
| 参数名 | 类型 | 必须 | 说明 |
|---|---|---|---|
| begin | int | 是 | 查询时间(整型时间戳) |
| lon | float | 是 | 经度 |
| lat | float | 是 | 纬度 |
错误码
| 错误码 | 说明 |
|---|---|
| 10000 | 参数错误:参考Response的message字段 |
| 10050 | 未知问题 |
| 10750 | App未配置彩云天气组件 |
GET /enduser/product/category/
- 获取产品类别
请求参数示例
GET /enduser/product/category/?app_id=dlfkl83803jef&language_id=1
请求参数说明
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| app_id | varchar | yes | 应用id |
| language_id | int | yes | 语言id, 1(english),2(chinese) |
返回参数
{"meta": {"message": "ok","code": 0},"data": [{"default_picture": "https://mxchip-fog...","type_id": 3,"name": "球泡灯"},{"default_picture": "https://mxchip-fog...","type_id": 1,"name": "景观灯"}]}
返回参数说明
| 参数 | 类型 | 说明 |
|---|---|---|
| name | varchar | 类别名称 |
| type_id | int | 类别id |
| default_picture | varchar | 产品类型图标url |
GET /enduser/product/productList/
- 按类别获取所有产品
请求参数
GET /enduser/product/productList/?type_id=1&app_id=cklretk4kndfg
请求参数说明
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| app_id | varchar | yes | 应用id |
| type_id | int | yes | 产品类别id |
返回参数
{"meta": {"message": "ok","code": 0},"data": [{"picture": "","product_id": "7405d040f9b...","name": "test7"},{"picture": "","product_id": "09646efef9a111e7...","name": "test5"},{"picture": "","product_id": "176b4d88f6a41...","name": "test"}]}
返回参数说明
| 参数 | 类型 | 说明 |
|---|---|---|
| name | varchar | 产品名称 |
| product_id | varchar | 产品id |
| picture | varchar | 产品图片url |
GET /enduser/product/voiceSupport/
请求参数示例
GET /enduser/product/voiceSupport/?app_id=3375ba62f1cd11e7998d000c299d4a8e
请求参数说明
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| app_id | varchar | 是 | 应用id |
返回参数
{"meta": {"message": "ok","code": 0},"data": {"ali_genie": ["test","test2"],"aws_echo": ["test","test2"],"google_home": ["test","test2"]}}
返回参数说明
| 参数 | 类型 | 说明 |
|---|---|---|
| product_name | varchar | 产品名称 |
| product_id | varchar | 产品编号 |
GET /enduser/app/aboutApp/
- 获取应用信息
请求参数示例
GET /enduser/app/aboutApp/?app_id=3375ba62f1cd11e7998d000c299d4a8e&language_id=1
请求参数说明
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| app_id | varchar | yes | 应用id |
| language_id | int | yes | 语言编号 |
返回参数
{"meta": {"message": "ok","code": 0},"data": {"app_id": "3375ba62f...","language_id":1,"app_info": "应用XX是一款智能控...",{contact_title": "热线","contact": "1235546464","contact_display": "0"},{"website_title": "官网","website": "www.google.com","website_display": "1"},{"email_title": "反馈邮箱","email": "hotpot@hotmail.com","email_display": "1"}}}
返回参数说明
| 参数 | 类型 | 说明 |
|---|---|---|
| app_id | varchar | 应用id |
| language_id | int | 语言编号 |
| app_info | varchar | 应用简介 |
| contact_title | varchar | 热线电话标题 |
| contact | varchar | 热线电话 |
| contact_display | varchar | 是否显示热线,0(不显示),1(显示) |
| website_title | varchar | 网站标题 |
| website | varchar | 网站 |
| website_display | varchar | 是否显示网站,0(不显示),1(显示) |
| email_title | varchar | 邮箱标题 |
| varchar | 邮箱 | |
| email_display | varchar | 是否显示邮箱,0(不显示),1(显示) |
GET /enduser/product/helpList/
- 获取web后台设置的帮助信息列表
请求示例
GET /enduser/product/helpList/?product_id=kdlflrk4lt5kylw3
请求参数说明
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| product_id | varchar | yes | 产品id |
返回参数
{"meta": {"message": "ok","code": o},"data": [{"product_id": "kdlflrk4lt5kylw3","help_id":3,"subject": "网络连接错误的说明"},{"product_id":"kdlflrk4lt5kylw3","help_id": 8,"subject": "使用智能音箱控制灯",}]}
返回参数说明
| 参数 | 类型 | 说明 |
|---|---|---|
| product_id | varchar | 产品id |
| help_id | varchar | 帮助编号 |
| subject | varchar | 帮助主题 |
GET /enduser/product/helpInfo/
- 获取帮助详情
请求示例
GET /v3_1/enduser/product/helpInfo/?help_id=7
请求参数说明
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| help_id | int | yes | 帮助信息编号 |
返回参数
{"meta": {"message": "ok","code": o},"data":{"help_id":7,"subject": "网络连接错误的说明","detail": "1.请确认你的设备已连接上网络;2.请尝试重新连接网络"}}
返回参数说明
| 参数 | 类型 | 说明 |
|---|---|---|
| help_id | int | 帮助信息编号 |
| subject | varchar | 帮助主题 |
| detail | varcahr | 帮助信息详情 |
GET /enduser/voiceStatus/
请求示例
GET /v3_1/enduser/voiceStatus/
返回参数
{"meta": {"message": "ok","code": 0},"data": {"enduser_id": "ce7d893a227511e8804bfa163e431402","ali_genie": true,"aws_echo": false,"google_home": false}}
返回参数说明
| 参数 | 类型 | 说明 |
|---|---|---|
| enduser_id | varchar | 终端用户ID |
| aws_echo | bool | aws echo音响开关状态 |
| google_home | bool | google home 音响开关状态 |
| ali_genie | bool | 天猫精灵音响开关状态 |
PUT /enduser/voiceStatus/
请求示例
{"google_home":1}
请求参数说明
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| aws_echo | bool | no | aws echo音响开关状态,1(开启),0(关闭) |
| google_home | bool | no | google home 音响开关状态,1(开启),0(关闭) |
| ali_genie | bool | no | 天猫精灵音响开关状态,1(开启),0(关闭) |
返回参数
{"meta": {"message": "ok","code": 0},"data": {"enduser_id": "ce78bd...","ali_genie": true,"aws_echo": false,"google_home": true}}
返回参数说明
| 参数 | 类型 | 说明 |
|---|---|---|
| enduser_id | varchar | 终端用户ID |
| aws_echo | bool | aws echo音响开关状态 |
| google_home | bool | google home 音响开关状态 |
| ali_genie | bool | 天猫精灵音响开关状态 |
GET /enduser/deviceLocaiton/
请求示例
GET /enduser/deviceLocation/?device_id=kldgjlerkgtl3455l454
请求参数说明
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| device_id | string | yes | 设备id |
返回参数
{"meta": {"message": "ok","code": 0},"data": {"location": "310000"}}
POST /enduser/inviteUser/
请求示例
* POST /v3_1/enduser/inviteUser/{"app_id":"0b4c4e80f73f11e7804bfa163e431403","device_id":"6ee2d4680d8411e8804bfa163e431402","invitee":"13918846727"}
请求参数说明
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| device_id | string | yes | 设备id |
| app_id | string | yes | 应用id |
| invitee | string | yes | 被邀请人手机号码 |
返回参数
{"meta": {"message": "ok","code": 0},"data": {}}
GET /enduser/invitationState/
返回参数
{"meta": {"message": "ok","code": 0},"data": [{"inviter": "17656677890","invitee": "18321937749","app_id": "0b4c4e80f73f11e7804bfa163e431403","device_id": "6ee2d4680d8411e8804bfa163e431402"}]}
返回参数说明
| 参数 | 类型 | 说明 |
|---|---|---|
| inviter | string | 邀请人 |
| invitee | string | 受邀人 |
| app_id | string | 应用id |
| device_id | string | 设备id |
POST /enduser/invitationConfirm/
请求示例
* POST /v3_1/enduser/invitationConfirm/{"is_accept": 1,"app_id": "0b4c4e80f73f11e7804bfa163e431402","device_id": "6ee2d4680d8411e8804bfa163e431402"}
请求参数说明
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| device_id | string | yes | 设备id |
| app_id | string | yes | 应用id |
| is_accept | bool | yes | 是否接受邀请,1(是),0(否) |
返回参数
{"meta": {"message": "Bind success","code": 0},"data": {}}
GET /enduser/product/productType/
请求示例
GET /v3_1/enduser/product/productType/?product_id=dlkflsdfjllds
请求参数说明
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| product_id | string | yes | 产品id |
返回参数
{"meta": {"message": "ok","code": 0},"data": {"product_id": "5ab4642b3hpfrqd7","type_id": "1102"}}
返回参数说明
| 参数 | 类型 | 说明 |
|---|---|---|
| product_id | string | 产品id |
| type_id | string | 产品类型标识id |
POST /atomi/obtainToken/
请求示例
{"app_id": "0b4c4e80f73f11e7804bfa163e431402","enduser_id":"thisisatokentestofatomi2018","time_zone":"+8","token": ""}
请求参数说明
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| app_id | string | yes | 应用ID |
| enduser_id | string | yes | 移动端应用唯一编码 |
| time_zone | string | no | 时区,如时区不为+8,须携带此参数 |
| token | string | yes | 非首次登陆时携带token,首次登陆时token传空字符串 |
返回参数
{"meta": {"message": "ok","code": 0},"data": {"token": "eyJhbGc...","enduser_id": "thisisatokentestofatomi2018"}}
返回参数说明
| 参数 | 类型 | 说明 |
|---|---|---|
| token | string | jwt认证Token |
| enduser_id | string | 移动端应用唯一编码 |
错误信息说明
| 错误码 | 说明 |
|---|---|
| 10001 | 请求参数错误 |
PUT /atomi/boundDeviceInfo/
请求示例
{"device_id": "ldkgjl43t40trrefjklefje","alias": "Smart Light","device_image": "http://baidu.com/image/23l4k345f.png"}
请求参数说明
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| device_id | string | yes | 设备ID |
| alias | string | no | 自定义设备别名 |
| device_image | string | no | 自定义设备图片 |
返回参数
{"meta": {"message": "ok","code": 0}}