# yefiot_access **Repository Path**: i3cloud/yefiot_access ## Basic Information - **Project Name**: yefiot_access - **Description**: 越凡门禁 - **Primary Language**: PHP - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2019-04-02 - **Last Updated**: 2023-08-10 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # **越凡门禁管理端API Oauth 2.0** #### 登录 - 方式:post - 地址:http://yef.szmzcx.com/oauth/token - 目的:取access_token > 发送 ``` {"grant_type":"password","client_id":"client_id","client_secret":"client_secret","username":"xxx","password":"xxx"} ``` > 接收 ``` { "token_type": "Bearer", "expires_in": 31622400, "access_token": "token", "refresh_token": "refresh_token" } ``` #### token过期刷新 - 方式:post - 地址:http://yef.szmzcx.com/oauth/token - 目的:取access_token > 发送 ``` {"grant_type":"refresh_token","client_id":"client_id","client_secret":"client_secret","refresh_token":"登录后得到的refresh_token"} ``` > 接收 ``` { "token_type": "Bearer", "expires_in": 31622400, "access_token": "token", "refresh_token": "refresh_token" } ``` #### 设备列表 - 方式:post - 地址:http://yef.szmzcx.com/admin/api/device - 目的:名下设备列表 > 请求头 ``` 'headers' => [ 'Accept' => 'application/json', 'Authorization' => 'Bearer '.$access_token,//登录获取到的access_token值 ], ``` > 发送 ``` 空 ``` > 接收 ``` [ { "mac": "522048550272", "slug": "Test" }, { "mac": "522048550173", "slug": "Test1" } ] ``` #### 设备详情 - 方式:post - 地址:http://yef.szmzcx.com/admin/api/device/mac - 目的:更具mac地址获取设备详情 > 请求头 ``` 'headers' => [ 'Accept' => 'application/json', 'Authorization' => 'Bearer '.$access_token,//登录获取到的access_token值 ], ``` > 发送 ``` {"mac":"522048550272"} ``` > 接收 ``` { "id": 24, "mac": "522048550272", "slug": "Test", "created_at": "2019-04-01 14:37:20", "updated_at": "2019-04-01 14:37:20", "agent_id": 5 } ``` #### 用户列表 - 方式:post - 地址:http://yef.szmzcx.com/admin/api/user - 目的:名下用户列表 > 请求头 ``` 'headers' => [ 'Accept' => 'application/json', 'Authorization' => 'Bearer '.$access_token,//登录获取到的access_token值 ], ``` > 发送 ``` 空 ``` > 接收 ``` [ { "id": 25, "name": "单", "mpid": "xxx", "mobile": "xxx", "card": "xxx", "phonemac": "xxx", "idcode": "xxx", "house_id": xx, "type": 1, "status": 1, "created_at": "2019-04-01 14:29:09", "updated_at": "2019-04-01 16:32:50", "agent_id": 5 }, { "id": 27, "name": "张x", "mpid": "xxx", "mobile": "xxx", "card": "xx", "phonemac": "xx", "idcode": "xxxx", "house_id": x, "type": 1, "status": 1, "created_at": "2019-04-01 15:05:25", "updated_at": "2019-04-01 15:11:27", "agent_id": 5 } ] ``` #### 房源列表 - 方式:post - 地址:http://yef.szmzcx.com/admin/api/house - 目的:名下房源列表 > 请求头 ``` 'headers' => [ 'Accept' => 'application/json', 'Authorization' => 'Bearer '.$access_token,//登录获取到的access_token值 ], ``` > 发送 ``` 空 ``` > 接收 ``` [ { "village": "昆明花园", "building": "A栋", "unit": "1单元", "num": "301" }, { "village": "昆明花园", "building": "A栋", "unit": "1单元", "num": "401" } ] ```