调用本接口获取用户下所有的租户
基本信息
请求方式:GET
请求地址:https://officeapi.shanzi.com/openapi/v1/user/tenant/list
Header参数
参数名称 | 类型 | 必填 | 示例值 | 描述 |
---|---|---|---|---|
Authorization | string | 是 | eyJhb… | 授权令牌 |
返回参数
字段名 | 类型 | 必填 | 描述 |
---|---|---|---|
list | object[] | 是 | 租户列表 |
sn | string | 是 | 团队SN |
tenant_name | string | 是 | 团队名称 |
auth_status | integer <int32> | 是 | 认证状态:0=未认证,1=已认证 |
auth_status_text | string | 是 | 认证状态描述 |
package_name | string | 是 | 套餐名称 |
icon | string | 是 | 套餐图标URL |
is_default | integer <int32> | 是 | 是否为默认租户 |
this_tenant | boolean | 是 | 是否是当前选择的租户 |
示例
请求示例(HTTP)
GET /openapi/v1/user/tenant/list HTTP/1.1
Host: officeapi.shanzi.com
Authorization: eyJhbGlhcyI6IjE5OTIyMjM5NTQzIiwiZXhwIjoxNzQ0MDIz...
请求示例(JavaScript)
const axios = require('axios');
const requestConfig = {
method: 'get',
url: 'https://officeapi.shanzi.com/openapi/v1/user/tenant/list',
headers: {
'Authorization': 'eyJhbGlhcyI6IjE5OTIyMjM5NTQzIiwiZXhwIjoxNzQ...'
}
};
axios(requestConfig)
.then(response => {
console.log(JSON.stringify(response.data, null, 2));
})
.catch(error => {
console.error('请求失败:', error);
});
返回示例
{
"list": [
{
"sn": "string",
"tenant_name": "string",
"auth_status": 0,
"auth_status_text": "string",
"package_name": "string",
"icon": "string",
"is_default": 0,
"this_tenant": true
}
]
}