Get All Comments of a Pull Request
GET/api/v5/repos/:owner/:repo/pulls/:number/comments
Request
Path Parameters
owner stringrequired
Repository space address (organization or individual's address path)
repo stringrequired
Repository path (path)
number integerrequired
The ordinal number of the PR in this repository, i.e., which PR it is.
Example: 0
Query Parameters
access_token string
User authorization code
page integer
Current page number: defaults to 1
per_page integer
The number of items per page, with a maximum of 100. The default is 20.
direction string
Optional. Ascending/descending (asc/desc)
comment_type string
Optional. Filter by comment type. Code line comment / PR ordinary comment: diff_comment / pr_comment
Responses
- 200
Successful Response
Response Headers
- application/json
- Schema
- Example (auto)
- Example
Schema
- Array [
- Array [
- ]
- ]
idintegerrequired
discussion_idstringrequired
Discussion ID
bodystringrequired
created_atstringrequired
updated_atstringrequired
user objectrequired
idstringrequired
loginstringrequired
namestringrequired
avatar_urlstringrequired
html_urlstringrequired
comment_typestringrequired
resolvedbooleanrequired
diff_filestringrequired
diff_position objectrequired
start_new_lineinteger
end_new_lineinteger
start_old_lineinteger
end_old_lineinteger
position_typestring
"binary": "File-level comments", "text": "Code line comments".
reply object[]
idinteger
bodystring
created_atstring
updated_atstring
user object
idstring
loginstring
namestring
avatar_urlstring
html_urlstring
[
{
"id": 0,
"discussion_id": "string",
"body": "string",
"created_at": "string",
"updated_at": "string",
"user": {
"id": "string",
"login": "string",
"name": "string",
"avatar_url": "string",
"html_url": "string"
},
"comment_type": "string",
"resolved": true,
"diff_file": "string",
"diff_position": {
"start_new_line": 0,
"end_new_line": 0,
"start_old_line": 0,
"end_old_line": 0,
"position_type": "string"
},
"reply": [
{
"id": 0,
"body": "string",
"created_at": "string",
"updated_at": "string",
"user": {
"id": "string",
"login": "string",
"name": "string",
"avatar_url": "string",
"html_url": "string"
}
}
]
}
]
{
"id": "de772738e6dab92174c0e86c052ccf9bed24f747",
"body": "111",
"created_at": "2024-04-19T07:48:59.755+00:00",
"updated_at": "2024-04-19T07:48:59.755+00:00",
"user": {
"id": 708,
"login": "Lzm_0916",
"name": "Lzm_0916",
"avatar_url": "https://gitcode-img.obs.cn-south-1.myhuaweicloud.com:443/cb/da/6cb18d9ae9f1a94b4f640d3b848351c352c7869f33d0cb68e7acad4f224c4e23.png",
"html_url": "https://test.gitcode.net/Lzm_0916"
}
}