删除组织讨论评论¶
DELETE /api/v5/orgs/{org}/discuss/{number}/comment/{id}
该接口用于删除指定组织讨论下的评论。需指定组织路径、讨论编号及评论id,删除成功后返回200状态码且响应体为空。
访问令牌支持说明¶
- AtomGit 用户访问令牌(AtomGit user access tokens)
是否允许匿名访问¶
此接口不允许匿名访问
请求参数¶
| 参数名 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
org |
path | string | 是 | 组织路径(path) |
number |
path | integer | 是 | 讨论编号 |
id |
path | string | 是 | 评论id |
access_token |
query | string | 是 | 用户授权码 |
响应参数¶
该接口成功时返回 200,响应体为空,无业务数据返回。
失败响应¶
400 参数错误
401 未认证
Note: 以上错误响应示例仅供参考,错误字段名以后端实际返回为准。
HTTP 响应状态码¶
| 状态码 | 说明 |
|---|---|
200 |
成功(OK) |
400 |
参数错误(Bad request) |
401 |
需要认证(Requires authentication) |
403 |
禁止访问(Forbidden) |
404 |
资源不存在(Not found) |
429 |
请求过于频繁(Too many requests) |
500 |
系统内部错误(Internal server error) |
请求示例¶
参数说明¶
<org>替换为组织路径(path);<number>替换为讨论编号;<id>替换为评论id;<token>替换为你的 AtomGit 用户访问令牌。
cURL¶
curl -X DELETE 'https://api.atomgit.com/api/v5/orgs/<org>/discuss/<number>/comment/<id>?access_token=<token>' \
-H 'Accept: application/json'
JavaScript¶
// 原生 fetch (Node.js 18+ / 浏览器)
const response = await fetch(
"https://api.atomgit.com/api/v5/orgs/<org>/discuss/<number>/comment/<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/v5/orgs/<org>/discuss/<number>/comment/<id>",
params={"access_token": "<token>"},
headers={"Accept": "application/json"},
timeout=10,
)
resp.raise_for_status()
print("删除成功")
响应示例¶
状态码: 200
删除成功后返回 200 OK,响应体为空。
错误码¶
| 错误码 | 说明 |
|---|---|
400 |
参数错误或请求无法解析 |
401 |
未认证或凭证无效(缺少/无效的访问凭证) |
403 |
禁止访问 |
404 |
请求路径不存在 |
429 |
请求过于频繁,触发限流 |
500 |
系统内部错误 |
本页原文 Markdown:在 AtomGit 查看·内容源自开源项目 gitcode-dev/atomgit-api-doc