请求方式:GET
请求地址:https://open.populife.co/api/auth/access_token/get
| Query参数名 | 类型 | 必需 | 描述 | 示例 e.g. |
|---|---|---|---|---|
| appKey | string | 是 | 由Populife 开放平台提供的应用Key | 9JQJEPC0ZR9TC4 |
| appSecret | string | 是 | 由Populife 开放平台提供的应用密码 | b8047ecdb32dca1b0a6d5133fae43c60 |
详细说明:
Access token是Populife Open API授权的安全访问凭据。 在调用其他接口之前,必须先获取access token。 每次获取的access token的有效期为120分钟,再次获取会刷新有效期时间,同时前一次获取的access token会失效。 为避免重复调用资源浪费,请在本地服务器上有期限的缓存access token。
返回示例:
{
"success": true,
"code": 200,
"msg": null,
"data": {
"expire": 7200,
"accessToken": "NzMyNmU4MGJjYTk3OTgzODJmYzlhOTc0NWQxMzBlNzFmNTZhMTlmNTdkYjQ2NDFmNmM1OWZiM2JlOTI0ZjE2MQ=="
}
}
| Response参数名 | 描述 | 类型 |
|---|---|---|
| data.expire | 有效时间,单位:秒 | number |
| data.accessToken | 由Populife 开放平台提供的Access Token | string |
请求方式:GET
请求地址:https://open.populife.co/api/lock/list
| Query参数名 | 类型 | 必需 | 描述 | 示例 e.g. |
|---|---|---|---|---|
| appKey | string | 是 | 由Populife 开放平台提供的应用Key | 9JQJEPC0ZR9TC4 |
| accessToken | string | 是 | 由Populife 开放平台授权的Access Token | 1OWZiM2JlOTI0ZjE2MQ...== |
| pageNo | string | 是 | 页码,起始值为1 | 1 |
| pageSize | string | 是 | 页数据行数,即每一页显示多少行数据 | 20 |
详细说明:
查询当前AppKey账户下拥有的所有锁列表信息。 在您向Populife取得appKey和appSecret后,请将您在Populife App中注册的用户账号提供给Populife技术支持人员, 技术支持人员会将您的Populife App用户与appKey关联在一起。 最后您可以通过本接口查询你的企业关联用户在Populife App绑定的锁列表信息。 获取锁信息后,您可以通过生成按键密码接口生成某一把锁的按键开锁密码。
返回示例:
{
"success": true,
"code": 200,
"msg": null,
"data": [
{
"lockId": 723716,
"name": "PPL-ML-E6DE5",
"alias": "PPL-ML-E6DE5",
"mac": "C4:E8:4D:34:32:A5",
"electricQuantity": 100,
"modelNum": "SN138_PPL-DB",
"hardwareRevision": "1.0",
"firmwareRevision": "1.0.0.1108",
"initDate": 1623314021000
}
]
}
| Response参数名 | 描述 | 类型 |
|---|---|---|
| data.hardwareRevision | 锁的硬件版本 | string |
| data.lockId | Populife锁类产品的数字标识 | number |
| data.name | 锁的蓝牙名称,即绑定设备时蓝牙扫描到的产品序列号 | string |
| data.alias | 锁的别名,即用户定义的的锁名称 | string |
| data.mac | MAC地址 | string |
| data.electricQuantity | 锁的电量百分比,非实时更新,获取App上一次蓝牙同步的电量 | number |
| data.modelNum | 锁型号 | string |
| data.firmwareRevision | 锁的固件版本 | string |
| data.initDate | 用户在App将锁初始化的时间 | number |
请求方式:POST
请求地址:https://open.populife.co/api/lock/transfer
| Query参数名 | 类型 | 必需 | 描述 | 示例 e.g. |
|---|---|---|---|---|
| appKey | string | 是 | 由Populife 开放平台提供的应用Key | 9JQJEPC0ZR9TC4 |
| accessToken | string | 是 | 由Populife 开放平台授权的Access Token | 1OWZiM2JlOTI0ZjE2MQ...== |
| lockIds | string | 是 | 锁IDs(一个或多,多个个以,分隔) | 2059328,2059901,12695599 |
| recUsername | string | 是 | 接收者的用户名(注册Populife App的邮箱或手机号) | a49871322@gmail | +1638472744948 |
详细说明:
本接口适用于将当前企业下的锁转移到任意的Populife用户账户下,转移后的锁所有权归目标所有,不可恢复,请慎重使用。
返回示例:
{"success":true,"code":200,"msg":null,"data":null}
请求方式:GET
请求地址:https://open.populife.co/api/password/list
| Query参数名 | 类型 | 必需 | 描述 | 示例 e.g. |
|---|---|---|---|---|
| appKey | string | 是 | 由Populife 开放平台提供的应用Key | 9JQJEPC0ZR9TC4 |
| accessToken | string | 是 | 由Populife 开放平台授权的Access Token | 1OWZiM2JlOTI0ZjE2MQ...== |
| lockId | string | 是 | Populife锁类产品的数字标识 | 3212108 |
| pageNo | string | 是 | 页码,起始值为1 | 1 |
| pageSize | string | 是 | 页数据行数,即每一页显示多少行数据 | 20 |
详细说明:
获取用户其中一把锁的按键密码列表
返回示例:
{
"success": true,
"code": 200,
"msg": null,
"data": [
{
"keyboardPwdId": 43859773,
"keyboardPwd": "06607711",
"keyboardPwdType": 2,
"startDate": null,
"endDate": null,
"createDate": 1590485654000,
"alias": "Home",
"sendUser": " 8613201812820",
"status": 2
}, {
"keyboardPwdId": 43859772,
"keyboardPwd": "06600532",
"keyboardPwdType": 3,
"startDate": 1590485653860,
"endDate": 1590485721300,
"createDate": 1590485654000,
"alias": "Office",
"sendUser": " 8613201812820",
"status": 2
}
]
}
| Response参数名 | 描述 | 类型 |
|---|---|---|
| data.keyboardPwdType | 按键密码类型(1:单次,2:永久,3:限时,15:自定义-限时) | number |
| data.keyboardPwdId | 密码ID | number |
| data.keyboardPwd | 按键密码的开锁数字 | string |
| data.startDate | 按键密码的开始生效时间戳,GMT+8 | number |
| data.endDate | 按键密码的失效时间戳,GMT+8 | number |
| data.sendUser | 创建密码的用户 | string |
| data.createDate | 创建密码的时间 | number |
| data.alias | 密码别名 | string |
| data.status | 密码状态(0:删除,1:未激活,2:失效, 3:正常) | number |
请求方式:POST
请求地址:https://open.populife.co/api/password/generate/deadline
| Header参数名 | 类型 | 必需 | 描述 | 示例 e.g. |
|---|---|---|---|---|
| Content-Type | string | 是 | application/x-www-form-urlencoded;charset=utf-8 |
| Body参数名 | 类型 | 必需 | 描述 | 示例 e.g. |
|---|---|---|---|---|
| appKey | string | 是 | 由Populife 开放平台提供的应用Key | 9JQJEPC0ZR9TC4 |
| accessToken | string | 是 | 由Populife 开放平台授权的Access Token | 1OWZiM2JlOTI0ZjE2MQ...== |
| lockId | string | 是 | Populife锁类产品的数字标识 | 371920 |
| startDate | string | 是 | 按键密码的开始生效时间(年月日小时) | 2018-08-12 12:00 |
| endDate | string | 是 | 按键密码的失效时间(年月日小时) | 2018-08-13 13:00 |
| timeZone | string | 是 | 密码有效期的时区 | 8 |
| alias | string | 否 | 密码别名 | Home |
详细说明:
基于某个锁,生成一个某时间段内有效的密码。同一个锁在每一次初始化后,同一个时段内(相同的开始时间和结束时间)只能生成一次密码。 限时密码在生效时间后24小时内必须在锁上使用一次(以激活密码),否则该密码自动失效。 一个锁内可以同时存储的有效密码(所有密码类型)总数不超过150个。限时密码的时间精度是小时(00分整点生效以及失效)。 请基于不同国家地区,设置正确的GMT时区值。
返回示例:
{
"success": true,
"code": 200,
"msg": null,
"data": {
"keyboardPwdId": 109954189,
"keyboardPwd": "93157137"
}
}
| Response参数名 | 描述 | 类型 |
|---|---|---|
| data.keyboardPwdId | 密码ID | number |
| data.keyboardPwd | 按键密码的开锁数字 | string |
请求方式:POST
请求地址:https://open.populife.co/api/password/generate/permanent
| Header参数名 | 类型 | 必需 | 描述 | 示例 e.g. |
|---|---|---|---|---|
| Content-Type | string | 是 | application/x-www-form-urlencoded;charset=utf-8 |
| Body参数名 | 类型 | 必需 | 描述 | 示例 e.g. |
|---|---|---|---|---|
| appKey | string | 是 | 由Populife 开放平台提供的应用Key | 9JQJEPC0ZR9TC4 |
| accessToken | string | 是 | 由Populife 开放平台授权的Access Token | 1OWZiM2JlOTI0ZjE2MQ...== |
| lockId | string | 是 | Populife锁类产品的数字标识 | 371920 |
| alias | string | 否 | 密码别名 | Home |
详细说明:
基于某个锁,生成一个永久有效密码(除非删除密码或锁被重置,密码才会失效) 限时密码在生成后24小时内必须在锁上使用一次(以激活密码),否者该密码自动失效。 一个锁内可以同时存储的有效密码(所有密码类型)总数不超过150个。
返回示例:
{
"success": true,
"code": 200,
"msg": null,
"data": {
"keyboardPwdId": 109954189,
"keyboardPwd": "93157137"
}
}
| Response参数名 | 描述 | 类型 |
|---|---|---|
| data.keyboardPwdId | 密码ID | number |
| data.keyboardPwd | 按键密码的开锁数字 | string |
请求方式:POST
请求地址:https://open.populife.co/api/password/generate/oneTime
| Header参数名 | 类型 | 必需 | 描述 | 示例 e.g. |
|---|---|---|---|---|
| Content-Type | string | 是 | application/x-www-form-urlencoded;charset=utf-8 |
| Body参数名 | 类型 | 必需 | 描述 | 示例 e.g. |
|---|---|---|---|---|
| appKey | string | 是 | 由Populife 开放平台提供的应用Key | 9JQJEPC0ZR9TC4 |
| accessToken | string | 是 | 由Populife 开放平台授权的Access Token | 1OWZiM2JlOTI0ZjE2MQ...== |
| lockId | string | 是 | Populife锁类产品的数字标识 | 371920 |
| alias | string | 否 | 密码别名 | Home |
详细说明:
基于某个锁,生成一个开锁一次即自动失效的密码。 单次密码必须在生成后6小时内在锁上使用,否则自动失效。 一个锁内可以同时存储的有效密码(所有密码类型)总数不超过150个。
返回示例:
{
"success": true,
"code": 200,
"msg": null,
"data": {
"keyboardPwdId": 109954189,
"keyboardPwd": "93157137"
}
}
| Response参数名 | 描述 | 类型 |
|---|---|---|
| data.keyboardPwdId | 密码ID | number |
| data.keyboardPwd | 按键密码的开锁数字 | string |
请求方式:POST
请求地址:https://open.populife.co/api/password/custom/deadline
| Header参数名 | 类型 | 必需 | 描述 | 示例 e.g. |
|---|---|---|---|---|
| Content-Type | string | 是 | application/x-www-form-urlencoded;charset=utf-8 |
| Body参数名 | 类型 | 必需 | 描述 | 示例 e.g. |
|---|---|---|---|---|
| appKey | string | 是 | 由Populife 开放平台提供的应用Key | 9JQJEPC0ZR9TC4 |
| accessToken | string | 是 | 由Populife 开放平台授权的Access Token | 1OWZiM2JlOTI0ZjE2MQ...== |
| lockId | string | 是 | Populife锁类产品的数字标识 | 371920 |
| keyboardPwd | string | 是 | 自定义按键密码(6-9位纯数字) | 88991 |
| startDate | string | 是 | 按键密码的开始生效时间(年月日小时) | 2018-08-12 12:00 |
| endDate | string | 是 | 按键密码的失效时间(年月日小时) | 2018-08-13 13:00 |
| timeZone | string | 是 | 密码有效期的时区 | 8 |
| alias | string | 否 | 密码别名 | Home |
详细说明:
基于某个锁,生成一个自定义限时密码(6-9位纯数字)。限时密码的时间精度是小时(00分整点生效以及失效)。 一个锁内可以同时存储的有效密码(所有密码类型)总数不超过150个。
返回示例:
{
"success": true,
"code": 200,
"msg": null,
"data": {
"keyboardPwdId": 109954189
}
}
| Response参数名 | 描述 | 类型 |
|---|---|---|
| data.keyboardPwdId | 密码ID | number |
请求方式:POST
请求地址:https://open.populife.co/api/password/custom/permanent
| Header参数名 | 类型 | 必需 | 描述 | 示例 e.g. |
|---|---|---|---|---|
| Content-Type | string | 是 | application/x-www-form-urlencoded;charset=utf-8 |
| Body参数名 | 类型 | 必需 | 描述 | 示例 e.g. |
|---|---|---|---|---|
| appKey | string | 是 | 由Populife 开放平台提供的应用Key | 9JQJEPC0ZR9TC4 |
| accessToken | string | 是 | 由Populife 开放平台授权的Access Token | 1OWZiM2JlOTI0ZjE2MQ...== |
| lockId | string | 是 | Populife锁类产品的数字标识 | 371920 |
| keyboardPwd | string | 是 | 自定义按键密码(6-9位纯数字) | 88991 |
| alias | string | 否 | 密码别名 | Home |
详细说明:
基于某个锁,生成一个自定义永久密码(6-9位纯数字)。 一个锁内可以同时存储的有效密码(所有密码类型)总数不超过150个。
返回示例:
{
"success": true,
"code": 200,
"msg": null,
"data": {
"keyboardPwdId": 109954189
}
}
| Response参数名 | 描述 | 类型 |
|---|---|---|
| data.keyboardPwdId | 密码ID | number |
请求方式:POST
请求地址:https://open.populife.co/api/password/change/code
| Header参数名 | 类型 | 必需 | 描述 | 示例 e.g. |
|---|---|---|---|---|
| Content-Type | string | 是 | application/x-www-form-urlencoded;charset=utf-8 |
| Body参数名 | 类型 | 必需 | 描述 | 示例 e.g. |
|---|---|---|---|---|
| appKey | string | 是 | 由Populife 开放平台提供的应用Key | 9JQJEPC0ZR9TC4 |
| accessToken | string | 是 | 由Populife 开放平台授权的Access Token | 1OWZiM2JlOTI0ZjE2MQ...== |
| lockId | string | 是 | Populife锁类产品的数字标识 | 371920 |
| keyboardPwdId | string | 是 | 按键密码ID | 1920 |
| keyboardPwd | string | 是 | 按键密码(6-9位纯数字) | 88991 |
详细说明:
自定义按键密码,只要网关在线,随时可修改。随机生成的密码,只要网关在线,还必须满足该密码至少被使用一次,才允许修改。
返回示例:
{
"success": true,
"code": 200,
"msg": "Successfully modification",
"data": null
}
请求方式:POST
请求地址:https://open.populife.co/api/password/change/deadline
| Header参数名 | 类型 | 必需 | 描述 | 示例 e.g. |
|---|---|---|---|---|
| Content-Type | string | 是 | application/x-www-form-urlencoded;charset=utf-8 |
| Body参数名 | 类型 | 必需 | 描述 | 示例 e.g. |
|---|---|---|---|---|
| appKey | string | 是 | 由Populife 开放平台提供的应用Key | 9JQJEPC0ZR9TC4 |
| accessToken | string | 是 | 由Populife 开放平台授权的Access Token | 1OWZiM2JlOTI0ZjE2MQ...== |
| lockId | string | 是 | Populife锁类产品的数字标识 | 371920 |
| keyboardPwdId | string | 是 | 按键密码ID | 1920 |
| startDate | string | 是 | 按键密码的开始生效时间(年月日小时) | 2018-08-12 12:00 |
| endDate | string | 是 | 按键密码的失效时间(年月日小时) | 2018-08-13 13:00 |
| timeZone | string | 是 | 密码有效期的时区 | 8 |
详细说明:
限时密码只能改开始/结束时间,时间精度是小时(00分整点生效以及失效),可以把永久改为限期。循环密码只能改循环规则(每日/每周几/工作日/周日)+ 起止时间。不允许把限时改成循环、或把循环改成限时。
返回示例:
{
"success": true,
"code": 200,
"msg": "Successfully modification",
"data": null
}
请求方式:POST
请求地址:https://open.populife.co/api/password/delete
| Header参数名 | 类型 | 必需 | 描述 | 示例 e.g. |
|---|---|---|---|---|
| Content-Type | string | 是 | application/x-www-form-urlencoded;charset=utf-8 |
| Body参数名 | 类型 | 必需 | 描述 | 示例 e.g. |
|---|---|---|---|---|
| appKey | string | 是 | 由Populife 开放平台提供的应用Key | 9JQJEPC0ZR9TC4 |
| accessToken | string | 是 | 由Populife 开放平台授权的Access Token | 1OWZiM2JlOTI0ZjE2MQ...== |
| lockId | string | 是 | Populife锁类产品的数字标识 | 371920 |
| keyboardPwdId | string | 是 | 按键密码ID | 1920 |
详细说明:
自定义按键密码,只要网关在线,随时可删除。随机生成的密码,只要网关在线,还必须满足该密码至少被使用一次,才允许删除。
返回示例:
{
"success": true,
"code": 200,
"msg": "Successfully deleted",
"data": null
}
请求方式:GET
请求地址:https://open.populife.co/api/lockRecord/list
| Header参数名 | 类型 | 必需 | 描述 | 示例 e.g. |
|---|---|---|---|---|
| Content-Type | string | 是 | application/x-www-form-urlencoded;charset=utf-8 |
| Body参数名 | 类型 | 必需 | 描述 | 示例 e.g. |
|---|---|---|---|---|
| appKey | string | 是 | 由Populife 开放平台提供的应用Key | 9JQJEPC0ZR9TC4 |
| accessToken | string | 是 | 由Populife 开放平台授权的Access Token | 1OWZiM2JlOTI0ZjE2MQ...== |
| lockId | string | 是 | Populife锁类产品的数字标识 | 371920 |
| startDate | number | 是 | 开始时间戳(0 表示没有限制) | 1775981754 |
| endDate | number | 是 | 结束时间戳(0 表示没有限制) | 1775991721 |
| pageNo | number | 是 | 页码(最小为1) | 1 |
| pageSize | number | 是 | 每页记录数 | 20 |
详细说明:
开锁记录列表。
返回示例:
{
"success": true,
"code": 200,
"msg": null,
"data": {
"pageNo": 1,
"pageSize": 2,
"disablePre": true,
"disableNext": false,
"count": 31,
"dataList": [
{
"lockId": 18277584,
"recordType": 1,
"username": "xxx@qq.com",
"keyboardPwd": "",
"operateTime": 1729493892000
},
{
"lockId": 18277584,
"recordType": 1,
"username": "xxx@qq.com",
"keyboardPwd": "",
"operateTime": 1729493865000
}
],
"totalPage": 16,
"beginPage": 1,
"endPage": 10
}
}
| Response参数名 | 描述 | 类型 |
|---|---|---|
| data.pageNo | 页码,从1开始 | number |
| data.beginPage | 总页数 | number |
| data.count | 总条数 | number |
| data.dataList | 记录列表 | list |
| 返回列表中的对象 | 描述 | 类型 |
|---|---|---|
| lockId | 锁ID | number |
| recordType | 事件,1:开锁,2:闭锁,3:键盘密码开锁,4:网关开锁,5:网关闭锁,7:指纹开锁,8:IC卡开锁,9:错误密码开锁,10:NFC开锁 | number |
| username | 操作人用户名(邮件或手机号) | string |
| keyboardPwd | 键盘密码的密码,或者IC卡号 | string |
| operateTime | 操作时间 | number |
| 状态码 | 描述 |
|---|---|
| 200 | 成功 |
| 900 | 必填参数缺失 |
| 500 | 服务器内部错误 |
| 910 | 无效的参数 |