Skip to content

Open API

API 服务地址

API 服务与文档地址为 https://api.cnb.cool

调用方式

Header 信息

  • Authorization:用于身份验证,格式为 Bearer ${token},其中 ${token} 为访问令牌。
  • Accept:根据 API 文档中 Response content type 列举的可选类型填写,如:application/json

请求示例

curl 请求示例:

bash
curl -X "GET" \
-H "accept: application/json" \
-H "Authorization: Bearer 1Z00000000000000000000000vA" \
"https://api.cnb.cool/user/groups?page=1&page_size=10"

返回示例:

json
[
  {
    "id": 1816756487609032700,
    "name": "test",
    "remark": "测试组织",
    "description": "",
    "site": "",
    "email": "",
    "freeze": false,
    "wechat_mp": "hello-world",
    "created_at": "2024-07-26T08:44:35Z",
    "updated_at": "2024-08-13T07:32:13Z",
    "follow_count": 0,
    "member_count": 4,
    "all_member_count": 4,
    "sub_group_count": 5,
    "sub_repo_count": 7,
    "sub_mission_count": 1,
    "all_sub_group_count": 13,
    "all_sub_repo_count": 12,
    "all_sub_mission_count": 1,
    "has_sub_group": true,
    "path": "test",
    "access_role": "Owner"
  }
]

仓库动态接口详见仓库动态。