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)
Example: {{owner}}
repo stringrequired
Repository path (path)
Example: {{repo}}
number integerrequired
The ordinal number of the PR in this repository, i.e., which PR it is.
Example: 1
Query Parameters
access_token string
User authorization code
Example: {{access_token}}
page integer
Current page number: defaults to 1
Example: 1
per_page integer
The number of items per page, with a maximum of 100. The default is 20.
Example: 10
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 [
- ]
idinteger
discussion_idstring
Discussion ID
bodystring
created_atstring
updated_atstring
user object
idstringrequired
loginstringrequired
object_idstringrequired
namestringrequired
avatar_urlstringrequired
html_urlstringrequired
comment_typestring
resolvedboolean
Check if the comments have been resolved
resolved_by object
Inspector's opinion, resolved by the person in charge, only returned when the inspector's opinion has been resolved
idstringrequired
loginstringrequired
object_idstringrequired
namestringrequired
avatar_urlstringrequired
html_urlstringrequired
diff_position object
start_new_lineintegerrequired
end_new_lineintegerrequired
position_typestringrequired
"binary": "File-level comments", "text": "Code line comments".
[
{
"id": 0,
"discussion_id": "string",
"body": "string",
"created_at": "string",
"updated_at": "string",
"user": {
"id": "string",
"login": "string",
"object_id": "string",
"name": "string",
"avatar_url": "string",
"html_url": "string"
},
"comment_type": "string",
"resolved": true,
"resolved_by": {
"id": "string",
"login": "string",
"object_id": "string",
"name": "string",
"avatar_url": "string",
"html_url": "string"
},
"diff_position": {
"start_new_line": 0,
"end_new_line": 0,
"position_type": "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"
}
}