Get project discussion comment list¶
GET /api/v5/repos/{owner}/{repo}/discuss/{number}/comment
This endpoint gets the comment list under a project discussion in the specified repository. It supports paginated queries by page number and per-page count and can sort by comment creation time or popularity, returning related data such as the comment content, author information, like count, and reply count.
Access token support¶
- AtomGit user access token (AtomGit user access tokens)
Anonymous access¶
This endpoint allows anonymous access
Request parameters¶
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
owner |
path | string | Yes | Namespace path of the repository (the path of an enterprise, organization, or personal address) |
repo |
path | string | Yes | Repository path (path) |
number |
path | string | Yes | Discussion number |
page |
query | integer | No | Current page number |
per_page |
query | integer | No | Number of items per page, maximum 100, default 20 |
order |
query | string | No | Sort order: by creation time ascending time_asc; by creation time descending time_desc; by popularity descending hot_desc |
Response parameters¶
| Field | Type | Always returned | Nullable | Description |
|---|---|---|---|---|
id |
string | Yes | No | Comment ID |
created_at |
string | Yes | No | Comment creation time |
author |
object | Yes | No | Comment author information |
content |
string | Yes | — | Comment content |
md_content |
string | Yes | — | Markdown content of the comment |
is_hide |
integer | Yes | — | Whether hidden |
reply_total |
integer | Yes | — | Reply total |
like_total |
integer | Yes | — | Like total |
is_like |
boolean | Yes | — | Whether the current user has liked |
is_deleted |
integer | Yes | — | Whether deleted |
is_remark |
integer | Yes | — | Whether it is a note |
author object¶
| Field | Type | Always returned | Nullable | Description |
|---|---|---|---|---|
author.avatar_url |
string | Yes | No | User avatar URL |
author.id |
string | Yes | No | User ID |
author.object_id |
string | Yes | No | User object ID |
author.login |
string | Yes | No | Login name |
author.name |
string | Yes | No | Nickname |
Error response¶
400 Parameter error
401 Unauthenticated
404 Resource does not exist
The error field names are subject to what the backend actually returns.
HTTP response status codes¶
| Status code | Description |
|---|---|
200 |
Success (OK) |
304 |
Not modified |
401 |
Authentication required (Requires authentication) |
403 |
Access forbidden (Forbidden) |
404 |
Resource not found (Not Found) |
Request example¶
Parameter description¶
Replace
<owner>with the namespace path of the repository (the path of an enterprise, organization, or personal address); replace<repo>with the repository path (path); replace<number>with the discussion number. This endpoint allows anonymous access, and you can also carry<token>(user access token) as the optionalaccess_tokenquery parameter.
cURL¶
curl -X GET 'https://api.atomgit.com/api/v5/repos/<owner>/<repo>/discuss/<number>/comment?page=1&per_page=20' \
-H 'Accept: application/json'
JavaScript¶
// Native fetch (Node.js 18+ / browser)
const response = await fetch(
"https://api.atomgit.com/api/v5/repos/<owner>/<repo>/discuss/<number>/comment?page=1&per_page=20",
{
headers: {
"Accept": "application/json",
},
}
);
if (!response.ok) {
throw new Error(`Request failed: ${response.status}`);
}
const data = await response.json();
console.log(data);
Python¶
import requests
resp = requests.get(
"https://api.atomgit.com/api/v5/repos/<owner>/<repo>/discuss/<number>/comment",
params={"page": 1, "per_page": 20},
headers={"Accept": "application/json"},
timeout=10,
)
resp.raise_for_status()
print(resp.json())
Response example¶
Status code: 200
[
{
"id": "123456",
"created_at": "2026-01-01T10:00:00+08:00",
"author": {
"avatar_url": "https://api.atomgit.com/assets/avatars/octocat.png",
"id": "1001",
"object_id": "1001",
"login": "octocat",
"name": "Octo Cat"
},
"content": "This is an example discussion comment",
"md_content": "This is an example discussion comment",
"is_hide": 0,
"reply_total": 2,
"like_total": 5,
"is_like": true,
"is_deleted": 0,
"is_remark": 0
}
]
Error codes¶
| Error code | Description |
|---|---|
400 |
Parameter error or unparsable request |
401 |
Unauthenticated or invalid credentials (missing/invalid access credentials) |
404 |
Request path does not exist |
405 |
Method not supported |
429 |
Too many requests; rate limit triggered |
500 |
Internal server error |
Markdown source: View on AtomGit·Content from the open-source project gitcode-dev/atomgit-api-doc