알림에 대한 REST API 엔드포인트
REST API를 사용하여 GitHub Enterprise Server 알림을 관리합니다.
GitHub Enterprise Server 알림 정보
이러한 엔드포인트는 personal access token (classic)을(를) 사용하는 인증만 지원합니다. 자세한 내용은 "개인용 액세스 토큰 관리"을(를) 참조하세요.
REST API를 사용하여 GitHub Enterprise Server 알림을 관리할 수 있습니다. 알림에 대한 자세한 정보는 “알림 정보”을(를) 참조하세요.
이러한 엔드포인트에 대한 모든 호출에는 범위 notifications
또는 repo
범위가 필요합니다. 각각의 엔드포인트에서 문제 및 커밋에 액세스하려면 repo
범위가 필요합니다.
알림은 "스레드"로 반환됩니다. 스레드에는 문제, 끌어오기 요청 또는 커밋에 대한 현재 토론에 대한 정보가 포함됩니다.
알림은 Last-Modified
머리글을 사용한 폴링에 최적화되어 있습니다. 새 알림이 없으면 304 Not Modified
응답이 표시되고 현재 속도 제한은 그대로 유지됩니다. 폴링이 허용되는 빈도(초)를 지정하는 X-Poll-Interval
머리글이 있습니다. 서버 로드가 많은 경우 시간이 늘어날 수 있습니다. 머리글을 준수하세요.
# Add authentication to your requests
$ curl -I http(s)://HOSTNAME/api/v3/notifications
HTTP/2 200
Last-Modified: Thu, 25 Oct 2012 15:16:27 GMT
X-Poll-Interval: 60
# Pass the Last-Modified header exactly
$ curl -I http(s)://HOSTNAME/api/v3/notifications
$ -H "If-Modified-Since: Thu, 25 Oct 2012 15:16:27 GMT"
> HTTP/2 304
> X-Poll-Interval: 60
알림 이유 정보
이러한 GET 엔드포인트는 reason
키를 반환합니다. 이 reason
는 알림을 트리거하는 이벤트에 해당합니다.
알림을 받을 수 있는 몇몇 잠재적인 reason
은 다음과 같습니다.
이유 이름 | 설명 |
---|---|
approval_requested | 배포를 검토하고 승인하라는 요청을 받았습니다. 자세한 내용은 "배포 검토"을(를) 참조하세요. |
assign | 문제에 할당되었습니다. |
author | 스레드를 만들었습니다. |
comment | 스레드에 주석을 달았습니다. |
ci_activity | 트리거한 GitHub Actions 워크플로 실행이 완료되었습니다. |
invitation | 리포지토리에 기여하라는 초대를 수락했습니다. |
manual | 문제 또는 끌어오기 요청을 통해 스레드를 구독했습니다. |
member_feature_requested | 조직 구성원이 초안 끌어오기 요청 또는 CoPilot과 같은 기능을 사용하도록 요청했습니다. |
mention | 귀하는 콘텐츠에서 특별히 @mentioned되었습니다. |
review_requested | 귀하 또는 귀하가 속한 팀이 끌어오기 요청을 검토하도록 요청받았습니다. |
security_advisory_credit | 보안 권고에 기여한 것으로 인정되었습니다. |
state_change | 스레드 상태를 변경했습니다(예: 문제 닫기 또는 끌어오기 요청 병합). |
subscribed | 리포지토리를 보고 있습니다. |
team_mention | 언급된 팀에 있었습니다. |
reason
은 스레드별로 수정되며 이후 알림의 reason
이 다른 경우 변경될 수 있습니다.
예를 들어 문제의 작성자인 경우 해당 문제에 대한 후속 알림에는 reason
의 author
가 있습니다. 동일한 문제에 대해 @mentioned가 있는 경우 이후에 가져오는 알림의 reason
은 mention
입니다. reason
은 다시 언급되었는지 여부에 관계없이 mention
으로 유지됩니다.
List notifications for the authenticated user
List all notifications for the current user, sorted by most recently updated.
"List notifications for the authenticated user"에 대한 세분화된 액세스 토큰
이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:
세분화된 토큰에는 다음 권한 집합이 있어야 합니다.:
- "Metadata" repository permissions (read) and "Notifications" user permissions (read)
"List notifications for the authenticated user"에 대한 매개 변수
속성, 형식, 설명 |
---|
accept string Setting to |
속성, 형식, 설명 |
---|
all boolean If 기본값: |
participating boolean If 기본값: |
since string Only show results that were last updated after the given time. This is a timestamp in ISO 8601 format: |
before string Only show notifications updated before the given time. This is a timestamp in ISO 8601 format: |
page integer The page number of the results to fetch. For more information, see "Using pagination in the REST API." 기본값: |
per_page integer The number of results per page (max 50). For more information, see "Using pagination in the REST API." 기본값: |
"List notifications for the authenticated user"에 대한 HTTP 응답 상태 코드
상태 코드 | 설명 |
---|---|
200 | OK |
304 | Not modified |
401 | Requires authentication |
403 | Forbidden |
422 | Validation failed, or the endpoint has been spammed. |
"List notifications for the authenticated user"에 대한 코드 샘플
요청 예제
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/notifications
Response
Status: 200
[
{
"id": "1",
"repository": {
"id": 1296269,
"node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
"name": "Hello-World",
"full_name": "octocat/Hello-World",
"owner": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://HOSTNAME/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://HOSTNAME/users/octocat/followers",
"following_url": "https://HOSTNAME/users/octocat/following{/other_user}",
"gists_url": "https://HOSTNAME/users/octocat/gists{/gist_id}",
"starred_url": "https://HOSTNAME/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://HOSTNAME/users/octocat/subscriptions",
"organizations_url": "https://HOSTNAME/users/octocat/orgs",
"repos_url": "https://HOSTNAME/users/octocat/repos",
"events_url": "https://HOSTNAME/users/octocat/events{/privacy}",
"received_events_url": "https://HOSTNAME/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"private": false,
"html_url": "https://github.com/octocat/Hello-World",
"description": "This your first repo!",
"fork": false,
"url": "https://HOSTNAME/repos/octocat/Hello-World",
"archive_url": "https://HOSTNAME/repos/octocat/Hello-World/{archive_format}{/ref}",
"assignees_url": "https://HOSTNAME/repos/octocat/Hello-World/assignees{/user}",
"blobs_url": "https://HOSTNAME/repos/octocat/Hello-World/git/blobs{/sha}",
"branches_url": "https://HOSTNAME/repos/octocat/Hello-World/branches{/branch}",
"collaborators_url": "https://HOSTNAME/repos/octocat/Hello-World/collaborators{/collaborator}",
"comments_url": "https://HOSTNAME/repos/octocat/Hello-World/comments{/number}",
"commits_url": "https://HOSTNAME/repos/octocat/Hello-World/commits{/sha}",
"compare_url": "https://HOSTNAME/repos/octocat/Hello-World/compare/{base}...{head}",
"contents_url": "https://HOSTNAME/repos/octocat/Hello-World/contents/{+path}",
"contributors_url": "https://HOSTNAME/repos/octocat/Hello-World/contributors",
"deployments_url": "https://HOSTNAME/repos/octocat/Hello-World/deployments",
"downloads_url": "https://HOSTNAME/repos/octocat/Hello-World/downloads",
"events_url": "https://HOSTNAME/repos/octocat/Hello-World/events",
"forks_url": "https://HOSTNAME/repos/octocat/Hello-World/forks",
"git_commits_url": "https://HOSTNAME/repos/octocat/Hello-World/git/commits{/sha}",
"git_refs_url": "https://HOSTNAME/repos/octocat/Hello-World/git/refs{/sha}",
"git_tags_url": "https://HOSTNAME/repos/octocat/Hello-World/git/tags{/sha}",
"git_url": "git:github.com/octocat/Hello-World.git",
"issue_comment_url": "https://HOSTNAME/repos/octocat/Hello-World/issues/comments{/number}",
"issue_events_url": "https://HOSTNAME/repos/octocat/Hello-World/issues/events{/number}",
"issues_url": "https://HOSTNAME/repos/octocat/Hello-World/issues{/number}",
"keys_url": "https://HOSTNAME/repos/octocat/Hello-World/keys{/key_id}",
"labels_url": "https://HOSTNAME/repos/octocat/Hello-World/labels{/name}",
"languages_url": "https://HOSTNAME/repos/octocat/Hello-World/languages",
"merges_url": "https://HOSTNAME/repos/octocat/Hello-World/merges",
"milestones_url": "https://HOSTNAME/repos/octocat/Hello-World/milestones{/number}",
"notifications_url": "https://HOSTNAME/repos/octocat/Hello-World/notifications{?since,all,participating}",
"pulls_url": "https://HOSTNAME/repos/octocat/Hello-World/pulls{/number}",
"releases_url": "https://HOSTNAME/repos/octocat/Hello-World/releases{/id}",
"ssh_url": "git@github.com:octocat/Hello-World.git",
"stargazers_url": "https://HOSTNAME/repos/octocat/Hello-World/stargazers",
"statuses_url": "https://HOSTNAME/repos/octocat/Hello-World/statuses/{sha}",
"subscribers_url": "https://HOSTNAME/repos/octocat/Hello-World/subscribers",
"subscription_url": "https://HOSTNAME/repos/octocat/Hello-World/subscription",
"tags_url": "https://HOSTNAME/repos/octocat/Hello-World/tags",
"teams_url": "https://HOSTNAME/repos/octocat/Hello-World/teams",
"trees_url": "https://HOSTNAME/repos/octocat/Hello-World/git/trees{/sha}",
"hooks_url": "http://HOSTNAME/repos/octocat/Hello-World/hooks"
},
"subject": {
"title": "Greetings",
"url": "https://HOSTNAME/repos/octokit/octokit.rb/issues/123",
"latest_comment_url": "https://HOSTNAME/repos/octokit/octokit.rb/issues/comments/123",
"type": "Issue"
},
"reason": "subscribed",
"unread": true,
"updated_at": "2014-11-07T22:01:45Z",
"last_read_at": "2014-11-07T22:01:45Z",
"url": "https://HOSTNAME/notifications/threads/1",
"subscription_url": "https://HOSTNAME/notifications/threads/1/subscription"
}
]
Mark notifications as read
Marks all notifications as "read" for the current user. If the number of notifications is too large to complete in one request, you will receive a 202 Accepted
status and GitHub Enterprise Server will run an asynchronous process to mark notifications as "read." To check whether any "unread" notifications remain, you can use the List notifications for the authenticated user endpoint and pass the query parameter all=false
.
"Mark notifications as read"에 대한 세분화된 액세스 토큰
이 엔드포인트는 GitHub 앱 사용자 액세스 토큰, GitHub 앱 설치 액세스 토큰 또는 세분화된 개인용 액세스 토큰에서 작동하지 않습니다.
"Mark notifications as read"에 대한 매개 변수
속성, 형식, 설명 |
---|
accept string Setting to |
속성, 형식, 설명 |
---|
last_read_at string Describes the last point that notifications were checked. Anything updated since this time will not be marked as read. If you omit this parameter, all notifications are marked as read. This is a timestamp in ISO 8601 format: |
read boolean Whether the notification has been read. |
"Mark notifications as read"에 대한 HTTP 응답 상태 코드
상태 코드 | 설명 |
---|---|
202 | Accepted |
205 | Reset Content |
304 | Not modified |
401 | Requires authentication |
403 | Forbidden |
"Mark notifications as read"에 대한 코드 샘플
요청 예제
curl -L \
-X PUT \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/notifications \
-d '{"last_read_at":"2022-06-10T00:00:00Z","read":true}'
Response
Get a thread
Gets information about a notification thread.
"Get a thread"에 대한 세분화된 액세스 토큰
이 엔드포인트는 GitHub 앱 사용자 액세스 토큰, GitHub 앱 설치 액세스 토큰 또는 세분화된 개인용 액세스 토큰에서 작동하지 않습니다.
"Get a thread"에 대한 매개 변수
속성, 형식, 설명 |
---|
accept string Setting to |
속성, 형식, 설명 |
---|
thread_id integer RequiredThe unique identifier of the notification thread. This corresponds to the value returned in the |
"Get a thread"에 대한 HTTP 응답 상태 코드
상태 코드 | 설명 |
---|---|
200 | OK |
304 | Not modified |
401 | Requires authentication |
403 | Forbidden |
"Get a thread"에 대한 코드 샘플
요청 예제
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/notifications/threads/THREAD_ID
Response
Status: 200
{
"id": "1",
"repository": {
"id": 1296269,
"node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
"name": "Hello-World",
"full_name": "octocat/Hello-World",
"owner": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://HOSTNAME/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://HOSTNAME/users/octocat/followers",
"following_url": "https://HOSTNAME/users/octocat/following{/other_user}",
"gists_url": "https://HOSTNAME/users/octocat/gists{/gist_id}",
"starred_url": "https://HOSTNAME/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://HOSTNAME/users/octocat/subscriptions",
"organizations_url": "https://HOSTNAME/users/octocat/orgs",
"repos_url": "https://HOSTNAME/users/octocat/repos",
"events_url": "https://HOSTNAME/users/octocat/events{/privacy}",
"received_events_url": "https://HOSTNAME/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"private": false,
"html_url": "https://github.com/octocat/Hello-World",
"description": "This your first repo!",
"fork": false,
"url": "https://HOSTNAME/repos/octocat/Hello-World",
"archive_url": "https://HOSTNAME/repos/octocat/Hello-World/{archive_format}{/ref}",
"assignees_url": "https://HOSTNAME/repos/octocat/Hello-World/assignees{/user}",
"blobs_url": "https://HOSTNAME/repos/octocat/Hello-World/git/blobs{/sha}",
"branches_url": "https://HOSTNAME/repos/octocat/Hello-World/branches{/branch}",
"collaborators_url": "https://HOSTNAME/repos/octocat/Hello-World/collaborators{/collaborator}",
"comments_url": "https://HOSTNAME/repos/octocat/Hello-World/comments{/number}",
"commits_url": "https://HOSTNAME/repos/octocat/Hello-World/commits{/sha}",
"compare_url": "https://HOSTNAME/repos/octocat/Hello-World/compare/{base}...{head}",
"contents_url": "https://HOSTNAME/repos/octocat/Hello-World/contents/{+path}",
"contributors_url": "https://HOSTNAME/repos/octocat/Hello-World/contributors",
"deployments_url": "https://HOSTNAME/repos/octocat/Hello-World/deployments",
"downloads_url": "https://HOSTNAME/repos/octocat/Hello-World/downloads",
"events_url": "https://HOSTNAME/repos/octocat/Hello-World/events",
"forks_url": "https://HOSTNAME/repos/octocat/Hello-World/forks",
"git_commits_url": "https://HOSTNAME/repos/octocat/Hello-World/git/commits{/sha}",
"git_refs_url": "https://HOSTNAME/repos/octocat/Hello-World/git/refs{/sha}",
"git_tags_url": "https://HOSTNAME/repos/octocat/Hello-World/git/tags{/sha}",
"git_url": "git:github.com/octocat/Hello-World.git",
"issue_comment_url": "https://HOSTNAME/repos/octocat/Hello-World/issues/comments{/number}",
"issue_events_url": "https://HOSTNAME/repos/octocat/Hello-World/issues/events{/number}",
"issues_url": "https://HOSTNAME/repos/octocat/Hello-World/issues{/number}",
"keys_url": "https://HOSTNAME/repos/octocat/Hello-World/keys{/key_id}",
"labels_url": "https://HOSTNAME/repos/octocat/Hello-World/labels{/name}",
"languages_url": "https://HOSTNAME/repos/octocat/Hello-World/languages",
"merges_url": "https://HOSTNAME/repos/octocat/Hello-World/merges",
"milestones_url": "https://HOSTNAME/repos/octocat/Hello-World/milestones{/number}",
"notifications_url": "https://HOSTNAME/repos/octocat/Hello-World/notifications{?since,all,participating}",
"pulls_url": "https://HOSTNAME/repos/octocat/Hello-World/pulls{/number}",
"releases_url": "https://HOSTNAME/repos/octocat/Hello-World/releases{/id}",
"ssh_url": "git@github.com:octocat/Hello-World.git",
"stargazers_url": "https://HOSTNAME/repos/octocat/Hello-World/stargazers",
"statuses_url": "https://HOSTNAME/repos/octocat/Hello-World/statuses/{sha}",
"subscribers_url": "https://HOSTNAME/repos/octocat/Hello-World/subscribers",
"subscription_url": "https://HOSTNAME/repos/octocat/Hello-World/subscription",
"tags_url": "https://HOSTNAME/repos/octocat/Hello-World/tags",
"teams_url": "https://HOSTNAME/repos/octocat/Hello-World/teams",
"trees_url": "https://HOSTNAME/repos/octocat/Hello-World/git/trees{/sha}",
"hooks_url": "http://HOSTNAME/repos/octocat/Hello-World/hooks"
},
"subject": {
"title": "Greetings",
"url": "https://HOSTNAME/repos/octokit/octokit.rb/issues/123",
"latest_comment_url": "https://HOSTNAME/repos/octokit/octokit.rb/issues/comments/123",
"type": "Issue"
},
"reason": "subscribed",
"unread": true,
"updated_at": "2014-11-07T22:01:45Z",
"last_read_at": "2014-11-07T22:01:45Z",
"url": "https://HOSTNAME/notifications/threads/1",
"subscription_url": "https://HOSTNAME/notifications/threads/1/subscription"
}
Mark a thread as read
Marks a thread as "read." Marking a thread as "read" is equivalent to clicking a notification in your notification inbox on GitHub Enterprise Server: https://github.com/notifications.
"Mark a thread as read"에 대한 세분화된 액세스 토큰
이 엔드포인트는 GitHub 앱 사용자 액세스 토큰, GitHub 앱 설치 액세스 토큰 또는 세분화된 개인용 액세스 토큰에서 작동하지 않습니다.
"Mark a thread as read"에 대한 매개 변수
속성, 형식, 설명 |
---|
accept string Setting to |
속성, 형식, 설명 |
---|
thread_id integer RequiredThe unique identifier of the notification thread. This corresponds to the value returned in the |
"Mark a thread as read"에 대한 HTTP 응답 상태 코드
상태 코드 | 설명 |
---|---|
205 | Reset Content |
304 | Not modified |
403 | Forbidden |
"Mark a thread as read"에 대한 코드 샘플
요청 예제
curl -L \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/notifications/threads/THREAD_ID
Reset Content
Status: 205
Get a thread subscription for the authenticated user
This checks to see if the current user is subscribed to a thread. You can also get a repository subscription.
Note that subscriptions are only generated if a user is participating in a conversation--for example, they've replied to the thread, were @mentioned, or manually subscribe to a thread.
"Get a thread subscription for the authenticated user"에 대한 세분화된 액세스 토큰
이 엔드포인트는 GitHub 앱 사용자 액세스 토큰, GitHub 앱 설치 액세스 토큰 또는 세분화된 개인용 액세스 토큰에서 작동하지 않습니다.
"Get a thread subscription for the authenticated user"에 대한 매개 변수
속성, 형식, 설명 |
---|
accept string Setting to |
속성, 형식, 설명 |
---|
thread_id integer RequiredThe unique identifier of the notification thread. This corresponds to the value returned in the |
"Get a thread subscription for the authenticated user"에 대한 HTTP 응답 상태 코드
상태 코드 | 설명 |
---|---|
200 | OK |
304 | Not modified |
401 | Requires authentication |
403 | Forbidden |
"Get a thread subscription for the authenticated user"에 대한 코드 샘플
요청 예제
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/notifications/threads/THREAD_ID/subscription
Response
Set a thread subscription
If you are watching a repository, you receive notifications for all threads by default. Use this endpoint to ignore future notifications for threads until you comment on the thread or get an @mention.
You can also use this endpoint to subscribe to threads that you are currently not receiving notifications for or to subscribed to threads that you have previously ignored.
Unsubscribing from a conversation in a repository that you are not watching is functionally equivalent to the Delete a thread subscription endpoint.
"Set a thread subscription"에 대한 세분화된 액세스 토큰
이 엔드포인트는 GitHub 앱 사용자 액세스 토큰, GitHub 앱 설치 액세스 토큰 또는 세분화된 개인용 액세스 토큰에서 작동하지 않습니다.
"Set a thread subscription"에 대한 매개 변수
속성, 형식, 설명 |
---|
accept string Setting to |
속성, 형식, 설명 |
---|
thread_id integer RequiredThe unique identifier of the notification thread. This corresponds to the value returned in the |
속성, 형식, 설명 |
---|
ignored boolean Whether to block all notifications from a thread. 기본값: |
"Set a thread subscription"에 대한 HTTP 응답 상태 코드
상태 코드 | 설명 |
---|---|
200 | OK |
304 | Not modified |
401 | Requires authentication |
403 | Forbidden |
"Set a thread subscription"에 대한 코드 샘플
요청 예제
curl -L \
-X PUT \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/notifications/threads/THREAD_ID/subscription \
-d '{"ignored":false}'
Response
Delete a thread subscription
Mutes all future notifications for a conversation until you comment on the thread or get an @mention. If you are watching the repository of the thread, you will still receive notifications. To ignore future notifications for a repository you are watching, use the Set a thread subscription endpoint and set ignore
to true
.
"Delete a thread subscription"에 대한 세분화된 액세스 토큰
이 엔드포인트는 GitHub 앱 사용자 액세스 토큰, GitHub 앱 설치 액세스 토큰 또는 세분화된 개인용 액세스 토큰에서 작동하지 않습니다.
"Delete a thread subscription"에 대한 매개 변수
속성, 형식, 설명 |
---|
accept string Setting to |
속성, 형식, 설명 |
---|
thread_id integer RequiredThe unique identifier of the notification thread. This corresponds to the value returned in the |
"Delete a thread subscription"에 대한 HTTP 응답 상태 코드
상태 코드 | 설명 |
---|---|
204 | No Content |
304 | Not modified |
401 | Requires authentication |
403 | Forbidden |
"Delete a thread subscription"에 대한 코드 샘플
요청 예제
curl -L \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/notifications/threads/THREAD_ID/subscription
Response
Status: 204
List repository notifications for the authenticated user
Lists all notifications for the current user in the specified repository.
"List repository notifications for the authenticated user"에 대한 세분화된 액세스 토큰
이 엔드포인트는 GitHub 앱 사용자 액세스 토큰, GitHub 앱 설치 액세스 토큰 또는 세분화된 개인용 액세스 토큰에서 작동하지 않습니다.
"List repository notifications for the authenticated user"에 대한 매개 변수
속성, 형식, 설명 |
---|
accept string Setting to |
속성, 형식, 설명 |
---|
owner string RequiredThe account owner of the repository. The name is not case sensitive. |
repo string RequiredThe name of the repository without the |
속성, 형식, 설명 |
---|
all boolean If 기본값: |
participating boolean If 기본값: |
since string Only show results that were last updated after the given time. This is a timestamp in ISO 8601 format: |
before string Only show notifications updated before the given time. This is a timestamp in ISO 8601 format: |
per_page integer The number of results per page (max 100). For more information, see "Using pagination in the REST API." 기본값: |
page integer The page number of the results to fetch. For more information, see "Using pagination in the REST API." 기본값: |
"List repository notifications for the authenticated user"에 대한 HTTP 응답 상태 코드
상태 코드 | 설명 |
---|---|
200 | OK |
"List repository notifications for the authenticated user"에 대한 코드 샘플
요청 예제
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/notifications
Response
Status: 200
[
{
"id": "1",
"repository": {
"id": 1296269,
"node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
"name": "Hello-World",
"full_name": "octocat/Hello-World",
"owner": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://HOSTNAME/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://HOSTNAME/users/octocat/followers",
"following_url": "https://HOSTNAME/users/octocat/following{/other_user}",
"gists_url": "https://HOSTNAME/users/octocat/gists{/gist_id}",
"starred_url": "https://HOSTNAME/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://HOSTNAME/users/octocat/subscriptions",
"organizations_url": "https://HOSTNAME/users/octocat/orgs",
"repos_url": "https://HOSTNAME/users/octocat/repos",
"events_url": "https://HOSTNAME/users/octocat/events{/privacy}",
"received_events_url": "https://HOSTNAME/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"private": false,
"html_url": "https://github.com/octocat/Hello-World",
"description": "This your first repo!",
"fork": false,
"url": "https://HOSTNAME/repos/octocat/Hello-World",
"archive_url": "https://HOSTNAME/repos/octocat/Hello-World/{archive_format}{/ref}",
"assignees_url": "https://HOSTNAME/repos/octocat/Hello-World/assignees{/user}",
"blobs_url": "https://HOSTNAME/repos/octocat/Hello-World/git/blobs{/sha}",
"branches_url": "https://HOSTNAME/repos/octocat/Hello-World/branches{/branch}",
"collaborators_url": "https://HOSTNAME/repos/octocat/Hello-World/collaborators{/collaborator}",
"comments_url": "https://HOSTNAME/repos/octocat/Hello-World/comments{/number}",
"commits_url": "https://HOSTNAME/repos/octocat/Hello-World/commits{/sha}",
"compare_url": "https://HOSTNAME/repos/octocat/Hello-World/compare/{base}...{head}",
"contents_url": "https://HOSTNAME/repos/octocat/Hello-World/contents/{+path}",
"contributors_url": "https://HOSTNAME/repos/octocat/Hello-World/contributors",
"deployments_url": "https://HOSTNAME/repos/octocat/Hello-World/deployments",
"downloads_url": "https://HOSTNAME/repos/octocat/Hello-World/downloads",
"events_url": "https://HOSTNAME/repos/octocat/Hello-World/events",
"forks_url": "https://HOSTNAME/repos/octocat/Hello-World/forks",
"git_commits_url": "https://HOSTNAME/repos/octocat/Hello-World/git/commits{/sha}",
"git_refs_url": "https://HOSTNAME/repos/octocat/Hello-World/git/refs{/sha}",
"git_tags_url": "https://HOSTNAME/repos/octocat/Hello-World/git/tags{/sha}",
"git_url": "git:github.com/octocat/Hello-World.git",
"issue_comment_url": "https://HOSTNAME/repos/octocat/Hello-World/issues/comments{/number}",
"issue_events_url": "https://HOSTNAME/repos/octocat/Hello-World/issues/events{/number}",
"issues_url": "https://HOSTNAME/repos/octocat/Hello-World/issues{/number}",
"keys_url": "https://HOSTNAME/repos/octocat/Hello-World/keys{/key_id}",
"labels_url": "https://HOSTNAME/repos/octocat/Hello-World/labels{/name}",
"languages_url": "https://HOSTNAME/repos/octocat/Hello-World/languages",
"merges_url": "https://HOSTNAME/repos/octocat/Hello-World/merges",
"milestones_url": "https://HOSTNAME/repos/octocat/Hello-World/milestones{/number}",
"notifications_url": "https://HOSTNAME/repos/octocat/Hello-World/notifications{?since,all,participating}",
"pulls_url": "https://HOSTNAME/repos/octocat/Hello-World/pulls{/number}",
"releases_url": "https://HOSTNAME/repos/octocat/Hello-World/releases{/id}",
"ssh_url": "git@github.com:octocat/Hello-World.git",
"stargazers_url": "https://HOSTNAME/repos/octocat/Hello-World/stargazers",
"statuses_url": "https://HOSTNAME/repos/octocat/Hello-World/statuses/{sha}",
"subscribers_url": "https://HOSTNAME/repos/octocat/Hello-World/subscribers",
"subscription_url": "https://HOSTNAME/repos/octocat/Hello-World/subscription",
"tags_url": "https://HOSTNAME/repos/octocat/Hello-World/tags",
"teams_url": "https://HOSTNAME/repos/octocat/Hello-World/teams",
"trees_url": "https://HOSTNAME/repos/octocat/Hello-World/git/trees{/sha}",
"hooks_url": "http://HOSTNAME/repos/octocat/Hello-World/hooks"
},
"subject": {
"title": "Greetings",
"url": "https://HOSTNAME/repos/octokit/octokit.rb/issues/123",
"latest_comment_url": "https://HOSTNAME/repos/octokit/octokit.rb/issues/comments/123",
"type": "Issue"
},
"reason": "subscribed",
"unread": true,
"updated_at": "2014-11-07T22:01:45Z",
"last_read_at": "2014-11-07T22:01:45Z",
"url": "https://HOSTNAME/notifications/threads/1",
"subscription_url": "https://HOSTNAME/notifications/threads/1/subscription"
}
]
Mark repository notifications as read
Marks all notifications in a repository as "read" for the current user. If the number of notifications is too large to complete in one request, you will receive a 202 Accepted
status and GitHub Enterprise Server will run an asynchronous process to mark notifications as "read." To check whether any "unread" notifications remain, you can use the List repository notifications for the authenticated user endpoint and pass the query parameter all=false
.
"Mark repository notifications as read"에 대한 세분화된 액세스 토큰
이 엔드포인트는 GitHub 앱 사용자 액세스 토큰, GitHub 앱 설치 액세스 토큰 또는 세분화된 개인용 액세스 토큰에서 작동하지 않습니다.
"Mark repository notifications as read"에 대한 매개 변수
속성, 형식, 설명 |
---|
accept string Setting to |
속성, 형식, 설명 |
---|
owner string RequiredThe account owner of the repository. The name is not case sensitive. |
repo string RequiredThe name of the repository without the |
속성, 형식, 설명 |
---|
last_read_at string Describes the last point that notifications were checked. Anything updated since this time will not be marked as read. If you omit this parameter, all notifications are marked as read. This is a timestamp in ISO 8601 format: |
"Mark repository notifications as read"에 대한 HTTP 응답 상태 코드
상태 코드 | 설명 |
---|---|
202 | Accepted |
205 | Reset Content |
"Mark repository notifications as read"에 대한 코드 샘플
요청 예제
curl -L \
-X PUT \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/notifications \
-d '{"last_read_at":"2019-01-01T00:00:00Z"}'
Response