Esta versión de GitHub Enterprise se discontinuó el 2022-06-03. No se realizarán lanzamientos de patch, ni siquiera para problemas de seguridad críticos. Para obtener un mejor desempeño, más seguridad y nuevas características, actualiza a la última versión de GitHub Enterprise. Para obtener ayuda con la actualización, contacta al soporte de GitHub Enterprise.
Notificaciones
The Notifications API lets you manage GitHub Enterprise Server notifications.
About the Notifications API
La API de notificaciones te permite administrar las notificaciones de GitHub Enterprise Server. For more information about notifications, see "About notifications."
Todas las llamadas de la API para notificaciones necesitan los alcances de la API para notifications
o repo
. El hacerlo te dará acceso de solo lectura a algunos contenidos de informes de problemas y de confirmaciones. Aún necesitarás el alcance de repo
para acceder a los informes de problemas y a las confirmaciones desde sus respectivas terminales.
Las notificaciones se devuelven como "hilos". Un hilo contiene información acerca del debate actual sobre un informe de problemas, solicitud de extracción o confirmación.
Las notificaciones se optimizan para el sondeo con el encabezado Last-Modified
. Si no hay notificaciones nuevas, verás una respuesta 304 Not Modified
, la cual dejará tu límite de tasa intacto. Hay un encabezado de X-Poll-Interval
que especifica la frecuencia (en segundos) en la que se te permite hacer sondeos. Este tiempo podría incrementarse durante los periodos de carga fuerte en el servidor. Por favor obedece al encabezado.
# 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
About notification reasons
Cuando recuperas respuestas de la API de Notificaciones, cada carga útil tiene una clave que se titula reason
. Estas corresponden a los eventos que activan una notificación.
These are the potential reason
s for receiving a notification:
Nombre de la razón | Descripción |
---|---|
assign | Se te asignó al informe de problemas. |
autor | Creaste el hilo. |
comentario | Comentaste en el hilo. |
ci_activity | Se completó una ejecución de flujo de trabajo de GitHub Actions. |
invitación | Aceptaste una invitación para colaborar en el repositorio. |
manual | Te suscribiste al hilo (a través de un informe de problemas o solicitud de extracción). |
mención | Se te @mencionó específicamente en el contenido. |
review_requested | Se te solicitó, o se solicitó a un equipo del cual eres miembro, revisar una solicitud de extracción. |
state_change | Cambiaste el estado del hilo (por ejemplo, cerraste un informe de problemas o fusionaste una solicitud de extracción). |
subscribed | Estás observando el repositorio. |
team_mention | Estuviste en un equipo al que se mencionó. |
Toma en cuenta que la reason
se modificará conforme al hilo, y puede cambiar si esta reason
es diferente en una notificación posterior.
Por ejemplo, si eres el autor de un informe de problemas, las notificaciones subsecuentes de dicho informe tendrán una reason
o un author
. Si entonces se te @menciona en el mismo informe de problemas, las notificaciones que obtengas de ahí en adelante tendrán una reason
o una mention
. La reason
se queda como una mention
, sin importar si nunca se te menciona.
List notifications for the authenticated user
List all notifications for the current user, sorted by most recently updated.
Parámetros
Encabezados |
---|
Nombre, Tipo, Descripción |
accept stringSetting to |
Parámetros de consulta |
Nombre, Tipo, Descripción |
all booleanIf Predeterminado: |
participating booleanIf Predeterminado: |
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). Predeterminado: |
page integerPage number of the results to fetch. Predeterminado: |
Códigos de estado de respuesta HTTP
Código de estado | Descripción |
---|---|
200 | OK |
304 | Not modified |
401 | Requires authentication |
403 | Forbidden |
422 | Validation failed |
Ejemplos 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
Encabezados |
---|
Nombre, Tipo, Descripción |
accept stringSetting to |
Parámetros de cuerpo |
Nombre, Tipo, Descripción |
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. |
Códigos de estado de respuesta HTTP
Código de estado | Descripción |
---|---|
202 | Accepted |
205 | Reset Content |
304 | Not modified |
401 | Requires authentication |
403 | Forbidden |
Ejemplos 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
Encabezados |
---|
Nombre, Tipo, Descripción |
accept stringSetting to |
Parámetros de ruta |
Nombre, Tipo, Descripción |
thread_id integerRequeridoThe unique identifier of the pull request thread. |
Códigos de estado de respuesta HTTP
Código de estado | Descripción |
---|---|
200 | OK |
304 | Not modified |
401 | Requires authentication |
403 | Forbidden |
Ejemplos 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
Encabezados |
---|
Nombre, Tipo, Descripción |
accept stringSetting to |
Parámetros de ruta |
Nombre, Tipo, Descripción |
thread_id integerRequeridoThe unique identifier of the pull request thread. |
Códigos de estado de respuesta HTTP
Código de estado | Descripción |
---|---|
205 | Reset Content |
304 | Not modified |
403 | Forbidden |
Ejemplos 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
Encabezados |
---|
Nombre, Tipo, Descripción |
accept stringSetting to |
Parámetros de ruta |
Nombre, Tipo, Descripción |
thread_id integerRequeridoThe unique identifier of the pull request thread. |
Códigos de estado de respuesta HTTP
Código de estado | Descripción |
---|---|
200 | OK |
304 | Not modified |
401 | Requires authentication |
403 | Forbidden |
Ejemplos 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
Encabezados |
---|
Nombre, Tipo, Descripción |
accept stringSetting to |
Parámetros de ruta |
Nombre, Tipo, Descripción |
thread_id integerRequeridoThe unique identifier of the pull request thread. |
Parámetros de cuerpo |
Nombre, Tipo, Descripción |
ignored booleanWhether to block all notifications from a thread. Predeterminado: |
Códigos de estado de respuesta HTTP
Código de estado | Descripción |
---|---|
200 | OK |
304 | Not modified |
401 | Requires authentication |
403 | Forbidden |
Ejemplos 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
Encabezados |
---|
Nombre, Tipo, Descripción |
accept stringSetting to |
Parámetros de ruta |
Nombre, Tipo, Descripción |
thread_id integerRequeridoThe unique identifier of the pull request thread. |
Códigos de estado de respuesta HTTP
Código de estado | Descripción |
---|---|
204 | No Content |
304 | Not modified |
401 | Requires authentication |
403 | Forbidden |
Ejemplos 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
Encabezados |
---|
Nombre, Tipo, Descripción |
accept stringSetting to |
Parámetros de ruta |
Nombre, Tipo, Descripción |
owner stringRequeridoThe account owner of the repository. The name is not case sensitive. |
repo stringRequeridoThe name of the repository. The name is not case sensitive. |
Parámetros de consulta |
Nombre, Tipo, Descripción |
all booleanIf Predeterminado: |
participating booleanIf Predeterminado: |
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). Predeterminado: |
page integerPage number of the results to fetch. Predeterminado: |
Códigos de estado de respuesta HTTP
Código de estado | Descripción |
---|---|
200 | OK |
Ejemplos 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
Encabezados |
---|
Nombre, Tipo, Descripción |
accept stringSetting to |
Parámetros de ruta |
Nombre, Tipo, Descripción |
owner stringRequeridoThe account owner of the repository. The name is not case sensitive. |
repo stringRequeridoThe name of the repository. The name is not case sensitive. |
Parámetros de cuerpo |
Nombre, Tipo, Descripción |
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: |
Códigos de estado de respuesta HTTP
Código de estado | Descripción |
---|---|
202 | Accepted |
205 | Reset Content |
Ejemplos 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