Skip to content

Get organization discussion comment list

GET /api/v5/orgs/{org}/discuss/{number}/comment

This endpoint gets the comment list of a discussion under the specified organization. It supports pagination and sorting by creation time or popularity, and the returned content includes the comment content, like count, reply count, and author information.

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
org path string Yes the organization path
number path string Yes Discussion number
access_token query string No User authorization code
page query string No Current page number
per_page query string 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

The response body is an array of discussion comment objects; each element contains fields such as the comment content, like count, and author information.

Field Type Always returned Nullable Description
id string Yes No Comment ID
created_at string Yes No Creation time
author object Yes No Comment author information
content string No Yes Comment content (plain text)
md_content string No Yes Comment content (Markdown format)
is_hide integer No No Whether hidden
reply_total integer No No Reply total
like_total integer No No Like total
is_like boolean No No Whether the current user has liked
is_deleted integer No No Whether deleted
is_remark integer No No Whether flagged

author object

Field Type Always returned Nullable Description
author.avatar_url string Yes No Author avatar URL
author.id string Yes No Author ID
author.object_id string Yes No Author object ID
author.login string Yes No Author login name
author.name string Yes No Author nickname

Error response

This endpoint has no explicit business failure response; on failure it returns the corresponding HTTP error status code (see "HTTP response status codes").

HTTP response status codes

Status code Description
200 Success (OK)
304 Not modified
401 Authentication required (Requires authentication)
403 Access forbidden (Forbidden)

Request example

Parameter description

Replace <org> with the path of the organization; Replace <number> with the discussion number; Replace <token> with your AtomGit user access token (optional).

cURL

curl -X GET 'https://api.atomgit.com/api/v5/orgs/<org>/discuss/<number>/comment?page=1&per_page=20&order=time_desc' \
  -H 'Accept: application/json'

JavaScript

// Native fetch (Node.js 18+ / browser)
const response = await fetch("https://api.atomgit.com/api/v5/orgs/<org>/discuss/<number>/comment?page=1&per_page=20&order=time_desc", {
  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/orgs/<org>/discuss/<number>/comment",
    params={"page": 1, "per_page": 20, "order": "time_desc"},
    headers={"Accept": "application/json"},
    timeout=10,
)
resp.raise_for_status()

print(resp.json())

Response example

Status code: 200

[
  {
    "id": "string",
    "created_at": "string",
    "author": {
      "avatar_url": "string",
      "id": "string",
      "object_id": "string",
      "login": "string",
      "name": "string"
    },
    "content": "string",
    "md_content": "string",
    "is_hide": 0,
    "reply_total": 0,
    "like_total": 0,
    "is_like": true,
    "is_deleted": 0,
    "is_remark": 0
  }
]

Error codes

Error code Description
401 Unauthenticated or invalid credentials (missing/invalid access credentials)
400 Parameter error or unparsable request
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