Skip to content

Get the modification history of pull request comments

GET /api/v5/repos/{owner}/{repo}/pulls/comment/{comment_id}/modify_history

Retrieves the modification history of pull request comments in the specified repository. It lets users review the records produced when a comment was created and modified over time, including the modification time, the content after modification, and the commenting and modifying users.

Supported access tokens

  • AtomGit user access token (AtomGit user access tokens)

Anonymous access

This endpoint does not allow anonymous access.

Request parameters

Parameter Location Type Required Description
owner path string Yes Namespace address to which the repository belongs (address path of the enterprise, organization, or user)
repo path string Yes Repository path (path)
comment_id path string Yes ID of the comment
access_token query string Yes User authorization code

Response parameters

The response is an array whose elements are modification history record objects.

Field Type Always returned Nullable Description
id string Yes No Modification record ID
created_at string Yes No Creation time
updated_at string Yes No Modification time
deleted boolean Yes No Whether it has been deleted
created boolean Yes No Whether this is a creation record
content string Yes No Content after modification
user object Yes No Commenting user information
updated_user object Yes No Modifying user information

user object

Field Type Always returned Nullable Description
user.login string Yes No Login name
user.name string Yes No Name
user.avatar_url string Yes No Avatar URL
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 Name
updated_user.avatar_url string Yes No Avatar URL
updated_user.object_id string Yes No User object ID

Error response

400 Invalid parameters

{
  "error": "invalid_request",
  "message": "Parameter validation failed"
}

401 Unauthenticated

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

HTTP status codes

Status code Description
200 Success (OK)
401 Authentication required (Requires authentication)
403 Access forbidden (Forbidden)
404 Resource does not exist (Not found)

Request example

Parameter notes

The placeholders in the example mean:

<owner> — replace with the namespace address to which the repository belongs (address path of the enterprise, organization, or user); <repo> — replace with the repository path (path); <comment_id> — replace with the ID of the comment; <token> — replace with your AtomGit user access token.

cURL

curl -X GET 'https://api.atomgit.com/api/v5/repos/<owner>/<repo>/pulls/comment/<comment_id>/modify_history?access_token=<token>' \
  -H 'Accept: application/json'

JavaScript

const response = await fetch("https://api.atomgit.com/api/v5/repos/<owner>/<repo>/pulls/comment/<comment_id>/modify_history?access_token=<token>", {
  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>/pulls/comment/<comment_id>/modify_history",
    params={"access_token": "<token>"},
    headers={"Accept": "application/json"},
    timeout=10,
)
resp.raise_for_status()

print(resp.json())

Response example

Status code: 200

[
  {
    "id": "1",
    "created_at": "2024-01-01 10:00:00",
    "updated_at": "2024-01-02 12:00:00",
    "deleted": false,
    "created": true,
    "content": "Modified comment content",
    "user": {
      "login": "octocat",
      "name": "octocat",
      "avatar_url": "https://api.atomgit.com/avatar.png",
      "object_id": "1001"
    },
    "updated_user": {
      "login": "octocat",
      "name": "octocat",
      "avatar_url": "https://api.atomgit.com/avatar.png",
      "object_id": "1001"
    }
  }
]

Error codes

Error code Description
401 Unauthenticated or invalid credentials (missing or invalid access credentials)
400 Invalid parameters or unparseable request
404 Request path does not exist
403 Access forbidden
429 Too many requests; rate limit triggered
500 Internal system error

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