@cfygaoyang
2020-03-09T07:17:55.000000Z
字数 21744
阅读 1424
| 错误码 | 信息 | 描述 |
|---|---|---|
| 10000 | 通用错误码 | |
| 10001 | invalid account format | 账号格式错误 |
| 10002 | invalid account | 账号错误 |
| 10003 | invalid password | 密码错误 |
| 10004 | invalid token | token错误 |
| 10005 | invalid code | 验证码错误 |
| 10006 | sms server error | 短信服务超过次数 |
| 10007 | email server error | 邮件服务错误 |
| 10008 | invalid refresh token | 刷新token失败 |
| 10009 | code expired | 验证码过期 |
| 10010 | account has existed | 账号已注册 |
| 10011 | 字段不合法校验 | |
| 10012 | sms error | 短信服务发送错误 |
POST /api/auth/send_code
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| account | 字符串 | 是 | 手机或邮箱 |
| area | 字符串 | 可选 | 手机区号;默认为86,另外当account不为手机号时,此参数无效 |
{"code": 0,"message": "success","data": {}}
POST /api/auth/check_code
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| account | 字符串 | 是 | 手机或邮箱 |
| code | 字符串 | 是 | 验证码 |
| area | 字符串 | 可选 | 手机区号;默认为86,另外当account不为手机号时,此参数无效 |
{"code": 0,"message": "success","data": {}}
POST /api/auth/code_login
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| account | 字符串 | 是 | 手机或邮箱 |
| code | 字符串 | 是 | 验证码 |
| area | 字符串 | 可选 | 手机区号;默认为86,另外当account不为手机号时,此参数无效 |
{"code": 0,"message": "success","data": {"access_token": "4kbv6KFHyIJ4JECtFuRLZreHRwDz3Yo6f19fgpu5VYgnSIegN1","refresh_token": "pdgSDcfbZsEijvB1yH6RVGXutQWM4fF5qcCxz033AhaokshiwU","expires_at": "2018-08-23 10:47:16","expires_in": 68400}}
| 参数 | 类型 | 说明 |
|---|---|---|
| access_token | 字符串 | 接口请求访问 token |
| refresh_token | 字符串 | 用户刷新 token |
| expires_at | 字符串 | access_token有效期截止时间 |
| expires_in | 整型 | access_token有效时长(单位:秒) |
POST /api/auth/check_account
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| account | 字符串 | 是 | 手机或邮箱 |
| area | 字符串 | 可选 | 手机区号;默认为86,另外当account不为手机号时,此参数无效 |
{"code": 0,"message": "success","data": {"status": 0}}
| 参数 | 类型 | 说明 |
|---|---|---|
| status | 整型 | 1:已注册, 0:未注册 |
POST /api/auth/register
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| account | 字符串 | 是 | 手机或邮箱 |
| password | 字符串 | 是 | 密码 |
| code | 字符串 | 是 | 验证码 |
| area | 字符串 | 可选 | 手机区号;默认为86,另外当account不为手机号时,此参数无效 |
{"code": 0,"message": "success","data": {"access_token": "4kbv6KFHyIJ4JECtFuRLZreHRwDz3Yo6f19fgpu5VYgnSIegN1","refresh_token": "pdgSDcfbZsEijvB1yH6RVGXutQWM4fF5qcCxz033AhaokshiwU","expires_at": "2018-08-23 10:47:16","expires_in": 68400}}
| 参数 | 类型 | 说明 |
|---|---|---|
| access_token | 字符串 | 接口请求访问 token |
| refresh_token | 字符串 | 用户刷新 token |
| expires_at | 字符串 | access_token有效期截止时间 |
| expires_in | 整型 | access_token有效时长(单位:秒) |
POST /api/auth/access_token
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| account | 字符串 | 是 | 手机或邮箱 |
| password | 字符串 | 是 | 密码 |
| area | 字符串 | 可选 | 手机区号;默认为86,另外当account不为手机号时,此参数无效 |
{"code": 0,"message": "success","data": {"access_token": "4kbv6KFHyIJ4JECtFuRLZreHRwDz3Yo6f19fgpu5VYgnSIegN1","refresh_token": "pdgSDcfbZsEijvB1yH6RVGXutQWM4fF5qcCxz033AhaokshiwU","expires_at": "2018-08-23 10:47:16","expires_in": 68400}}
| 参数 | 类型 | 说明 |
|---|---|---|
| access_token | 字符串 | 接口请求访问 token |
| refresh_token | 字符串 | 用户刷新 token |
| expires_at | 字符串 | access_token有效期截止时间 |
| expires_in | 整型 | access_token有效时长(单位:秒) |
POST /api/auth/refresh_token
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| refresh_token | 字符串 | 是 | 刷新token |
{"code": 0,"message": "success","data": {"access_token": "4kbv6KFHyIJ4JECtFuRLZreHRwDz3Yo6f19fgpu5VYgnSIegN1","refresh_token": "pdgSDcfbZsEijvB1yH6RVGXutQWM4fF5qcCxz033AhaokshiwU","expires_at": "2018-08-23 10:47:16","expires_in": 68400}}
| 参数 | 类型 | 说明 |
|---|---|---|
| access_token | 字符串 | 接口请求访问 token |
| refresh_token | 字符串 | 用户刷新 token |
| expires_at | 字符串 | access_token有效期截止时间 |
| expires_in | 整型 | access_token有效时长(单位:秒) |
POST /api/auth/destroy_token
{"Authorization": "Token 1234567890"}
{"code": 0,"message": "success","data": {}}
POST /api/auth/reset_username
{"Authorization": "Token 1234567890"}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| username | 字符串 | 是 | 用户名 |
{"code": 0,"message": "success","data": {}}
POST /api/auth/check_password
{"Authorization": "Token 1234567890"}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| password | 字符串 | 是 | 密码(6~16位) |
{"code": 0,"message": "success","data": {}}
POST /api/auth/reset_password
{"Authorization": "Token 1234567890"}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| password | 字符串 | 是 | 密码(6~16位) |
{"code": 0,"message": "success","data": {}}
POST /api/auth/reset_password_by_code
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| account | 字符串 | 是 | 手机或邮箱 |
| code | 字符串 | 是 | 验证码 |
| password | 字符串 | 是 | 密码(6~16位) |
| area | 字符串 | 可选 | 手机区号;默认为86,另外当account不为手机号时,此参数无效 |
{"code": 0,"message": "success","data": {}}
POST /api/auth/reset_password_by_old_password
{"Authorization": "Token 1234567890"}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| old_password | 字符串 | 是 | 旧密码(6~16位) |
| password | 字符串 | 是 | 新密码(6~16位) |
{"code": 0,"message": "success","data": {}}
GET /api/personal/info
{"Authorization": "Token 1234567890"}
{"code": 0,"message": "success","data": {"id": 2,"username": "admin","phone": "18656660930","email": "","register_time": "2018-12-20 17:00:52","age": 0,"job": "","name": "","city": "","company": "","avatar": "","birthday": "","address": "","nick_name": "","sex": 2,"login_time": "2019-01-04 11:49:31","login_ip": "202.96.204.195"}}
| 参数 | 类型 | 说明 |
|---|---|---|
| id | 整型 | 数据唯一标识 |
| username | 字符串 | 用户名;唯一,可拓展用于登录 |
| register_time | 字符串 | 注册时间 |
| login_time | 字符串 | 最后登录时间 |
| login_ip | 字符串 | 最后登录 ip |
| nick_name | 字符串 | 昵称 |
| sex | 整型 | 性别:0女1男2保密 |
| address | 字符串 | 地址 |
| birthday | 字符串 | 生日 |
| avatar | 字符串 | 头像链接 |
| company | 字符串 | 公司 |
| city | 字符串 | 城市 |
| name | 字符串 | 姓名 |
| job | 字符串 | 职位 |
| age | 字符串 | 年龄 |
| 字符串 | 邮箱 | |
| phone | 字符串 | 手机 |
PUT /api/personal/info
{"Authorization": "Token 1234567890"}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| avatar | 字符串 | 可选 | 头像 |
| birthday | 字符串 | 可选 | 生日 |
| sex | 整型 | 可选 | 性别:0女1男2保密 |
| city | 字符串 | 可选 | 城市 |
| address | 字符串 | 可选 | 地址 |
| company | 字符串 | 可选 | 公司 |
| job | 字符串 | 可选 | 职称 |
| name | 字符串 | 可选 | 姓名 |
| age | 字符串 | 可选 | 年龄 |
{"code": 0,"message": "success","data": {"id": 2,"username": "admin","phone": "18656660930","email": "","register_time": "2018-12-20 17:00:52","age": 0,"job": "","name": "","city": "","company": "","avatar": "","birthday": "","address": "","nick_name": "","sex": 2,"login_time": "2019-01-04 11:49:31","login_ip": "202.96.204.195"}}
| 参数 | 类型 | 说明 |
|---|---|---|
| id | 整型 | 数据唯一标识 |
| username | 字符串 | 用户名;唯一,可拓展用于登录 |
| register_time | 字符串 | 注册时间 |
| login_time | 字符串 | 最后登录时间 |
| login_ip | 字符串 | 最后登录 ip |
| nick_name | 字符串 | 昵称 |
| sex | 整型 | 性别:0女1男2保密 |
| address | 字符串 | 地址 |
| birthday | 字符串 | 生日 |
| avatar | 字符串 | 头像链接 |
| company | 字符串 | 公司 |
| city | 字符串 | 城市 |
| name | 字符串 | 姓名 |
| job | 字符串 | 职位 |
| age | 字符串 | 年龄 |
| 字符串 | 邮箱 | |
| phone | 字符串 | 手机 |
POST /api/push/bind
{"Authorization": "Token 1234567890"}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| client_id | 字符串 | 是 | 推送标识 |
| client_type | 字符串 | 是 | 客户端类型:android 或 ios |
{"code": 0,"message": "success","data": {"client_id": "xxxxxxxxx","client_type": "ios","user_id": 1,"created_at": "2018-08-22 16:06:00","updated_at": "2018-08-22 16:06:00",}}
POST /api/push/switch
{"Authorization": "Token 1234567890"}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| switch | 布尔型 | 是 | 推送开关, 可为空值,就是false |
{"code": 0,"message": "success","data": {"switch": true,"user_id": 1,"created_at": "2018-08-22 16:06:00","updated_at": "2018-08-22 16:06:00",}}
GET /api/push/switch
{"Authorization": "Token 1234567890"}
{"code": 0,"message": "success","data": {"switch": true,"user_id": 1,"created_at": "2018-08-22 16:06:00","updated_at": "2018-08-22 16:06:00",}}
POST /api/device/bind
{"Authorization": "Token 1234567890"}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| iot_id | 字符串 | 是 | 设备标识 |
| is_superuser | 布尔型 | 是 | 是否是管理员 |
| identify_id | 字符串 | 可选 | 飞燕用户唯一标识 |
| longitude | 浮点型 | 可选 | 经度 |
| latitude | 浮点型 | 可选 | 纬度 |
{"code": 0,"message": "success","data": {"iot_id": "xxxxxxxxx","user_id": 1,"is_superuser": true}}
DELETE /api/device/bind
{"Authorization": "Token 1234567890"}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| iot_id | 字符串 | 是 | 设备标识 |
| is_superuser | 布尔型 | 是 | 是否是管理员 |
{"code": 0,"message": "success","data": {}}
GET /api/device/bind
{"Authorization": "Token 1234567890"}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| iot_id | 字符串 | 是 | 设备标识 |
* 请求回调
{"code": 0,"message": "success","data": {"users": [{"phone": "13162119608","nick_name": "1316211960","avatar": "","user_id": 32,"date_time": "2019-04-08 16:31:29","identify_id": ""}]}}
POST /api/device/share_user_remove
{"Authorization": "Token 1234567890"}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| iot_id | 字符串 | 是 | 设备标识 |
| user_id | 字符串 | 是 | 用户id |
* 请求回调
{"code": 0,"message": "success","data": {}}
GET /api/device/info/{iot_id}
{"Authorization": "Token 1234567890"}
{"code": 0,"message": "success","data": {"_id": 2005,"gmtModified": 1548330753000,"activeTime": 1547022466000,"deviceKey": "MjhNcivkJL5Bz7i6Ocgi","statusLast": 1,"productKey": "a1JJL4qVSdo","gmtCreate": 1545905659000,"iotId": "MjhNcivkJL5Bz7i6Ocgi0010bb2f00","deviceSecret": "uesA8OVEP3805YwW7rnR9ceVcEKMCVDZ","name": "device1","thingType": "DEVICE","region": "cn-shanghai","firmwareVersion": "app-1.0.0","rbacTenantId": "0FCD57C6F767495CAB15DA2A8B48436B","status": 3,"status_update_time": "2019-01-24 19:52:33","online_time": 0,"mac": "b0:f8:93:20:c4:93","pipelined_code": "","property": {"FilterLifeTimeDays_1": {"value": 100,"time": 1547719392499},"FilterPosition": {"value": "PP","time": 1547795983231},"FilterLifeTimePercent_1": {"value": 100,"time": 1547719392499},"FilterSN": {"value": "123324344234555","time": 1547719392499},"WaterDepletionStatus": {"value": 1,"time": 1547719367382},"HeatingStatus": {"value": 1,"time": 1547719367382},"FinishedWaterTDS": {"value": 232,"time": 1547719366383},"RawWaterTDS": {"value": 244,"time": 1547719389505},"WaterTemperature": {"value": 32,"time": 1547719364369},"WasteWaterAdjustStatus": {"value": 1,"time": 1547719349345},"FilterLifeTimeDays_2": {"value": 50,"time": 1547719370397},"FilterLifeTimePercent_2": {"value": 50,"time": 1547719370397}},"date_time": "2019-01-17 17:46:47","sn": "","is_bind": true,"superuser_name": "15502112361","superuser_id": 9}}
GET /api/device/superuser/{iot_id}
{"Authorization": "Token 1234567890"}
{"code": 0,"message": "success","data": {"superuser_id": 13,"superuser_name": "发货吗好"}}
{"code": 10015,"message": "没有找到设备的超级用户","data": {}}
GET /api/screen/page
{"code": 0,"message": "success","data": {"id": 8,"app_id": "","created_at": "2018-12-20 14:26:26","updated_at": "2018-12-20 14:26:26","picture": "xxxxxx","start_time": "2018-12-12 12:00:00","end_time": "2019-12-23 10:00:00","countdown": 3,"category": 1,"external_link": ""}}
| 参数 | 类型 | 说明 |
|---|---|---|
| picture | 字符串 | 图片地址 |
| start_time | 字符串 | 有效起始时间 |
| end_time | 字符串 | 有效结束时间 |
| countdown | 字符串 | 倒计时(单位:秒) |
| external_link | 字符串 | 外部链接 |
GET /api/app/version
{"code": 0,"message": "success","data": {"ios": {"id": 2,"app_id": "","created_at": "2018-10-09 00:00:00","updated_at": "2018-10-09 00:00:00","version_name": "苹果1.0.0","version_number": "1.0.0","version_description": "","app_type": "ios"},"android": {"id": 1,"app_id": "","created_at": "2018-10-09 00:00:00","updated_at": "2018-10-09 00:00:00","version_name": "安卓1.0.0","version_number": "1.0.0","version_description": "","app_type": "android"}}}
| 参数 | 类型 | 说明 |
|---|---|---|
| created_at | 字符串 | 数据存储时间 |
| updated_at | 字符串 | 数据更新时间 |
| id | 整型 | 数据唯一标识 |
| version_name | 字符串 | 版本名称 |
| version_number | 字符串 | 版本号 |
| app_type | 字符串 | app 类型 |
GET /api/system/links
{"code": 0,"message": "success","data": {"links": [{"name": "link_1","link": "https://www.baidu.com","label": "加湿器滤网购买链接"},{"name": "link_2","link": "https://www.baidu.com","label": "S100净水器滤芯购买链接"},{"name": "link_3","link": "https://www.bhttps://detail.tmall.com/item.htm?spm=a212k0.12153887.0.0.61c0687dRqWOGw&id=595084638484&skuId=4138526613575aidu.com","label": "S100净水器1号滤芯购买链接"},{"name": "link_4","link": "https://detail.tmall.com/item.htm?spm=a212k0.12153887.0.0.61c0687dRqWOGw&id=595084638484&skuId=4138526613575","label": "S100净水器2号滤芯购买链接"},{"name": "link_5","link": "http://115.28.161.90:8003/document/29","label": "352用户协议"},{"name": "link_6","link": "http://115.28.161.90:8003/document/H60","label": "Skin自然蒸发加湿器使用说明"},{"name": "link_7","link": "http://115.28.161.90:8003/document/S100","label": "S100净水机使用说明"},{"name": "link_8","link": "https://www.jd.com","label": "配置失败"},{"name": "link_9","link": "http://115.28.161.90:8003/document/Y100","label": "Y100空气净化器说明书"},{"name": "link_10","link": "https://www.jd.com","label": "Y100空气净化器购买链接"},{"name": "link_11","link": "https://www.jd.com","label": "Y100C空气净化器购买链接"},{"name": "link_12","link": "http://115.28.161.90:8003/document/Y100C","label": "Y100C空气净化器说明书"},{"name": "link_13","link": "http://115.28.161.90:8003/document/K10","label": "K10净水器使用说明书"},{"name": "link_14","link": "https://www.jd.com","label": "K10净水器滤芯购买链接"},{"name": "link_15","link": "https://www.jd.com","label": "K10净水器1号滤芯购买链接"},{"name": "link_16","link": "https://www.jd.com","label": "K10净水器2号滤芯购买链接"},{"name": "link_17","link": "https://www.mxchip.com","label": "X86空气净化器说明书"},{"name": "link_18","link": "https://www.mxchip.com","label": "X86空气净化器上(1号)滤芯购买链接"},{"name": "link_19","link": "https://www.mxchip.com","label": "X86空气净化器中(2号)滤芯购买链接"},{"name": "link_20","link": "https://www.mxchip.com","label": "X86空气净化器下(3号)滤芯购买链接"},{"name": "link_21","link": "https://www.mxchip.com","label": "X86C空气净化器说明书"},{"name": "link_22","link": "https://www.mxchip.com","label": "X86C空气净化器上(1号)滤芯购买链接"},{"name": "link_23","link": "https://www.mxchip.com","label": "X86C空气净化器中(2号)滤芯购买链接"},{"name": "link_24","link": "https://www.mxchip.com","label": "X86C空气净化器下(3号)滤芯购买链接"},{"name": "link_25","link": "https://www.mxchip.com","label": "智感模式说明"},{"name": "link_26","link": "https://www.mxchip.com","label": "X86空气净化器滤芯购买链接"},{"name": "link_27","link": "https://www.mxchip.com","label": "X86C空气净化器滤芯购买链接"}]}}
| 参数 | 类型 | 说明 |
|---|---|---|
| name | 字符串 | 链接名称 |
| link | 字符串 | 链接地址 |
| label | 字符串 | 链接描述 |
POST /api/upload
{"Authorization": "Token 1234567890"}
参数:batch 请求方式:form-data 附件大小:<= 300kb
{"code": 0,"message": "success","data": {"batch_path": "/public/img/xxx/jpg"}}
| 参数 | 类型 | 说明 |
|---|---|---|
| batch_path | 字符串 | 附件地址 |
GET /api/feedback/category
{"Authorization": "Token 1234567890"}
{"code": 0,"message": "success","data": {"total": 1,"pages": 1,"current_page": 1,"page_size": 20,"data": [{"id": 1,"app_id": "","created_at": "2018-12-26 17:40:25","updated_at": "2018-12-26 17:40:25","feedback_category_name": "其他","feedback_category_description": ""}]}}
| 参数 | 类型 | 说明 |
|---|---|---|
| created_at | 字符串 | 数据存储时间 |
| updated_at | 字符串 | 数据更新时间 |
| id | 整型 | 数据唯一标识 |
| feedback_category_name | 字符串 | 反馈类型名称 |
| feedback_category_description | 字符串 | 反馈类型描述 |
GET /api/feedback
{"Authorization": "Token 1234567890"}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| page | 整型 | 可选 | 分页页数 |
| size | 整型 | 可选 | 一页数据数量 |
* 请求回调
{"code": 0,"message": "success","data": {"total": 1,"pages": 1,"current_page": 1,"page_size": 20,"data": [{"id": 1,"app_id": "","created_at": "2018-12-27 15:43:42","updated_at": "2018-12-27 15:43:42","feedback_content": "反馈内容","feedback_status": 1,"feedback_category_id": 0,"contact_phone": "","user_id": 3}]}}
| 参数 | 类型 | 说明 |
|---|---|---|
| created_at | 字符串 | 数据存储时间 |
| updated_at | 字符串 | 数据更新时间 |
| id | 整型 | 数据唯一标识 |
| user_id | 整型 | 用户唯一标识 |
| feedback_content | 字符串 | 反馈内容 |
| feedback_status | 整型 | 反馈状态:0待处理;1已处理 |
| feedback_category_id | 整型 | 反馈类型唯一标识 |
| contact_phone | 字符串 | 联系电话 |
DELETE /api/feedback/{feedback_id}
{"Authorization": "Token 1234567890"}
{"code": 0,"message": "success","data": {}}
POST /api/feedback
{"Authorization": "Token 1234567890"}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| feedback_content | 字符串 | 是 | 反馈内容 |
| feedback_category_id | 整型 | 可选 | 反馈类型id |
| contact_phone | 字符串 | 可选 | 联系方式 |
| app_version | 字符串 | 可选 | app版本 |
| app_category | 字符串 | 可选 | app类型:ios, android |
* 请求回调
{"code": 0,"message": "success","data": {"id": 1,"app_id": "","created_at": "2018-12-27 15:43:42","updated_at": "2018-12-27 15:43:42","feedback_content": "反馈内容","feedback_status": 1,"feedback_category_id": 0,"contact_phone": "","user_id": 3}}
GET /api/feedback/reply/{feedback_id}
{"Authorization": "Token 1234567890"}
{"code": 0,"message": "success","data": {}}
POST /api/user/address
{"Authorization": "Token 1234567890"}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| longitude | 浮点型 | 是 | 经度 |
| latitude | 浮点型 | 是 | 纬度 |
{"code": 0,"message": "success","data": {"_id": 4,"longitude": 33.555,"latitude": 33.333,"detail": {},"user_id": 2,"date_time": "2019-01-03 16:41:21"}}
| 参数 | 类型 | 说明 |
|---|---|---|
| date_time | 字符串 | 数据存储时间 |
| _id | 整型 | 数据唯一标识 |
| longitude | 浮点型 | 经度 |
| latitude | 浮点型 | 纬度 |
| detail | json | 地理位置详情 |
| user_id | 整型 | 用户唯一标识 |
GET /api/user/address
{"Authorization": "Token 1234567890"}
{"code": 0,"message": "success","data": {"_id": 4,"longitude": 33.555,"latitude": 33.333,"detail": {},"user_id": 2,"date_time": "2019-01-03 16:41:21"}}
| 参数 | 类型 | 说明 |
|---|---|---|
| date_time | 字符串 | 数据存储时间 |
| _id | 整型 | 数据唯一标识 |
| longitude | 浮点型 | 经度 |
| latitude | 浮点型 | 纬度 |
| detail | json | 地理位置详情 |
| user_id | 整型 | 用户唯一标识 |
POST /api/device/address
{"Authorization": "Token 1234567890"}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| longitude | 浮点型 | 是 | 经度 |
| latitude | 浮点型 | 是 | 纬度 |
| iot_id | 字符串 | 是 | 设备唯一标识 |
{"code": 0,"message": "success","data": {"_id": 4,"longitude": 33.555,"latitude": 33.333,"detail": {},"iot_id": "xxxxxxxxx","date_time": "2019-01-03 16:41:21"}}
| 参数 | 类型 | 说明 |
|---|---|---|
| date_time | 字符串 | 数据存储时间 |
| _id | 整型 | 数据唯一标识 |
| longitude | 浮点型 | 经度 |
| latitude | 浮点型 | 纬度 |
| detail | json | 地理位置详情 |
| iot_id | 字符串 | 设备唯一标识 |
GET /api/device/address/{iot_id}
{"Authorization": "Token 1234567890"}
{"code": 0,"message": "success","data": {"_id": 4,"longitude": 33.555,"latitude": 33.333,"detail": {},"iot_id": "xxxxxxxxx","date_time": "2019-01-03 16:41:21"}}
| 参数 | 类型 | 说明 |
|---|---|---|
| date_time | 字符串 | 数据存储时间 |
| _id | 整型 | 数据唯一标识 |
| longitude | 浮点型 | 经度 |
| latitude | 浮点型 | 纬度 |
| detail | json | 地理位置详情 |
| iot_id | 字符串 | 设备唯一标识 |
GET /api/faq
{"Authorization": "Token 1234567890"}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| page | 整型 | 可选 | 分页页数 |
| size | 整型 | 可选 | 一页数据数量 |
| product_key | 字符串 | 可选 | 产品key |
{"code": 0,"message": "success","data": {"total": 2,"pages": 1,"current_page": 1,"page_size": 20,"data": [{"id": 2,"app_id": "","created_at": "2019-01-29 10:36:04","updated_at": "2019-04-30 10:45:49","title": "使用说明","content": "测试测试","product_key": "a1JJL4qVSdo","external_link": ""}]}}
GET /api/faq/{id}
{"Authorization": "Token 1234567890"}
{"code": 0,"message": "success","data": {"id": 2,"app_id": "","created_at": "2019-01-29 10:36:04","updated_at": "2019-04-30 10:45:49","title": "使用说明","content": "测试测试","product_key": "a1JJL4qVSdo","external_link": ""}}
GET /api/statistics/pure_waste_water
{"Authorization": "Token 1234567890"}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| iot_id | 字符串 | 是 | 设备唯一标识 |
| category | 字符串 | 是 | 查询维度:hour(小时);day(天);week(周); month(月) |
| size | 整型 | 是 | 查询数量(最近多少 小时/天/周/月 的数据量) |
{"code": 0,"message": "success","data": {"statistics": [{"date_time": "2019-01-14","pure_water": 0,"waste_water": 0,"water_time": 0}]}}
| 参数 | 类型 | 说明 |
|---|---|---|
| date_time | 字符串 | 根据月,周,日,转换的对应的时间格式 |
| pure_water | 整型 | 纯水量 |
| waste_water | 整型 | 废水量 |
| water_time | 整型 | 制水时长 |
GET /api/statistics/one_pure_waste_water
{"Authorization": "Token 1234567890"}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| iot_id | 字符串 | 是 | 设备唯一标识 |
{"code": 0,"message": "success","data": {"statistics": [{"_id": 0,"date_time": "2018-10-10 10:00:00","start_time": "2018-10-10 09:00:00","one_water_time": 20,"one_pure_water": 0,"one_waste_water": 0,"one_water": 0,"raw_water_tds": 3,"finished_water_tds": 1}]}}
| 参数 | 类型 | 说明 |
|---|---|---|
| date_time | 字符串 | 数据存储时间 |
| start_time | 字符串 | 开始制水时间 |
| one_water_time | 整型 | 制水时长(单位:秒) |
| one_pure_water | 整型 | 纯水量 |
| one_waste_water | 整型 | 废水量 |
| one_water | 整型 | 进水量 |
| raw_water_tds | 整型 | 进水tds |
| finished_water_tds | 整型 | 出水tds |
GET /api/statistics/temperature_humidity
{"Authorization": "Token 1234567890"}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| iot_id | 字符串 | 是 | 设备唯一标识 |
| category | 字符串 | 是 | 查询维度:hour(小时);day(天);week(周); month(月) |
| size | 整型 | 是 | 查询数量(最近多少 小时/天/周/月 的数据量) |
{"code": 0,"message": "success","data": {"statistics": [{"date_time": "2019-04-17 12:00","humidity": 54.46885245901639,"temperature": 23.39090909090909},{"date_time": "2019-04-17 13:00","humidity": 0,"temperature": 0},{"date_time": "2019-04-17 14:00","humidity": 0,"temperature": 0},{"date_time": "2019-04-17 15:00","humidity": 44.64166666666667,"temperature": 26.7375}]}}
| 参数 | 类型 | 说明 |
|---|---|---|
| date_time | 字符串 | 根据月,周,日,转换的对应的时间格式 |
| humidity | 浮点型 | 平均湿度 |
| temperature | 浮点型 | 平均温度 |
GET /api/statistics/pm25
{"Authorization": "Token 1234567890"}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| iot_id | 字符串 | 是 | 设备唯一标识 |
| category | 字符串 | 是 | 查询维度:hour(小时);day(天);week(周); month(月) |
| size | 整型 | 是 | 查询数量(最近多少 小时/天/周/月 的数据量) |
{"code": 0,"message": "success","data": {"statistics": [{"date_time": "2019-04-17 12:00","pm25": 55},{"date_time": "2019-04-17 12:00","pm25": 55},{"date_time": "2019-04-17 12:00","pm25": 55},{"date_time": "2019-04-17 12:00","pm25": 55}]}}
| 参数 | 类型 | 说明 |
|---|---|---|
| date_time | 字符串 | 根据月,周,日,转换的对应的时间格式 |
| pm25 | 整型 | PM2.5值 |
GET /api/statistics/outdoor_pm25
GET /api/statistics/hcho
{"Authorization": "Token 1234567890"}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| iot_id | 字符串 | 是 | 设备唯一标识 |
| category | 字符串 | 是 | 查询维度:hour(小时);day(天);week(周); month(月) |
| size | 整型 | 是 | 查询数量(最近多少 小时/天/周/月 的数据量) |
{"code": 0,"message": "success","data": {"statistics": [{"date_time": "2019-04-17 12:00","hcho": 55},{"date_time": "2019-04-17 12:00","hcho": 55},{"date_time": "2019-04-17 12:00","hcho": 55},{"date_time": "2019-04-17 12:00","hcho": 55}]}}
| 参数 | 类型 | 说明 |
|---|---|---|
| date_time | 字符串 | 根据月,周,日,转换的对应的时间格式 |
| hcho | 浮点型型 | 甲醛值 |
GET /api/statistics/tvoc
{"Authorization": "Token 1234567890"}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| iot_id | 字符串 | 是 | 设备唯一标识 |
| category | 字符串 | 是 | 查询维度:hour(小时);day(天);week(周); month(月) |
| size | 整型 | 是 | 查询数量(最近多少 小时/天/周/月 的数据量) |
GET /api/statistics/tvoc?iot_id=Gso6EuIKwfJJPbSvuWVH000100&category=hour&size=3{"code": 0,"message": "success","data": {"statistics": [{"tvoc": 0.0,"date_time": "2020-02-27 08:00"},{"tvoc": 77.73154362416108,"date_time": "2020-02-27 09:00"},{"tvoc": 88.27835051546391,"date_time": "2020-02-27 10:00"}]}}
| 参数 | 类型 | 说明 |
|---|---|---|
| date_time | 字符串 | 根据月,周,日,转换的对应的时间格式 |
| tvoc | 浮点型型 | tvoc均值 |
GET /api/push/message
{"Authorization": "Token 1234567890"}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| page | 整型 | 可选 | 分页页数 |
| size | 整型 | 可选 | 一页数据数量 |
* 请求回调
{"code": 0,"message": "success","data": {"total": 3,"pages": 1,"current_page": 1,"page_size": 20,"data": [{"id": 3,"app_id": "","created_at": "2019-03-08 16:12:28","updated_at": "2019-03-08 16:12:28","push_title": "一起来嗨皮","push_body": "一起来嗨皮","user_scope": "群推","user_id": 12,"push_status": 1},{"id": 4,"app_id": "","created_at": "2019-03-08 21:14:18","updated_at": "2019-03-08 21:14:18","push_title": "dfgdf","push_body": "dfgdf","user_scope": "指定用户","user_id": 2,"push_status": 0},{"id": 5,"app_id": "","created_at": "2019-03-15 14:18:49","updated_at": "2019-03-15 14:18:49","push_title": "春天到了,一起去浪啊","push_body": "春天到了,一起去浪啊","user_scope": "指定用户","user_id": 12,"push_status": 0}]}}
| 参数 | 类型 | 说明 |
|---|---|---|
| push_status | 整型 | 0未读;1已读;2已删除 |
GET /api/push/message/{push_id}
{"Authorization": "Token 1234567890"}
{"code": 0,"message": "success","data": {"id": 3,"app_id": "","created_at": "2019-03-08T16:12:28.475168","updated_at": "2019-03-08T16:12:28.475596","push_title": "一起来嗨皮","push_body": "一起来嗨皮","user_scope": "群推","user_id": 12,"push_status": 1}}
DELETE /api/push/message/{push_id}
{"Authorization": "Token 1234567890"}
{"code": 0,"message": "success","data": {}}
POST /api/push/message/group_delete
{"Authorization": "Token 1234567890"}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| push_ids | 字符串 | 是 | push_id 英文逗号拼接的字符串 |
* 请求回调
{"code": 0,"message": "success","data": {}}
GET /api/message/status
{"Authorization": "Token 1234567890"}
{"code": 0,"message": "success","data": {"feedback": 0,"push": 0,"error": 0}}
GET /api/error/code
{"Authorization": "Token 1234567890"}
{"code": 0,"message": "success","data": {"errors": [{"_id": 1,"product_key": "a1JJL4qVSdo","error_code": "PPRFIDErr","iot_id": "OxOgpXQpphR8A3XqsXOm000100","date_time": "2019-04-29T16:26:41.381000","device_version": "2.0_Y100-0.20_Y100-1.37_EMW120"}]}}
GET /api/error/code/{iot_id}
{"Authorization": "Token 1234567890"}
{"code": 0,"message": "success","data": {"errors": [{"_id": 1,"product_key": "a1JJL4qVSdo","error_code": "PPRFIDErr","iot_id": "OxOgpXQpphR8A3XqsXOm000100","date_time": "2019-04-29T16:26:41.381000","device_version": "2.0_Y100-0.20_Y100-1.37_EMW120"}]}}
GET /api/oss
{"Authorization": "Token 1234567890"}
{"code": 0,"message": "success","data": {"RequestId": "B45B2931-05F9-40B4-BC86-9DC7BA188182","AssumedRoleUser": {"AssumedRoleId": "344052235942587077:352img","Arn": "acs:ram::xxx:role/xxx/xxx"},"Credentials": {"AccessKeySecret": "xxx","AccessKeyId": "STS.xxx","Expiration": "2019-05-22T04:33:23Z","SecurityToken": "+sbv/g1mWBogA99V172/PMpGQRw1tSywW2XzruRUgCUACEY4SdA="},"bucket_name": "3xxx","endpoint": "oss-cn-beijing.aliyuncs.com"}}