@cfygaoyang
2018-04-08T07:56:09.000000Z
字数 8252
阅读 573
sds
GET /api/get_token?account=18888888888&verify_code=123456&app_id=xxxx-xxx-xxx-xxx
GET /api/get_token?account=18888888888&password=123456&app_id=xxxx-xxx-xxx-xxx
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| account | 字符串 | 是 | 手机或邮箱 |
| verify_code | 字符串 | 是 | 验证码 |
| app_id | 字符串 | 是 | 厂商的APP_ID |
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| account | 字符串 | 是 | 手机或邮箱 |
| password | 字符串 | 是 | 密码 |
| app_id | 字符串 | 是 | 厂商的APP_ID |
* 请求回调
{"message":{"token_expire_in":604800,"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoidG9rZW4iLCJ1c2VyX2lkIjoxLCJ0b2tlbl90aW1lIjoxNTA4NDY3NDAyfQ.ps7dPdN6-16ip5f4-fgfBZ5ye9Qu6oH9ADjz0iH1nvs","refresh_token_expire_in":1209600,"refresh_token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaF90b2tlbiIsInVzZXJfaWQiOjEsInRva2VuX3RpbWUiOjE1MDkwNzIyMDJ9.1r6PRGStReI1YFUrgggCovF5DAiS9gWMBY8DXOi2zPs"},"code":0}
| 参数 | 类型 | 说明 |
|---|---|---|
| token_expire_in | 整形 | token有效时间(秒) |
| token | 字符串 | token |
| refresh_token_expire_in | 整形 | refresh_token有效时间(秒) |
| refresh_token | 字符串 | refresh_token |
POST /api/oepn
添加hedaer Authorization
请求参数
{"open_id": "sdfghjklertyuio","open_type": 1,"app_id": "dyuiosdfghjklsdfghjkl"}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| open_id | 字符串 | 是 | 第三方账号id |
| open_type | 字符串 | 是 | 第三方账号类型: 1.QQ 2.微信 3.微博 4.淘宝 |
| app_id | 字符串 | 是 | 厂商的APP_ID |
{"code": 0,"message": {"data": {"open_id": "sdfghjklertyuio","open_type": 1,"app_id": "dyuiosdfghjklsdfghjkl","user_id": 1}}}
GET /api/get_token_by_open?open_id=18888888888&open_type=1&app_id=xxxx-xxx-xxx-xxx
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| open_id | 字符串 | 是 | 第三方账号id |
| open_type | 字符串 | 是 | 第三方账号类型: 1.QQ 2.微信 3.微博 4.淘宝 |
| app_id | 字符串 | 是 | 厂商的APP_ID |
* 请求回调
{"message":{"token_expire_in":604800,"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoidG9rZW4iLCJ1c2VyX2lkIjoxLCJ0b2tlbl90aW1lIjoxNTA4NDY3NDAyfQ.ps7dPdN6-16ip5f4-fgfBZ5ye9Qu6oH9ADjz0iH1nvs","refresh_token_expire_in":1209600,"refresh_token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaF90b2tlbiIsInVzZXJfaWQiOjEsInRva2VuX3RpbWUiOjE1MDkwNzIyMDJ9.1r6PRGStReI1YFUrgggCovF5DAiS9gWMBY8DXOi2zPs"},"code":0}
| 参数 | 类型 | 说明 |
|---|---|---|
| token_expire_in | 整形 | token有效时间(秒) |
| token | 字符串 | token |
| refresh_token_expire_in | 整形 | refresh_token有效时间(秒) |
| refresh_token | 字符串 | refresh_token |
PUT /api/reset_token
{"refresh_token": "1234567890"}
{"message":{"token_expire_in":604800,"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoidG9rZW4iLCJ1c2VyX2lkIjoxLCJ0b2tlbl90aW1lIjoxNTA4NDY3NDAyfQ.ps7dPdN6-16ip5f4-fgfBZ5ye9Qu6oH9ADjz0iH1nvs","refresh_token_expire_in":1209600,"refresh_token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaF90b2tlbiIsInVzZXJfaWQiOjEsInRva2VuX3RpbWUiOjE1MDkwNzIyMDJ9.1r6PRGStReI1YFUrgggCovF5DAiS9gWMBY8DXOi2zPs"},"code":0}
| 参数 | 类型 | 说明 |
|---|---|---|
| token_expire_in | 整形 | token有效时间(秒) |
| token | 字符串 | token |
| refresh_token_expire_in | 整形 | refresh_token有效时间(秒) |
| refresh_token | 字符串 | refresh_token |
GET /api/get_verify_code?account=18888888888
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| account | 字符串 | 是 | 手机或邮箱 |
{"code": 0,"message": {"verify_code": "123456"}}
PUT /api/user/reset_password
{"Authorization" :"1234567890qwertyuio"}
{"user_password": "1234567890"}
{"code": 0,"message": "reset_password success"}
GET /api/user/message
{"Authorization" :"1234567890qwertyuio"}
{"message": {"user_avatar": "","user_message_id": 1,"created_at": "2017-10-16T18:00:22.227008","updated_at": "2017-10-16T18:00:22.227059","user_telephone": "18656660930","user_id": 1,"user_name": "18656660930","user_email": "","user_sex": 1,"user_birthday": "2017-10-10","user_city": "shanghai","user_name": "nickname",},"code": 0}
PUT /api/user/message
{"Authorization" :"1234567890qwertyuio"}
{"user_avatar": "http://xxx.com/123.jpg","user_sex": 1,"user_birthday": "2017-10-10","user_city": "shanghai","user_name": "nickname",}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| user_avatar | 字符串 | 否 | 图片url |
| user_sex | 整型 | 否 | 性别 0:女 1:男 |
| user_birthday | 字符串 | 否 | 生日 |
| user_city | 字符串 | 否 | 城市 |
| user_name | 字符串 | 否 | 昵称 |
备注:不修改的参数不需要填写
{"code":0,"message": {"created_at": "2017-10-16T18:00:22.227008","updated_at": "2017-10-16T18:00:22.227059","user_id": 1,"user_avatar": "http://xxx.com/123.jpg","user_sex": 1,"user_birthday": "2017-10-10","user_city": "shanghai","user_name": "nickname",}}
POST /api/user/img
{"Authorization" :"1234567890qwertyuio"}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| img | File | 是 | 图片 |
备注:请求类型为form-data,允许的图片类型为"png,jpg,git"
{"code": 0,"message": "http://xxx.com/123.jpg"}
POST /api/user/feedback
{"Authorization" :"1234567890qwertyuio"}
{"feedback_title": "标题","feedback_content": "描述","feedback_type": "反馈类型","feedback_device": "设备uuid","feedback_model": "产品类型","feedback_status": "反馈状态"}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| feedback_title | 字符串 | 否 | 反馈标题 |
| feedback_content | 字符串 | 是 | 反馈描述 |
| feedback_type | 整形 | 否 | 反馈类型 0:设备问题,1:app问题 |
| feedback_device | 字符串 | 否 | 设备uuid |
| feedback_model | 字符串 | 否 | 产品类型 |
| feedback_status | 整形 | 否 | 反馈状态 0:待处理,1:处理中,2:已关闭 |
{"code": 0,"message": {反馈信息}}
GET /api/user/feedback?page={PAGE}
{"Authorization" :"1234567890qwertyuio"}
{"message": {"total": 1,"data": [反馈信息列表],"pages": 1,"page_size": 20,"current_page": 1},"code": 0}
GET /api/user/feedback/{pk}
{"Authorization" :"1234567890qwertyuio"}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| pk | 整形 | 是 | 反馈主键 feedback_id |
{"code": 0,"message": {反馈信息}}
PUT /api/user/feedback/{pk}
{"Authorization" :"1234567890qwertyuio"}
{"feedback_title": "标题","feedback_content": "描述","feedback_type": "反馈类型","feedback_device": "设备uuid","feedback_model": "产品类型","feedback_status": "反馈状态"}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| feedback_title | 字符串 | 否 | 反馈标题 |
| feedback_content | 字符串 | 是 | 反馈描述 |
| feedback_type | 整形 | 否 | 反馈类型 0:设备问题,1:app问题 |
| feedback_device | 字符串 | 否 | 设备uuid |
| feedback_model | 字符串 | 否 | 产品类型 |
| feedback_status | 整形 | 否 | 反馈状态 0:待处理,1:处理中,2:已关闭 |
{"code": 0,"message": {反馈信息}}
DELETE /api/user/feedback/{pk}
{"Authorization" :"1234567890qwertyuio"}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| pk | 整形 | 是 | 反馈主键 feedback_id |
{"code": 0,"message": "success"}
GET /api/user/feedback_reply/{pk}?page={PAGE}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| pk | 整形 | 是 | 反馈信息主键 feedback_id |
{"message": {"total": 1,"data": [回复信息列表],"pages": 1,"page_size": 20,"current_page": 1},"code": 0}
GET /faq?app_id={app_id}&page={PAGE}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| app_id | 字符串 | 是 | 产品唯一ID |
| page | 整形 | 否 | 页码 |
{"meta": {"message": "Success.","code": 0},"data": {"total": 1,"data": [{"faq_id": 2,"faq_title": "aaaa","faq_content": "ccccc"}],"pages": 1,"page_size": 20,"current_page": 1}}
GET /scroll
{"message": {"total": 1,"data": [{"scroll_id": 2,"app_id": "3758749b-4a05-492f-b737-08d0c142e3dc","created_at": "2018-01-22T11:07:24.834000","updated_at": "2018-01-22T11:07:32.258000","scroll_picture": "http://img.zcool.cn/community/018d4e554967920000019ae9df1533.jpg@900w_1l_2o_100sh.jpg","scroll_order": 1,"scroll_jump": "http://baidu.com"}],"pages": 1,"page_size": 20,"current_page": 1},"code": 0}
GET /scroll/{scroll_id}
{"Authorization" : {admin_token}}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| scroll_id | 整形 | 是 | 主键 scroll_id |
* 请求回调
{"message": {"scroll_id": 2,"app_id": "3758749b-4a05-492f-b737-08d0c142e3dc","created_at": "2018-01-22T11:07:24.834000","updated_at": "2018-01-22T11:07:32.258000","scroll_picture": "http://img.zcool.cn/community/018d4e554967920000019ae9df1533.jpg@900w_1l_2o_100sh.jpg","scroll_order": 1,"scroll_jump": "http://baidu.com"},"code": 0}
GET /sds_check_token?token={TOKEN}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| token | 字符串 | 是 | 用户token |
{"code": "1000","msg": "成功","description": "","data": {"userId": 1,"userNick": "name"}}
GET /api/weather?city={city}
GET /api/weather?location={location}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| city | 字符串 | 否 | 城市名称 例如:“上海” |
| location | 字符串 | 否 | 纬度,经度 例如:“31.22,121.48” |
备注:city或location必须填一个
{"message": {"city": "上海","img": "0","temp": "10","humidity": "43","weather": "晴","aqi": "轻度污染"},"code": 0}
GET /api/user/device_user/{device}?type={type}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| device | 字符串 | 是 | 设备id |
| type | 字符串 | 否 | 开锁类型,没有该参数则拉取所有用户 |
* 请求回调
{"code": 0,"message": {"total": 0,"data": [用户列表],"pages": 0,"page_size": 20,"current_page": 1}}
PUT /api/user/device_user/{device}
{"UserId": "1","UserName": "小明","UserType": "1","UserAvatar": "http://xxxxxxxx.xx/xxx.jpg"}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| device | 字符串 | 是 | 设备id |
| UserId | 字符串 | 是 | 锁用户id |
| UserType | 字符串 | 是 | 锁用户类型 0:无1密码2:指纹3:卡片4:遥控器5:钥匙 |
| UserName | 字符串 | 否 | 锁用户昵称 |
| UserAvatar | 字符串 | 否 | 头像地址 |
* 请求回调
{"code": 0,"message": "success"}
GET /api/user/device_days_record?page={page}&device={device}&days={days}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| device | 字符串 | 是 | 设备id |
| days | 整型 | 是 | 最近N天 |
| page | 整型 | 否 | 页数 |
{{"code": 0,"message": {"total": 0,"data": [记录列表],"pages": 0,"page_size": 20,"current_page": 1}}}
GET /api/user/device_type_record?page={page}&device={device}&type={type}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| device | 字符串 | 是 | 设备id |
| type | 整型 | 是 | 开锁类型 |
| page | 整型 | 否 | 页数 |
{{"code": 0,"message": {"total": 0,"data": [记录列表],"pages": 0,"page_size": 20,"current_page": 1}}}
GET /api/user/device/record/{device}?page={page}&days={days}&type={type}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| device | 字符串 | 是 | 设备id |
| type | 整型 | 否 | 开门类型,默认所有类型 |
| days | 整型 | 否 | 几天内,默认7天内 |
| page | 整型 | 否 | 页数,默认第1页 |
{{"code": 0,"message": {"total": 0,"data": [记录列表],"pages": 0,"page_size": 20,"current_page": 1}}}