跳到主要内容

许可证

向 ONLYOFFICE 文档请求许可证,并获取有关服务器和用户配额的信息。

请求示例

{
"c": "license"
}

参数

名称类型是否必填描述
cstring必填定义命令类型。

响应示例

{
"error": 0,
"license": {
"end_date": "2021-07-07T23:59:59.000Z",
"trial": false,
"customization": false,
"connections": 0,
"connections_view": 0,
"users_count": 10,
"users_view_count": 10,
"users_expire": 30
},
"server": {
"resultType": 3,
"packageType": 1,
"buildDate": "2021-05-21T00:00:00.000Z",
"buildVersion": "6.3.0",
"buildNumber": 111
},
"quota": {
"users": [
{
"userid": "uid-0",
"expire": "2021-07-07T23:59:59.000Z"
},
{
"userid": "uid-1",
"expire": "2021-07-09T23:59:59.000Z"
}
],
"users_view": [
{
"userid": "uid-0",
"expire": "2021-07-07T23:59:59.000Z"
},
{
"userid": "uid-1",
"expire": "2021-07-09T23:59:59.000Z"
}
]
}
}

响应参数

参数类型是否必填描述
errorinteger必填定义错误码。
licenseobject非必填定义文档的许可证信息。
license.end_datestring必填定义许可证的过期日期。
license.trialboolean必填定义许可证是否为试用版本。
license.customizationboolean必填定义那些在 ONLYOFFICE 文档开发者版中标注为可编辑的自定义参数是否仅在 ONLYOFFICE 文档开发者版中可编辑。
license.connectionsinteger非必填定义连接数许可证中的连接数。
license.connections_viewinteger非必填定义实时查看器的连接数。
license.users_countinteger非必填定义用户许可证中的用户数。
license.users_view_countinteger非必填定义实时查看器的用户数。
license.users_expireinteger非必填定义用户许可证在多少天后过期。
serverobject必填定义服务器的相关信息。
server.resultTypeinteger必填定义许可证状态:

1 - 出现错误,

2 - 许可证已过期,

3 - 许可证仍有效,

6 - 试用许可证已过期。
server.packageTypeinteger必填定义产品版本:

0 - 开源产品,

1 - ONLYOFFICE 文档企业版,

2 - ONLYOFFICE 文档开发者版。
server.buildDatestring必填定义构建日期。
server.buildVersionstring非必填定义构建版本。
server.buildNumberinteger必填定义构建编号。
quotaobject必填定义用户配额值。
quota.usersarray of objects必填定义用户许可证的用户配额,其中:

userid - 打开编辑器的用户 ID,

expire - 该用户的许可证过期日期。
quota.users_viewarray of objects必填定义实时查看器的用户配额,其中:

userid - 打开编辑器的用户 ID,

expire - 该用户的查看权限过期日期。