获取企业issue状态¶
GET /api/v5/enterprises/{enterprise}/issue/statuses
该接口用于获取指定企业的 issue 状态列表。通过传入企业空间地址路径,可查询该企业下所有 issue 状态信息,包括状态名称与状态描述,便于了解企业各类 issue 状态及其具体含义。
访问令牌支持说明¶
- AtomGit 用户访问令牌(AtomGit user access tokens)
是否允许匿名访问¶
此接口允许匿名访问
请求参数¶
| 参数名 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
enterprise |
path | string | 是 | 仓库所属空间地址(企业、组织或个人的地址 path) |
响应参数¶
响应为 issue 状态对象数组,每个元素包含以下字段:
| 字段 | 类型 | 必返 | 可为空 | 说明 |
|---|---|---|---|---|
name |
string | 是 | 否 | 状态名称 |
desc |
string | 是 | 否 | 状态描述 |
失败响应¶
400 参数错误
401 未认证
注意: 错误字段名以后端实际返回为准。
HTTP 响应状态码¶
| 状态码 | 说明 |
|---|---|
200 |
成功(OK) |
400 |
参数错误(Bad Request) |
401 |
需要认证(Requires authentication) |
404 |
资源不存在(Not Found) |
500 |
系统内部错误(Internal Server Error) |
请求示例¶
参数说明¶
<enterprise>替换为企业的路径 path(企业、组织或个人的地址 path);本接口允许匿名访问,也可携带用户访问令牌。
cURL¶
curl -X GET 'https://api.atomgit.com/api/v5/enterprises/<enterprise>/issue/statuses' \
-H 'Accept: application/json'
JavaScript¶
// 原生 fetch (Node.js 18+ / 浏览器)
const response = await fetch("https://api.atomgit.com/api/v5/enterprises/<enterprise>/issue/statuses", {
headers: {
"Accept": "application/json",
},
});
if (!response.ok) {
throw new Error(`请求失败: ${response.status}`);
}
const data = await response.json();
console.log(data);
Python¶
import requests
resp = requests.get(
"https://api.atomgit.com/api/v5/enterprises/<enterprise>/issue/statuses",
headers={
"Accept": "application/json",
},
timeout=10,
)
resp.raise_for_status()
print(resp.json())
响应示例¶
状态码: 200
错误码¶
| 错误码 | 说明 |
|---|---|
400 |
参数错误或请求无法解析 |
401 |
未认证或凭证无效(缺少/无效的访问凭证) |
404 |
请求路径不存在 |
500 |
系统内部错误 |
本页原文 Markdown:在 AtomGit 查看·内容源自开源项目 gitcode-dev/atomgit-api-doc