获取站点详细信息

基本信息

接口名称: 获取站点详细信息

接口类型: 数据获取

接口说明: 获取一个站点的详细信息

详细信息

URL

https://www.baklib.com/api/v1/tenants/:tenant_id

完整URL示例

https://www.baklib.com/api/v1/tenants/aaa24dbe-a17b-4439-911d-176e0149cf76

HTTP请求方式

GET

授权认证方式

默认方式,需要添加请求header

Authorization: Bearer <token>

请求参数

参数 必选 类型及范围 说明
id true String 站点id

id 可以通过站点列表获得。
点击获得站点id

示例代码


var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function() {
  if(this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://www.baklib.com/api/v1/tenants/?tenant_id=aaa24dbe-a17b-4439-911d-176e0149cf76");
xhr.setRequestHeader("Authorization", "Bearer 8486df9cb8a93ea843702141065c4a8b714602b45e7c4a6bb26a26ea3d69de6");

xhr.send();

返回结果

{
    "code": 0,
    "status": "success",
    "message": {
        "id": "aaa24dbe-a17b-4439-911d-176e0149cf76",
        "name": "1157测试更新",
        "identifier": "a9c2a5",
        "domain": null,
        "site_title": null,
        "site_logo": null,
        "site_icon": null,
        "site_color": "#03c9a9",
        "created_at": "2022-11-07T13:54:57.622+08:00",
        "updated_at": "2022-11-09T11:57:25.804+08:00",
        "user": {
            "id": "822ca2a8-b3b7-4d7c-aaed-8cd3b221373f",
            "mobile_phone": "13518493757",
            "name": "xinrong_li",
            "image": "https://saas.bk-cdn.com/1667800960782-v2-454fba3b1159d364b448f77e092aef74.jpg",
            "email": null
        },
        "icp_info": null,
        "plan": "套餐一",
        "plan_expires_at": "2022-11-21T13:54:58.406+08:00",
        "allow_robots": false
    }
}

返回字段说明

返回值字段 字段类型 说明
code Integer 状态码
status String 返回状态
message Hash 返回数据
        id String 站点id
        name String 站点名称
        identifier String 站点唯一标识符
        domain String 二级域名
        site_title String 网站名称 (可能是多余字段)
        site_logo String 站点logo
        site_icon String 导航栏logo
        site_color String 站点主题颜色
        created_at Datetime 创建时间
        updated_at Datetime 更新时间
        user Jsonb 站点所有者信息
              id String 用户id
              mobile_phone String 用户手机号
              name String 用户名称
              image String 用户头像
              email String 用户邮箱
        icp_info String 备案信息
        plan String 购买的版本
        plan_expires_at Datetime 版本到期时间
        allow_robots Boolean 是否允许搜索引擎收录
2022-11-18
0 0