このバージョンの GitHub Enterprise はこの日付をもって終了となりました: 2022-06-03. 重大なセキュリティの問題に対してであっても、パッチリリースは作成されません。 パフォーマンスの向上、セキュリティの改善、新機能のためには、最新バージョンのGitHub Enterpriseにアップグレードしてく� さい。 アップグレードに関する支援については、GitHub Enterprise supportに連絡してく� さい。
Issueのコメント
Issue comments APIは、IssueやPull Requestのコメントの管理を支援します。
Issue comments APIについて
Issue comments APIは、IssueやPull Requestのコメントの管理を支援します。 すべてのPull Requestは Issue ですが、すべての Issue がPull Requestというわけではありません。 For this reason, "shared" actions for both features, like managing assignees, labels, and milestones, are provided within Issues API. Pull Requestのレビューコメントを管理するには、Pull request review comments APIを使ってく� さい。
Custom media types
These are the supported media types for this API:
application/vnd.github.VERSION.raw+json
application/vnd.github.VERSION.text+json
application/vnd.github.VERSION.html+json
application/vnd.github.VERSION.full+json
メディアタイプの詳しい情� �については、「カスタ� メディアタイプ」を参照してく� さい。
List issue comments for a repository
By default, Issue Comments are ordered by ascending ID.
パラメータ
Headers |
---|
名前, 種類, 説明 |
accept stringSetting to |
Path parameters |
名前, 種類, 説明 |
owner string必� �The account owner of the repository. The name is not case sensitive. |
repo string必� �The name of the repository. The name is not case sensitive. |
クエリパラメータ |
名前, 種類, 説明 |
sort stringThe property to sort the results by. デフォルト: Can be one of: |
direction stringEither Can be one of: |
since stringOnly show notifications updated after the given time. This is a timestamp in ISO 8601 format: |
per_page integerThe number of results per page (max 100). デフォルト: |
page integerPage number of the results to fetch. デフォルト: |
HTTP response status codes
Status code | 説明 |
---|---|
200 | OK |
404 | Resource not found |
422 | Validation failed |
コードサンプル
curl \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token <TOKEN>" \
http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/issues/comments
Response
Status: 200
[
{
"id": 1,
"node_id": "MDEyOklzc3VlQ29tbWVudDE=",
"url": "https://api.github.com/repos/octocat/Hello-World/issues/comments/1",
"html_url": "https://github.com/octocat/Hello-World/issues/1347#issuecomment-1",
"body": "Me too",
"user": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"created_at": "2011-04-14T16:00:49Z",
"updated_at": "2011-04-14T16:00:49Z",
"issue_url": "https://api.github.com/repos/octocat/Hello-World/issues/1347",
"author_association": "COLLABORATOR"
}
]
プレビュー通知
An additional reactions
object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the blog post for full details.
To access the API you must provide a custom media type in the Accept
header:
application/vnd.github.squirrel-girl-preview
The reactions
key will have the following payload where url
can be used to construct the API location for listing and creating reactions.
Get an issue comment
パラメータ
Headers |
---|
名前, 種類, 説明 |
accept stringSetting to |
Path parameters |
名前, 種類, 説明 |
owner string必� �The account owner of the repository. The name is not case sensitive. |
repo string必� �The name of the repository. The name is not case sensitive. |
comment_id integer必� �The unique identifier of the comment. |
HTTP response status codes
Status code | 説明 |
---|---|
200 | OK |
404 | Resource not found |
コードサンプル
curl \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token <TOKEN>" \
http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/issues/comments/COMMENT_ID
Response
Status: 200
{
"id": 1,
"node_id": "MDEyOklzc3VlQ29tbWVudDE=",
"url": "https://api.github.com/repos/octocat/Hello-World/issues/comments/1",
"html_url": "https://github.com/octocat/Hello-World/issues/1347#issuecomment-1",
"body": "Me too",
"user": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"created_at": "2011-04-14T16:00:49Z",
"updated_at": "2011-04-14T16:00:49Z",
"issue_url": "https://api.github.com/repos/octocat/Hello-World/issues/1347",
"author_association": "COLLABORATOR"
}
プレビュー通知
If an issue event is created via a GitHub App, the response will include the performed_via_github_app
object with information about the GitHub App. For more information, see the related blog post.
To receive the performed_via_github_app
object in the response, you must provide a custom media type in the Accept
header:
application/vnd.github.machine-man-preview
An additional reactions
object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the blog post for full details.
To access the API you must provide a custom media type in the Accept
header:
application/vnd.github.squirrel-girl-preview
The reactions
key will have the following payload where url
can be used to construct the API location for listing and creating reactions.
Update an issue comment
パラメータ
Headers |
---|
名前, 種類, 説明 |
accept stringSetting to |
Path parameters |
名前, 種類, 説明 |
owner string必� �The account owner of the repository. The name is not case sensitive. |
repo string必� �The name of the repository. The name is not case sensitive. |
comment_id integer必� �The unique identifier of the comment. |
Body parameters |
名前, 種類, 説明 |
body string必� �The contents of the comment. |
HTTP response status codes
Status code | 説明 |
---|---|
200 | OK |
422 | Validation failed |
コードサンプル
curl \
-X PATCH \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token <TOKEN>" \
http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/issues/comments/COMMENT_ID \
-d '{"body":"Me too"}'
Response
Status: 200
{
"id": 1,
"node_id": "MDEyOklzc3VlQ29tbWVudDE=",
"url": "https://api.github.com/repos/octocat/Hello-World/issues/comments/1",
"html_url": "https://github.com/octocat/Hello-World/issues/1347#issuecomment-1",
"body": "Me too",
"user": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"created_at": "2011-04-14T16:00:49Z",
"updated_at": "2011-04-14T16:00:49Z",
"issue_url": "https://api.github.com/repos/octocat/Hello-World/issues/1347",
"author_association": "COLLABORATOR"
}
Delete an issue comment
パラメータ
Headers |
---|
名前, 種類, 説明 |
accept stringSetting to |
Path parameters |
名前, 種類, 説明 |
owner string必� �The account owner of the repository. The name is not case sensitive. |
repo string必� �The name of the repository. The name is not case sensitive. |
comment_id integer必� �The unique identifier of the comment. |
HTTP response status codes
Status code | 説明 |
---|---|
204 | No Content |
コードサンプル
curl \
-X DELETE \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token <TOKEN>" \
http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/issues/comments/COMMENT_ID
Response
Status: 204
List issue comments
Issue Comments are ordered by ascending ID.
パラメータ
Headers |
---|
名前, 種類, 説明 |
accept stringSetting to |
Path parameters |
名前, 種類, 説明 |
owner string必� �The account owner of the repository. The name is not case sensitive. |
repo string必� �The name of the repository. The name is not case sensitive. |
issue_number integer必� �The number that identifies the issue. |
クエリパラメータ |
名前, 種類, 説明 |
since stringOnly show notifications updated after the given time. This is a timestamp in ISO 8601 format: |
per_page integerThe number of results per page (max 100). デフォルト: |
page integerPage number of the results to fetch. デフォルト: |
HTTP response status codes
Status code | 説明 |
---|---|
200 | OK |
404 | Resource not found |
410 | Gone |
コードサンプル
curl \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token <TOKEN>" \
http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/issues/ISSUE_NUMBER/comments
Response
Status: 200
[
{
"id": 1,
"node_id": "MDEyOklzc3VlQ29tbWVudDE=",
"url": "https://api.github.com/repos/octocat/Hello-World/issues/comments/1",
"html_url": "https://github.com/octocat/Hello-World/issues/1347#issuecomment-1",
"body": "Me too",
"user": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"created_at": "2011-04-14T16:00:49Z",
"updated_at": "2011-04-14T16:00:49Z",
"issue_url": "https://api.github.com/repos/octocat/Hello-World/issues/1347",
"author_association": "COLLABORATOR"
}
]
プレビュー通知
An additional reactions
object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the blog post for full details.
To access the API you must provide a custom media type in the Accept
header:
application/vnd.github.squirrel-girl-preview
The reactions
key will have the following payload where url
can be used to construct the API location for listing and creating reactions.
Create an issue comment
This endpoint triggers notifications. Creating content too quickly using this endpoint may result in secondary rate limiting. See "Secondary rate limits" and "Dealing with secondary rate limits" for details.
パラメータ
Headers |
---|
名前, 種類, 説明 |
accept stringSetting to |
Path parameters |
名前, 種類, 説明 |
owner string必� �The account owner of the repository. The name is not case sensitive. |
repo string必� �The name of the repository. The name is not case sensitive. |
issue_number integer必� �The number that identifies the issue. |
Body parameters |
名前, 種類, 説明 |
body string必� �The contents of the comment. |
HTTP response status codes
Status code | 説明 |
---|---|
201 | Created |
403 | Forbidden |
404 | Resource not found |
410 | Gone |
422 | Validation failed |
コードサンプル
curl \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token <TOKEN>" \
http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/issues/ISSUE_NUMBER/comments \
-d '{"body":"Me too"}'
Response
Status: 201
{
"id": 1,
"node_id": "MDEyOklzc3VlQ29tbWVudDE=",
"url": "https://api.github.com/repos/octocat/Hello-World/issues/comments/1",
"html_url": "https://github.com/octocat/Hello-World/issues/1347#issuecomment-1",
"body": "Me too",
"user": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"created_at": "2011-04-14T16:00:49Z",
"updated_at": "2011-04-14T16:00:49Z",
"issue_url": "https://api.github.com/repos/octocat/Hello-World/issues/1347",
"author_association": "COLLABORATOR"
}