Skip to content

Get a specific repository Issue comment

GET /api/v5/repos/{owner}/{repo}/issues/comments/{id}

This endpoint retrieves the details of an Issue comment in the specified repository, including the comment content, comment type, author information, associated issue information, and creation and update times.

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 address that owns the repository (path of an organization or personal address)
repo path string Yes Repository path (path)
id path string Yes Comment ID

Response parameters

Field Type Always returned Nullable Description
id integer Yes No Comment ID
body string Yes No Comment content
comment_type string Yes No Comment type, such as DiscussionNote
user object Yes No Comment author information
target object Yes No Target object associated with the comment
created_at string Yes No Comment creation time
updated_at string Yes No Comment update time

user object

Field Type Always returned Nullable Description
user.id string Yes No User ID
user.login string Yes No User login name
user.name string Yes No User nickname
user.type string Yes No User type, such as User

target object

Field Type Always returned Nullable Description
target.issue object Yes No Issue associated with the comment

target.issue object

Field Type Always returned Nullable Description
target.issue.id integer Yes No Issue ID
target.issue.title string Yes No Issue title
target.issue.number string Yes No Issue number

Error responses

A 200/success response alone is not enough: callers need to know what a failure looks like in order to write error handling.

400 Invalid parameters

{
  "error": "invalid_request",
  "message": "Invalid parameters",
  "field": "id"
}

401 Unauthenticated

{
  "error": "unauthorized",
  "message": "Missing or invalid access token"
}

404 Resource not found

{
  "error": "not_found",
  "message": "Comment not found"
}

Note: Field names in error responses are subject to the actual backend response.

HTTP response status codes

Status code Description
200 Success (OK)
400 Bad request
401 Requires authentication
403 Forbidden
404 Resource not found (Not found)
429 Too many requests; rate limit triggered
500 Internal server error

Request example

Parameter notes

Anonymous access is allowed for this endpoint, so the examples do not need to carry an access token. If authentication is required, you can pass a user access token via the access_token query parameter in the URL.

Replace <owner> with the namespace address that owns the repository (path of an organization or personal address); replace <repo> with the repository path (path); replace <id> with the comment ID.

cURL

curl -X GET 'https://api.atomgit.com/api/v5/repos/<owner>/<repo>/issues/comments/<id>' \
  -H 'Accept: application/json'

JavaScript

// Native fetch (Node.js 18+ / browser)
const response = await fetch("https://api.atomgit.com/api/v5/repos/<owner>/<repo>/issues/comments/<id>", {
  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>/issues/comments/<id>",
    headers={
        "Accept": "application/json",
    },
    timeout=10,
)
resp.raise_for_status()

print(resp.json())

Response example

Status code: 200

{
  "id": 1495484,
  "body": "Test issue comment",
  "comment_type": "DiscussionNote",
  "user": {
    "id": "268",
    "login": "dengmengmian",
    "name": "Ma Fan",
    "type": "User"
  },
  "target": {
    "issue": {
      "id": 494561,
      "title": "Test issue comment",
      "number": "494561"
    }
  },
  "created_at": "2024-10-08T19:52:19+08:00",
  "updated_at": "2024-10-08T19:52:19+08:00"
}

Error codes

Error code Description
400 Invalid parameters or unparsable request
401 Unauthenticated or invalid credentials (missing/invalid access credentials)
403 Forbidden
404 Request path not found or resource not found
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