Get the modification history of Issue comments¶
GET /api/v5/repos/{owner}/{repo}/issues/comment/{comment_id}/modify_history
This endpoint retrieves the modification history records of a specified Issue comment and returns an array of history records containing the modification time, the modified content, and information about the operating user and the modified user.
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 | Address path of the namespace that owns the repository (the address path of an organization or individual) |
repo |
path | string | Yes | Repository path (path) |
comment_id |
path | string | Yes | Comment ID |
access_token |
query | string | No | User authorization code (may be omitted when anonymous access is allowed) |
Response parameters¶
The response body is an array of modification records; each element represents a record of comment modification history, with the following fields:
| Field | Type | Always returned | Nullable | Description |
|---|---|---|---|---|
id |
string | Yes | No | Modification history record ID |
created_at |
string | Yes | No | Creation time |
updated_at |
string | Yes | No | Update time |
deleted |
boolean | Yes | No | Whether it has been deleted |
created |
boolean | Yes | No | Whether this is a creation |
content |
string | Yes | No | Modified content |
user |
object | Yes | No | Information about the user performing the modification |
updated_user |
object | Yes | No | Information about the modified user |
user object
| Field | Type | Always returned | Nullable | Description |
|---|---|---|---|---|
user.login |
string | Yes | No | Login name |
user.name |
string | Yes | No | Username |
user.avatar_url |
string | Yes | No | User avatar address |
user.object_id |
string | Yes | No | User object ID |
updated_user object
| Field | Type | Always returned | Nullable | Description |
|---|---|---|---|---|
updated_user.login |
string | Yes | No | Login name |
updated_user.name |
string | Yes | No | Username |
updated_user.avatar_url |
string | Yes | No | User avatar address |
updated_user.object_id |
string | Yes | No | User object ID |
Error responses¶
This endpoint is a public, read-only endpoint. The main failure scenarios are invalid path parameters or a nonexistent target resource.
404 Resource not found
(Error field names are subject to the actual backend response.)
HTTP status codes¶
| Status code | Description |
|---|---|
200 |
Success (OK) |
404 |
The requested resource does not exist |
401 |
Requires authentication (Requires authentication) |
429 |
Too many requests; rate limit triggered |
500 |
Internal server error |
Request example¶
Parameter notes¶
Replace
<owner>with the address path of the namespace that owns the repository (the address path of an organization or individual); replace<repo>with the repository path (path); replace<comment_id>with the comment ID; replace<token>with your AtomGit user access token (optional; may be omitted when anonymous access is allowed).
cURL¶
curl -X GET 'https://api.atomgit.com/api/v5/repos/<owner>/<repo>/issues/comment/<comment_id>/modify_history?access_token=<token>' \
-H 'Accept: application/json'
JavaScript¶
// Native fetch (Node.js 18+ / browser)
const owner = "<owner>";
const repo = "<repo>";
const commentId = "<comment_id>";
const token = "<token>"; // Optional; may be omitted when anonymous access is allowed
const url = `https://api.atomgit.com/api/v5/repos/${owner}/${repo}/issues/comment/${commentId}/modify_history${
token ? `?access_token=${token}` : ""
}`;
const response = await fetch(url, {
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
owner = "<owner>"
repo = "<repo>"
comment_id = "<comment_id>"
token = "<token>" # Optional; may be omitted when anonymous access is allowed
params = {}
if token:
params["access_token"] = token
resp = requests.get(
f"https://api.atomgit.com/api/v5/repos/{owner}/{repo}/issues/comment/{comment_id}/modify_history",
params=params,
headers={"Accept": "application/json"},
timeout=10,
)
resp.raise_for_status()
print(resp.json())
Response example¶
Status code: 200
[
{
"id": "string",
"created_at": "string",
"updated_at": "string",
"deleted": true,
"created": true,
"content": "string",
"user": {
"login": "octocat",
"name": "Octo Cat",
"avatar_url": "https://api.atomgit.com/avatar.png",
"object_id": "string"
},
"updated_user": {
"login": "octocat",
"name": "Octo Cat",
"avatar_url": "https://api.atomgit.com/avatar.png",
"object_id": "string"
}
}
]
Error codes¶
| Error code | Description |
|---|---|
401 |
Unauthenticated or invalid credentials (missing or invalid access credential) |
400 |
Invalid parameters or unparsable request |
404 |
Request path does not exist |
405 |
Request method not allowed |
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