Esta versão do GitHub Enterprise foi descontinuada em 2022-06-03. Nenhum lançamento de patch será feito, mesmo para questões críticas de segurança. Para obter melhor desempenho, melhorar a segurança e novos recursos, upgrade to the latest version of GitHub Enterprise. Para ajuda com a atualização, contact GitHub Enterprise support.
Notificações
A API de Notificações permite que você gerencie as notificações de GitHub Enterprise Server.
Sobre a API de Notificações
A API de Notificações permite que você gerencie as notificações de GitHub Enterprise Server. Para obter mais informações sobre as notificações, consulte "Sobre as notificações".
Todas as chamadas de notificação da API requerem escopos da API para notificações
ou repositórios
. Fazer isto dará acesso somente-leitura a algum problema e fará commit do conteúdo. Você ainda precisará do escopo de repositório
para acessar problemas e commits de seus respectivos pontos de extremidade.
Notificações retornam como "correntes". Uma corrente contém informações sobre a discussão atual de um problema, pull request ou commit.
As notificações são otimizadas para sondagem com o cabeçalho Last-Modified
. Se não houver novas notificações, você verá uma resposta 304 Not Modified
, deixando a sua taxa de limite atual inalterada. Há um cabeçalho X-Poll-Interval
que especifica com que frequência (em segundos) que você pode fazer a sondagem. Em tempos de alta carga do servidor, o tempo pode aumentar. Obedeça o cabeçalho.
# 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
Sobre motivos da notificação
Ao recuperar respostas da API de Notificações, cada carga tem uma carga denominada drazão
. Estas correspondem a eventos que ativam uma notificação.
Esses são possíveis motivos
para receber uma notificação:
Nome da razão | Descrição |
---|---|
assign | O problema foi atribuído a você. |
autor | Você criou a corrente. |
comentário | Você comentou na corrente. |
ci_activity | A execução de um fluxo de trabalho GitHub Actions que você acionou foi concluída. |
convite | Você aceitou um convite para contribuir com o repositório. |
manual | Você assinou a corrente (por meio de um problema ou pull request). |
menção | Você foi especificamente @mentioned no conteúdo. |
review_requested | Foi solicitado que você ou uma equipe da qual você é integrante revise um pull request. |
state_change | Você alterou o estado da corrente (por exemplo, fechando um problema ou mesclando um pull request). |
assinado | Você está inspecionando o repositório. |
team_mention | Você estava em uma equipe que foi mencionada. |
Observe que a razão
é modificada em uma base de corrente e pode mudar se a razão
em uma notificação posterior for diferente.
Por exemplo, se você é o autor de um problema, as notificações subsequentes sobre essa problema terão uma razão
do autor
. Portanto, se você for @mentioned no mesmo problema, as notificações que você buscar subsequentemente terão uma razão
a mencionar
. A razão
permanece como menção
, independentemente se você já foi mencionado novamente.
List notifications for the authenticated user
List all notifications for the current user, sorted by most recently updated.
Parâmetros
Headers |
---|
Nome, Tipo, Descrição |
accept stringSetting to |
Parâmetros de consulta |
Nome, Tipo, Descrição |
all booleanIf Padrão: |
participating booleanIf Padrão: |
since stringOnly show notifications updated after the given time. This is a timestamp in ISO 8601 format: |
before stringOnly show notifications updated before the given time. This is a timestamp in ISO 8601 format: |
per_page integerThe number of results per page (max 100). Padrão: |
page integerPage number of the results to fetch. Padrão: |
HTTP response status codes
Status code | Descrição |
---|---|
200 | OK |
304 | Not modified |
401 | Requires authentication |
403 | Forbidden |
422 | Validation failed |
Amostras de código
curl \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token <TOKEN>" \
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://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
},
"private": false,
"html_url": "https://github.com/octocat/Hello-World",
"description": "This your first repo!",
"fork": false,
"url": "https://api.github.com/repos/octocat/Hello-World",
"archive_url": "https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
"assignees_url": "https://api.github.com/repos/octocat/Hello-World/assignees{/user}",
"blobs_url": "https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
"branches_url": "https://api.github.com/repos/octocat/Hello-World/branches{/branch}",
"collaborators_url": "https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
"comments_url": "https://api.github.com/repos/octocat/Hello-World/comments{/number}",
"commits_url": "https://api.github.com/repos/octocat/Hello-World/commits{/sha}",
"compare_url": "https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
"contents_url": "https://api.github.com/repos/octocat/Hello-World/contents/{+path}",
"contributors_url": "https://api.github.com/repos/octocat/Hello-World/contributors",
"deployments_url": "https://api.github.com/repos/octocat/Hello-World/deployments",
"downloads_url": "https://api.github.com/repos/octocat/Hello-World/downloads",
"events_url": "https://api.github.com/repos/octocat/Hello-World/events",
"forks_url": "https://api.github.com/repos/octocat/Hello-World/forks",
"git_commits_url": "https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
"git_refs_url": "https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
"git_tags_url": "https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
"git_url": "git:github.com/octocat/Hello-World.git",
"issue_comment_url": "https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
"issue_events_url": "https://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
"issues_url": "https://api.github.com/repos/octocat/Hello-World/issues{/number}",
"keys_url": "https://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
"labels_url": "https://api.github.com/repos/octocat/Hello-World/labels{/name}",
"languages_url": "https://api.github.com/repos/octocat/Hello-World/languages",
"merges_url": "https://api.github.com/repos/octocat/Hello-World/merges",
"milestones_url": "https://api.github.com/repos/octocat/Hello-World/milestones{/number}",
"notifications_url": "https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
"pulls_url": "https://api.github.com/repos/octocat/Hello-World/pulls{/number}",
"releases_url": "https://api.github.com/repos/octocat/Hello-World/releases{/id}",
"ssh_url": "git@github.com:octocat/Hello-World.git",
"stargazers_url": "https://api.github.com/repos/octocat/Hello-World/stargazers",
"statuses_url": "https://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
"subscribers_url": "https://api.github.com/repos/octocat/Hello-World/subscribers",
"subscription_url": "https://api.github.com/repos/octocat/Hello-World/subscription",
"tags_url": "https://api.github.com/repos/octocat/Hello-World/tags",
"teams_url": "https://api.github.com/repos/octocat/Hello-World/teams",
"trees_url": "https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}",
"hooks_url": "http://api.github.com/repos/octocat/Hello-World/hooks"
},
"subject": {
"title": "Greetings",
"url": "https://api.github.com/repos/octokit/octokit.rb/issues/123",
"latest_comment_url": "https://api.github.com/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://api.github.com/notifications/threads/1",
"subscription_url": "https://api.github.com/notifications/threads/1/subscription"
}
]
Mark notifications as read
Marks all notifications as "read" removes it from the default view on GitHub Enterprise Server. 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
.
Parâmetros
Headers |
---|
Nome, Tipo, Descrição |
accept stringSetting to |
Body parameters |
Nome, Tipo, Descrição |
last_read_at stringDescribes 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 booleanWhether the notification has been read. |
HTTP response status codes
Status code | Descrição |
---|---|
202 | Accepted |
205 | Reset Content |
304 | Not modified |
401 | Requires authentication |
403 | Forbidden |
Amostras de código
curl \
-X PUT \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token <TOKEN>" \
http(s)://HOSTNAME/api/v3/notifications \
-d '{"last_read_at":"2022-06-10T00:00:00Z","read":true}'
Response
Status: 202
{
"message": "Unread notifications couldn't be marked in a single request. Notifications are being marked as read in the background."
}
Get a thread
Parâmetros
Headers |
---|
Nome, Tipo, Descrição |
accept stringSetting to |
Path parameters |
Nome, Tipo, Descrição |
thread_id integerObrigatórioThe unique identifier of the pull request thread. |
HTTP response status codes
Status code | Descrição |
---|---|
200 | OK |
304 | Not modified |
401 | Requires authentication |
403 | Forbidden |
Amostras de código
curl \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token <TOKEN>" \
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://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
},
"private": false,
"html_url": "https://github.com/octocat/Hello-World",
"description": "This your first repo!",
"fork": false,
"url": "https://api.github.com/repos/octocat/Hello-World",
"archive_url": "https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
"assignees_url": "https://api.github.com/repos/octocat/Hello-World/assignees{/user}",
"blobs_url": "https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
"branches_url": "https://api.github.com/repos/octocat/Hello-World/branches{/branch}",
"collaborators_url": "https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
"comments_url": "https://api.github.com/repos/octocat/Hello-World/comments{/number}",
"commits_url": "https://api.github.com/repos/octocat/Hello-World/commits{/sha}",
"compare_url": "https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
"contents_url": "https://api.github.com/repos/octocat/Hello-World/contents/{+path}",
"contributors_url": "https://api.github.com/repos/octocat/Hello-World/contributors",
"deployments_url": "https://api.github.com/repos/octocat/Hello-World/deployments",
"downloads_url": "https://api.github.com/repos/octocat/Hello-World/downloads",
"events_url": "https://api.github.com/repos/octocat/Hello-World/events",
"forks_url": "https://api.github.com/repos/octocat/Hello-World/forks",
"git_commits_url": "https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
"git_refs_url": "https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
"git_tags_url": "https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
"git_url": "git:github.com/octocat/Hello-World.git",
"issue_comment_url": "https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
"issue_events_url": "https://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
"issues_url": "https://api.github.com/repos/octocat/Hello-World/issues{/number}",
"keys_url": "https://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
"labels_url": "https://api.github.com/repos/octocat/Hello-World/labels{/name}",
"languages_url": "https://api.github.com/repos/octocat/Hello-World/languages",
"merges_url": "https://api.github.com/repos/octocat/Hello-World/merges",
"milestones_url": "https://api.github.com/repos/octocat/Hello-World/milestones{/number}",
"notifications_url": "https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
"pulls_url": "https://api.github.com/repos/octocat/Hello-World/pulls{/number}",
"releases_url": "https://api.github.com/repos/octocat/Hello-World/releases{/id}",
"ssh_url": "git@github.com:octocat/Hello-World.git",
"stargazers_url": "https://api.github.com/repos/octocat/Hello-World/stargazers",
"statuses_url": "https://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
"subscribers_url": "https://api.github.com/repos/octocat/Hello-World/subscribers",
"subscription_url": "https://api.github.com/repos/octocat/Hello-World/subscription",
"tags_url": "https://api.github.com/repos/octocat/Hello-World/tags",
"teams_url": "https://api.github.com/repos/octocat/Hello-World/teams",
"trees_url": "https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}",
"hooks_url": "http://api.github.com/repos/octocat/Hello-World/hooks"
},
"subject": {
"title": "Greetings",
"url": "https://api.github.com/repos/octokit/octokit.rb/issues/123",
"latest_comment_url": "https://api.github.com/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://api.github.com/notifications/threads/1",
"subscription_url": "https://api.github.com/notifications/threads/1/subscription"
}
Mark a thread as read
Parâmetros
Headers |
---|
Nome, Tipo, Descrição |
accept stringSetting to |
Path parameters |
Nome, Tipo, Descrição |
thread_id integerObrigatórioThe unique identifier of the pull request thread. |
HTTP response status codes
Status code | Descrição |
---|---|
205 | Reset Content |
304 | Not modified |
403 | Forbidden |
Amostras de código
curl \
-X PATCH \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token <TOKEN>" \
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.
Parâmetros
Headers |
---|
Nome, Tipo, Descrição |
accept stringSetting to |
Path parameters |
Nome, Tipo, Descrição |
thread_id integerObrigatórioThe unique identifier of the pull request thread. |
HTTP response status codes
Status code | Descrição |
---|---|
200 | OK |
304 | Not modified |
401 | Requires authentication |
403 | Forbidden |
Amostras de código
curl \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token <TOKEN>" \
http(s)://HOSTNAME/api/v3/notifications/threads/THREAD_ID/subscription
Response
Status: 200
{
"subscribed": true,
"ignored": false,
"reason": null,
"created_at": "2012-10-06T21:34:12Z",
"url": "https://api.github.com/notifications/threads/1/subscription",
"thread_url": "https://api.github.com/notifications/threads/1"
}
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.
Parâmetros
Headers |
---|
Nome, Tipo, Descrição |
accept stringSetting to |
Path parameters |
Nome, Tipo, Descrição |
thread_id integerObrigatórioThe unique identifier of the pull request thread. |
Body parameters |
Nome, Tipo, Descrição |
ignored booleanWhether to block all notifications from a thread. Padrão: |
HTTP response status codes
Status code | Descrição |
---|---|
200 | OK |
304 | Not modified |
401 | Requires authentication |
403 | Forbidden |
Amostras de código
curl \
-X PUT \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token <TOKEN>" \
http(s)://HOSTNAME/api/v3/notifications/threads/THREAD_ID/subscription \
-d '{"ignored":false}'
Response
Status: 200
{
"subscribed": true,
"ignored": false,
"reason": null,
"created_at": "2012-10-06T21:34:12Z",
"url": "https://api.github.com/notifications/threads/1/subscription",
"thread_url": "https://api.github.com/notifications/threads/1"
}
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
.
Parâmetros
Headers |
---|
Nome, Tipo, Descrição |
accept stringSetting to |
Path parameters |
Nome, Tipo, Descrição |
thread_id integerObrigatórioThe unique identifier of the pull request thread. |
HTTP response status codes
Status code | Descrição |
---|---|
204 | No Content |
304 | Not modified |
401 | Requires authentication |
403 | Forbidden |
Amostras de código
curl \
-X DELETE \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token <TOKEN>" \
http(s)://HOSTNAME/api/v3/notifications/threads/THREAD_ID/subscription
Response
Status: 204
List repository notifications for the authenticated user
List all notifications for the current user.
Parâmetros
Headers |
---|
Nome, Tipo, Descrição |
accept stringSetting to |
Path parameters |
Nome, Tipo, Descrição |
owner stringObrigatórioThe account owner of the repository. The name is not case sensitive. |
repo stringObrigatórioThe name of the repository. The name is not case sensitive. |
Parâmetros de consulta |
Nome, Tipo, Descrição |
all booleanIf Padrão: |
participating booleanIf Padrão: |
since stringOnly show notifications updated after the given time. This is a timestamp in ISO 8601 format: |
before stringOnly show notifications updated before the given time. This is a timestamp in ISO 8601 format: |
per_page integerThe number of results per page (max 100). Padrão: |
page integerPage number of the results to fetch. Padrão: |
HTTP response status codes
Status code | Descrição |
---|---|
200 | OK |
Amostras de código
curl \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token <TOKEN>" \
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://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
},
"private": false,
"html_url": "https://github.com/octocat/Hello-World",
"description": "This your first repo!",
"fork": false,
"url": "https://api.github.com/repos/octocat/Hello-World",
"archive_url": "https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
"assignees_url": "https://api.github.com/repos/octocat/Hello-World/assignees{/user}",
"blobs_url": "https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
"branches_url": "https://api.github.com/repos/octocat/Hello-World/branches{/branch}",
"collaborators_url": "https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
"comments_url": "https://api.github.com/repos/octocat/Hello-World/comments{/number}",
"commits_url": "https://api.github.com/repos/octocat/Hello-World/commits{/sha}",
"compare_url": "https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
"contents_url": "https://api.github.com/repos/octocat/Hello-World/contents/{+path}",
"contributors_url": "https://api.github.com/repos/octocat/Hello-World/contributors",
"deployments_url": "https://api.github.com/repos/octocat/Hello-World/deployments",
"downloads_url": "https://api.github.com/repos/octocat/Hello-World/downloads",
"events_url": "https://api.github.com/repos/octocat/Hello-World/events",
"forks_url": "https://api.github.com/repos/octocat/Hello-World/forks",
"git_commits_url": "https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
"git_refs_url": "https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
"git_tags_url": "https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
"git_url": "git:github.com/octocat/Hello-World.git",
"issue_comment_url": "https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
"issue_events_url": "https://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
"issues_url": "https://api.github.com/repos/octocat/Hello-World/issues{/number}",
"keys_url": "https://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
"labels_url": "https://api.github.com/repos/octocat/Hello-World/labels{/name}",
"languages_url": "https://api.github.com/repos/octocat/Hello-World/languages",
"merges_url": "https://api.github.com/repos/octocat/Hello-World/merges",
"milestones_url": "https://api.github.com/repos/octocat/Hello-World/milestones{/number}",
"notifications_url": "https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
"pulls_url": "https://api.github.com/repos/octocat/Hello-World/pulls{/number}",
"releases_url": "https://api.github.com/repos/octocat/Hello-World/releases{/id}",
"ssh_url": "git@github.com:octocat/Hello-World.git",
"stargazers_url": "https://api.github.com/repos/octocat/Hello-World/stargazers",
"statuses_url": "https://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
"subscribers_url": "https://api.github.com/repos/octocat/Hello-World/subscribers",
"subscription_url": "https://api.github.com/repos/octocat/Hello-World/subscription",
"tags_url": "https://api.github.com/repos/octocat/Hello-World/tags",
"teams_url": "https://api.github.com/repos/octocat/Hello-World/teams",
"trees_url": "https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}",
"hooks_url": "http://api.github.com/repos/octocat/Hello-World/hooks"
},
"subject": {
"title": "Greetings",
"url": "https://api.github.com/repos/octokit/octokit.rb/issues/123",
"latest_comment_url": "https://api.github.com/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://api.github.com/notifications/threads/1",
"subscription_url": "https://api.github.com/notifications/threads/1/subscription"
}
]
Mark repository notifications as read
Marks all notifications in a repository as "read" removes them from the default view on GitHub Enterprise Server. 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
.
Parâmetros
Headers |
---|
Nome, Tipo, Descrição |
accept stringSetting to |
Path parameters |
Nome, Tipo, Descrição |
owner stringObrigatórioThe account owner of the repository. The name is not case sensitive. |
repo stringObrigatórioThe name of the repository. The name is not case sensitive. |
Body parameters |
Nome, Tipo, Descrição |
last_read_at stringDescribes 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: |
HTTP response status codes
Status code | Descrição |
---|---|
202 | Accepted |
205 | Reset Content |
Amostras de código
curl \
-X PUT \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token <TOKEN>" \
http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/notifications
Response
Status: 202