Skip to content

Get a specific commit comment in a repository

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

This endpoint returns the details of a specific commit comment in the specified repository: the comment content, creation and update times, comment target object, and information about the user who posted the comment.

Access token support

  • AtomGit user access tokens

Anonymous access

This endpoint allows anonymous access.

Request parameters

Parameter Location Type Required Description
owner path string Yes Address path of the namespace that owns the repository (address path of the organization or user)
repo path string Yes Repository path (path)
id path string Yes Comment ID
access_token query string No User authorization code

Response parameters

Field Type Always returned Nullable Description
body string Yes — Comment content
created_at string Yes — Comment creation time
id integer Yes — Comment ID
target object Yes — Comment target object (the exact structure depends on the actual response)
updated_at string Yes — Comment update time
user object Yes — Information about the user who posted the comment

user object

Field Type Always returned Nullable Description
user.id integer Yes — User ID
user.login string Yes — User login name
user.name string Yes — Username
user.type string Yes — User type (for example, User)

Error response

The reference documentation does not define a failure response format for this endpoint. If the repository or comment does not exist, or access is denied, the backend returns the corresponding error status code (such as 404 or 401). The actual error fields are those returned by the backend.

HTTP response status codes

Status code Description
200 Success (OK)
401 Authentication required
404 Resource not found

Request example

Parameter description

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

This endpoint allows anonymous access, so the example does not include an access token. To call it as a user, append the query parameter access_token=<token> to the URL.

cURL

curl -X GET 'https://api.atomgit.com/api/v5/repos/<owner>/<repo>/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>/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>/comments/<id>",
    headers={"Accept": "application/json"},
    timeout=10,
)
resp.raise_for_status()

print(resp.json())

Response example

Status code: 200

{
  "body": "Sample comment body",
  "created_at": "2024-11-06T09:43:23+08:00",
  "id": 1492393,
  "target": {},
  "updated_at": "2024-11-06T15:18:04+08:00",
  "user": {
    "id": 496,
    "login": "xiaogang",
    "name": "xiaogang",
    "type": "User"
  }
}

Markdown source: View on AtomGit·Content from the open-source project gitcode-dev/atomgit-api-doc