删除企业里程碑¶
DELETE /api/v8/enterprises/{enterprise}/milestones/{milestone_id}
用户调用此接口,进行删除企业里程碑操作.
访问令牌支持说明¶
- AtomGit 用户访问令牌(AtomGit user access tokens)
是否允许匿名访问¶
此接口不允许匿名访问
请求参数¶
| 参数名 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
enterprise |
path | string | 是 | 企业id |
milestone_id |
path | string | 是 | 里程碑id |
access_token |
query | string | 是 | 用户授权码 |
响应参数¶
删除成功时返回 HTTP 200,响应体为空,无需解析响应内容。
失败响应¶
失败时后端统一返回
ApiErrorResp结构(字段按 snake_case 序列化),error_code_name取值以后端实际返回为准。
400 参数错误
{
"error_code": 400,
"error_code_name": "PARAMETER_ERROR",
"error_message": "参数错误",
"trace_id": "<trace-id>"
}
401 未认证
{
"error_code": 401,
"error_code_name": "UNAUTHORIZED",
"error_message": "缺少或无效的访问令牌",
"trace_id": "<trace-id>"
}
404 未找到
{
"error_code": 404,
"error_code_name": "NOT_FOUND",
"error_message": "企业里程碑不存在",
"trace_id": "<trace-id>"
}
500 系统内部错误
{
"error_code": 500,
"error_code_name": "FAIL",
"error_message": "系统内部错误",
"trace_id": "<trace-id>"
}
HTTP 响应状态码¶
| 状态码 | 说明 |
|---|---|
200 |
成功(删除成功,响应体为空) |
400 |
参数错误(Bad Request) |
401 |
需要认证(Requires authentication) |
403 |
禁止访问(Forbidden) |
404 |
未找到(Not found) |
405 |
请求方法不支持(Method not allowed) |
429 |
请求过于频繁,触发限流 |
500 |
系统内部错误(Internal server error) |
请求示例¶
参数说明¶
<enterprise>替换为企业 id;<milestone_id>替换为要删除的里程碑 id;<token>替换为你的 AtomGit 用户访问令牌。
cURL¶
curl -X DELETE 'https://api.atomgit.com/api/v8/enterprises/<enterprise>/milestones/<milestone_id>?access_token=<token>' -H 'Accept: application/json'
JavaScript¶
// 原生 fetch (Node.js 18+ / 浏览器)
const response = await fetch(
"https://api.atomgit.com/api/v8/enterprises/<enterprise>/milestones/<milestone_id>?access_token=<token>",
{
method: "DELETE",
headers: {
"Accept": "application/json"
}
}
);
if (!response.ok) {
throw new Error(`请求失败: ${response.status}`);
}
console.log("删除成功");
Python¶
import requests
resp = requests.delete(
"https://api.atomgit.com/api/v8/enterprises/<enterprise>/milestones/<milestone_id>",
params={"access_token": "<token>"},
headers={"Accept": "application/json"},
timeout=10,
)
resp.raise_for_status()
print("删除成功")
响应示例¶
状态码: 200
删除成功时响应体为空:
错误码¶
| 错误码 | 说明 |
|---|---|
401 |
未认证或凭证无效(缺少/无效的访问凭证) |
400 |
参数错误或请求无法解析 |
403 |
禁止访问 |
404 |
请求路径不存在或里程碑不存在 |
405 |
请求方法不支持 |
429 |
请求过于频繁,触发限流 |
500 |
系统内部错误 |
本页原文 Markdown:在 AtomGit 查看·内容源自开源项目 gitcode-dev/atomgit-api-doc