Skip to main content
Ahora la API de REST tiene control de versiones. Para obtener más información, consulta "Acerca del control de versiones de la API".

Puntos de conexión de la API de REST para eventos

Usa la API REST para interactuar con eventos de GitHub.

Acerca de los eventos de GitHub

Los eventos de GitHub potencian los distintos flujos de actividad en el sitio.

Puedes usar la API REST para devolver tipos diferentes de eventos que se desencadenan como consecuencia de la actividad en GitHub Enterprise Cloud. Para más información sobre los eventos específicos que puedes recibir, consulta "Tipos de evento de GitHub". Los puntos de conexión para las incidencias del repositorio también están disponibles. Para obtener más información, vea «Puntos de conexión de la API de REST para eventos de incidencias».

Los eventos se optimizan para el sondeo con el encabezado "ETag". Si no se han desencadenado eventos nuevos, verás la respuesta "304 Sin Modificar", y tu límite de tasa actual permanecerá intacto. También 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.

$ curl -I https://api.github.com/users/tater/events
> HTTP/2 200
> X-Poll-Interval: 60
> ETag: "a18c3bded88eb5dbb5c849a489412bf3"

# The quotes around the ETag value are important
$ curl -I https://api.github.com/users/tater/events \
$    -H 'If-None-Match: "a18c3bded88eb5dbb5c849a489412bf3"'
> HTTP/2 304
> X-Poll-Interval: 60

Solo los eventos creados en los últimos 90 días se incluirán en las líneas de tiempo. Los eventos de más de 90 días de antigüedad no se incluirán (aún si la cantidad total de eventos en la línea de tiempo es de 300).

List public events

We delay the public events feed by five minutes, which means the most recent event returned by the public events API actually occurred at least five minutes ago.

Tokens de acceso específicos para "List public events"

Este punto de conexión funciona con los siguientes tipos de token:

El token no requiere ningún permiso.

Parámetros para "List public events"

Encabezados
Nombre, Tipo, Descripción
accept string

Setting to application/vnd.github+json is recommended.

Parámetros de consulta
Nombre, Tipo, Descripción
per_page integer

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

Valor predeterminado: 30

page integer

The page number of the results to fetch. For more information, see "Using pagination in the REST API."

Valor predeterminado: 1

Códigos de estado de respuesta HTTP para "List public events"

status codeDescripción
200

OK

304

Not modified

403

Forbidden

503

Service unavailable

Ejemplos de código para "List public events"

Ejemplo de solicitud

get/events
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/events

Response

Status: 200
[ { "id": "22249084947", "type": "WatchEvent", "actor": { "id": 583231, "login": "octocat", "display_login": "octocat", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octocat/Hello-World", "url": "https://api.github.com/repos/octocat/Hello-World" }, "payload": { "action": "started" }, "public": true, "created_at": "2022-06-09T12:47:28Z" }, { "id": "22249084964", "type": "PushEvent", "actor": { "id": 583231, "login": "octocat", "display_login": "octocat", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octocat/Hello-World", "url": "https://api.github.com/repos/octocat/Hello-World" }, "payload": { "push_id": 10115855396, "size": 1, "distinct_size": 1, "ref": "refs/heads/master", "head": "7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300", "before": "883efe034920928c47fe18598c01249d1a9fdabd", "commits": [ { "sha": "7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300", "author": { "email": "octocat@github.com", "name": "Monalisa Octocat" }, "message": "commit", "distinct": true, "url": "https://api.github.com/repos/octocat/Hello-World/commits/7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300" } ] }, "public": true, "created_at": "2022-06-07T07:50:26Z" } ]

List public events for a network of repositories

Tokens de acceso específicos para "List public events for a network of repositories"

Este punto de conexión funciona con los siguientes tipos de token:

El token no requiere ningún permiso.

Parámetros para "List public events for a network of repositories"

Encabezados
Nombre, Tipo, Descripción
accept string

Setting to application/vnd.github+json is recommended.

Parámetros de la ruta de acceso
Nombre, Tipo, Descripción
owner string Requerido

The account owner of the repository. The name is not case sensitive.

repo string Requerido

The name of the repository without the .git extension. The name is not case sensitive.

Parámetros de consulta
Nombre, Tipo, Descripción
per_page integer

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

Valor predeterminado: 30

page integer

The page number of the results to fetch. For more information, see "Using pagination in the REST API."

Valor predeterminado: 1

Códigos de estado de respuesta HTTP para "List public events for a network of repositories"

status codeDescripción
200

OK

301

Moved permanently

304

Not modified

403

Forbidden

404

Resource not found

Ejemplos de código para "List public events for a network of repositories"

Ejemplo de solicitud

get/networks/{owner}/{repo}/events
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/networks/OWNER/REPO/events

Response

Status: 200
[ { "id": "22249084964", "type": "PushEvent", "actor": { "id": 583231, "login": "octocat", "display_login": "octocat", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octocat/Hello-World", "url": "https://api.github.com/repos/octocat/Hello-World" }, "payload": { "push_id": 10115855396, "size": 1, "distinct_size": 1, "ref": "refs/heads/master", "head": "7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300", "before": "883efe034920928c47fe18598c01249d1a9fdabd", "commits": [ { "sha": "7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300", "author": { "email": "octocat@github.com", "name": "Monalisa Octocat" }, "message": "commit", "distinct": true, "url": "https://api.github.com/repos/octocat/Hello-World/commits/7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300" } ] }, "public": true, "created_at": "2022-06-09T12:47:28Z" }, { "id": "22237752260", "type": "WatchEvent", "actor": { "id": 583231, "login": "octocat", "display_login": "octocat", "gravatar_id": "", "url": "https://api.github.com/users/rrubenich", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octocat/Hello-World", "url": "https://api.github.com/repos/octocat/Hello-World" }, "payload": { "action": "started" }, "public": true, "created_at": "2022-06-08T23:29:25Z" } ]

List public organization events

Tokens de acceso específicos para "List public organization events"

Este punto de conexión funciona con los siguientes tipos de token:

El token no requiere ningún permiso.

Parámetros para "List public organization events"

Encabezados
Nombre, Tipo, Descripción
accept string

Setting to application/vnd.github+json is recommended.

Parámetros de la ruta de acceso
Nombre, Tipo, Descripción
org string Requerido

The organization name. The name is not case sensitive.

Parámetros de consulta
Nombre, Tipo, Descripción
per_page integer

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

Valor predeterminado: 30

page integer

The page number of the results to fetch. For more information, see "Using pagination in the REST API."

Valor predeterminado: 1

Códigos de estado de respuesta HTTP para "List public organization events"

status codeDescripción
200

OK

Ejemplos de código para "List public organization events"

Ejemplo de solicitud

get/orgs/{org}/events
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/events

Response

Status: 200
[ { "id": "22237752260", "type": "WatchEvent", "actor": { "id": 583231, "login": "octocat", "display_login": "octocat", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octo-org/octo-repo", "url": "https://api.github.com/repos/octo-org/octo-repo" }, "payload": { "action": "started" }, "public": true, "created_at": "2022-06-08T23:29:25Z" }, { "id": "22249084964", "type": "PushEvent", "actor": { "id": 583231, "login": "octocat", "display_login": "octocat", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octo-org/octo-repo", "url": "https://api.github.com/repos/octo-org/oct-repo" }, "payload": { "push_id": 10115855396, "size": 1, "distinct_size": 1, "ref": "refs/heads/master", "head": "7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300", "before": "883efe034920928c47fe18598c01249d1a9fdabd", "commits": [ { "sha": "7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300", "author": { "email": "octocat@github.com", "name": "Monalisa Octocat" }, "message": "commit", "distinct": true, "url": "https://api.github.com/repos/octo-org/oct-repo/commits/7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300" } ] }, "public": true, "created_at": "2022-06-09T12:47:28Z" } ]

List repository events

Note: This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h.

Tokens de acceso específicos para "List repository events"

Este punto de conexión funciona con los siguientes tipos de token:

El token debe tener el siguiente conjunto de permisos.:

  • metadata:read

Este punto de conexión se puede usar sin autenticación o los permisos mencionados anteriormente si solo se solicitan recursos públicos.

Parámetros para "List repository events"

Encabezados
Nombre, Tipo, Descripción
accept string

Setting to application/vnd.github+json is recommended.

Parámetros de la ruta de acceso
Nombre, Tipo, Descripción
owner string Requerido

The account owner of the repository. The name is not case sensitive.

repo string Requerido

The name of the repository without the .git extension. The name is not case sensitive.

Parámetros de consulta
Nombre, Tipo, Descripción
per_page integer

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

Valor predeterminado: 30

page integer

The page number of the results to fetch. For more information, see "Using pagination in the REST API."

Valor predeterminado: 1

Códigos de estado de respuesta HTTP para "List repository events"

status codeDescripción
200

OK

Ejemplos de código para "List repository events"

Ejemplo de solicitud

get/repos/{owner}/{repo}/events
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/repos/OWNER/REPO/events

Response

Status: 200
[ { "id": "22249084964", "type": "PushEvent", "actor": { "id": 583231, "login": "octocat", "display_login": "octocat", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octocat/Hello-World", "url": "https://api.github.com/repos/octocat/Hello-World" }, "payload": { "push_id": 10115855396, "size": 1, "distinct_size": 1, "ref": "refs/heads/master", "head": "7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300", "before": "883efe034920928c47fe18598c01249d1a9fdabd", "commits": [ { "sha": "7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300", "author": { "email": "octocat@github.com", "name": "Monalisa Octocat" }, "message": "commit", "distinct": true, "url": "https://api.github.com/repos/octocat/Hello-World/commits/7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300" } ] }, "public": true, "created_at": "2022-06-09T12:47:28Z" }, { "id": "22237752260", "type": "WatchEvent", "actor": { "id": 583231, "login": "octocat", "display_login": "octocat", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octocat/Hello-World", "url": "https://api.github.com/repos/octocat/Hello-World" }, "payload": { "action": "started" }, "public": true, "created_at": "2022-06-08T23:29:25Z" } ]

List events for the authenticated user

If you are authenticated as the given user, you will see your private events. Otherwise, you'll only see public events.

Tokens de acceso específicos para "List events for the authenticated user"

Este punto de conexión funciona con los siguientes tipos de token:

El token no requiere ningún permiso.

Parámetros para "List events for the authenticated user"

Encabezados
Nombre, Tipo, Descripción
accept string

Setting to application/vnd.github+json is recommended.

Parámetros de la ruta de acceso
Nombre, Tipo, Descripción
username string Requerido

The handle for the GitHub user account.

Parámetros de consulta
Nombre, Tipo, Descripción
per_page integer

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

Valor predeterminado: 30

page integer

The page number of the results to fetch. For more information, see "Using pagination in the REST API."

Valor predeterminado: 1

Códigos de estado de respuesta HTTP para "List events for the authenticated user"

status codeDescripción
200

OK

Ejemplos de código para "List events for the authenticated user"

Ejemplo de solicitud

get/users/{username}/events
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/users/USERNAME/events

Response

Status: 200
[ { "id": "22249084947", "type": "WatchEvent", "actor": { "id": 583231, "login": "octocat", "display_login": "octocat", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octocat/Hello-World", "url": "https://api.github.com/repos/octocat/Hello-World" }, "payload": { "action": "started" }, "public": true, "created_at": "2022-06-09T12:47:28Z" }, { "id": "22249084964", "type": "PushEvent", "actor": { "id": 583231, "login": "octocat", "display_login": "octocat", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octocat/Hello-World", "url": "https://api.github.com/repos/octocat/Hello-World" }, "payload": { "push_id": 10115855396, "size": 1, "distinct_size": 1, "ref": "refs/heads/master", "head": "7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300", "before": "883efe034920928c47fe18598c01249d1a9fdabd", "commits": [ { "sha": "7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300", "author": { "email": "octocat@github.com", "name": "Monalisa Octocat" }, "message": "commit", "distinct": true, "url": "https://api.github.com/repos/octocat/Hello-World/commits/7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300" } ] }, "public": false, "created_at": "2022-06-07T07:50:26Z" } ]

List organization events for the authenticated user

This is the user's organization dashboard. You must be authenticated as the user to view this.

Tokens de acceso específicos para "List organization events for the authenticated user"

Este punto de conexión funciona con los siguientes tipos de token:

El token debe tener el siguiente conjunto de permisos.:

  • organization_events:read

Parámetros para "List organization events for the authenticated user"

Encabezados
Nombre, Tipo, Descripción
accept string

Setting to application/vnd.github+json is recommended.

Parámetros de la ruta de acceso
Nombre, Tipo, Descripción
username string Requerido

The handle for the GitHub user account.

org string Requerido

The organization name. The name is not case sensitive.

Parámetros de consulta
Nombre, Tipo, Descripción
per_page integer

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

Valor predeterminado: 30

page integer

The page number of the results to fetch. For more information, see "Using pagination in the REST API."

Valor predeterminado: 1

Códigos de estado de respuesta HTTP para "List organization events for the authenticated user"

status codeDescripción
200

OK

Ejemplos de código para "List organization events for the authenticated user"

Ejemplo de solicitud

get/users/{username}/events/orgs/{org}
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/users/USERNAME/events/orgs/ORG

Response

Status: 200
[ { "id": "22249084964", "type": "PushEvent", "actor": { "id": 583231, "login": "octocat", "display_login": "octocat", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octocat/Hello-World", "url": "https://api.github.com/repos/octocat/Hello-World" }, "payload": { "push_id": 10115855396, "size": 1, "distinct_size": 1, "ref": "refs/heads/master", "head": "7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300", "before": "883efe034920928c47fe18598c01249d1a9fdabd", "commits": [ { "sha": "7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300", "author": { "email": "octocat@github.com", "name": "Monalisa Octocat" }, "message": "commit", "distinct": true, "url": "https://api.github.com/repos/octocat/Hello-World/commits/7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300" } ] }, "public": false, "created_at": "2022-06-09T12:47:28Z" }, { "id": "22196946742", "type": "CreateEvent", "actor": { "id": 583231, "login": "octocat", "display_login": "octocat", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octocat/Hello-World", "url": "https://api.github.com/repos/octocat/Hello-World" }, "payload": { "ref": null, "ref_type": "repository", "master_branch": "master", "description": null, "pusher_type": "user" }, "public": false, "created_at": "2022-06-07T07:50:26Z", "org": { "id": 9919, "login": "github", "gravatar_id": "", "url": "https://api.github.com/orgs/github", "avatar_url": "https://avatars.githubusercontent.com/u/9919?" } } ]

List public events for a user

Tokens de acceso específicos para "List public events for a user"

Este punto de conexión funciona con los siguientes tipos de token:

El token no requiere ningún permiso.

Parámetros para "List public events for a user"

Encabezados
Nombre, Tipo, Descripción
accept string

Setting to application/vnd.github+json is recommended.

Parámetros de la ruta de acceso
Nombre, Tipo, Descripción
username string Requerido

The handle for the GitHub user account.

Parámetros de consulta
Nombre, Tipo, Descripción
per_page integer

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

Valor predeterminado: 30

page integer

The page number of the results to fetch. For more information, see "Using pagination in the REST API."

Valor predeterminado: 1

Códigos de estado de respuesta HTTP para "List public events for a user"

status codeDescripción
200

OK

Ejemplos de código para "List public events for a user"

Ejemplo de solicitud

get/users/{username}/events/public
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/users/USERNAME/events/public

Response

Status: 200
[ { "id": "22249084947", "type": "WatchEvent", "actor": { "id": 583231, "login": "octocat", "display_login": "octocat", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octocat/Hello-World", "url": "https://api.github.com/repos/octocat/Hello-World" }, "payload": { "action": "started" }, "public": true, "created_at": "2022-06-09T12:47:28Z" }, { "id": "22249084964", "type": "PushEvent", "actor": { "id": 583231, "login": "octocat", "display_login": "octocat", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octocat/Hello-World", "url": "https://api.github.com/repos/octocat/Hello-World" }, "payload": { "push_id": 10115855396, "size": 1, "distinct_size": 1, "ref": "refs/heads/master", "head": "7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300", "before": "883efe034920928c47fe18598c01249d1a9fdabd", "commits": [ { "sha": "7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300", "author": { "email": "octocat@github.com", "name": "Monalisa Octocat" }, "message": "commit", "distinct": true, "url": "https://api.github.com/repos/octocat/Hello-World/commits/7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300" } ] }, "public": true, "created_at": "2022-06-08T23:29:25Z" } ]

List events received by the authenticated user

These are events that you've received by watching repositories and following users. If you are authenticated as the given user, you will see private events. Otherwise, you'll only see public events.

Tokens de acceso específicos para "List events received by the authenticated user"

Este punto de conexión funciona con los siguientes tipos de token:

El token no requiere ningún permiso.

Parámetros para "List events received by the authenticated user"

Encabezados
Nombre, Tipo, Descripción
accept string

Setting to application/vnd.github+json is recommended.

Parámetros de la ruta de acceso
Nombre, Tipo, Descripción
username string Requerido

The handle for the GitHub user account.

Parámetros de consulta
Nombre, Tipo, Descripción
per_page integer

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

Valor predeterminado: 30

page integer

The page number of the results to fetch. For more information, see "Using pagination in the REST API."

Valor predeterminado: 1

Códigos de estado de respuesta HTTP para "List events received by the authenticated user"

status codeDescripción
200

OK

Ejemplos de código para "List events received by the authenticated user"

Ejemplo de solicitud

get/users/{username}/received_events
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/users/USERNAME/received_events

Response

Status: 200
[ { "id": "22249084964", "type": "PushEvent", "actor": { "id": 583231, "login": "octocat", "display_login": "octocat", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octocat/Hello-World", "url": "https://api.github.com/repos/octocat/Hello-World" }, "payload": { "push_id": 10115855396, "size": 1, "distinct_size": 1, "ref": "refs/heads/master", "head": "7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300", "before": "883efe034920928c47fe18598c01249d1a9fdabd", "commits": [ { "sha": "7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300", "author": { "email": "octocat@github.com", "name": "Monalisa Octocat" }, "message": "commit", "distinct": true, "url": "https://api.github.com/repos/octocat/Hello-World/commits/7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300" } ] }, "public": true, "created_at": "2022-06-09T12:47:28Z" }, { "id": "22196946742", "type": "CreateEvent", "actor": { "id": 583231, "login": "octocat", "display_login": "octocat", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octocat/Hello-World", "url": "https://api.github.com/repos/octocat/Hello-World" }, "payload": { "ref": null, "ref_type": "repository", "master_branch": "master", "description": null, "pusher_type": "user" }, "public": false, "created_at": "2022-06-07T07:50:26Z", "org": { "id": 9919, "login": "github", "gravatar_id": "", "url": "https://api.github.com/orgs/github", "avatar_url": "https://avatars.githubusercontent.com/u/9919?" } } ]

List public events received by a user

Tokens de acceso específicos para "List public events received by a user"

Este punto de conexión funciona con los siguientes tipos de token:

El token no requiere ningún permiso.

Parámetros para "List public events received by a user"

Encabezados
Nombre, Tipo, Descripción
accept string

Setting to application/vnd.github+json is recommended.

Parámetros de la ruta de acceso
Nombre, Tipo, Descripción
username string Requerido

The handle for the GitHub user account.

Parámetros de consulta
Nombre, Tipo, Descripción
per_page integer

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

Valor predeterminado: 30

page integer

The page number of the results to fetch. For more information, see "Using pagination in the REST API."

Valor predeterminado: 1

Códigos de estado de respuesta HTTP para "List public events received by a user"

status codeDescripción
200

OK

Ejemplos de código para "List public events received by a user"

Ejemplo de solicitud

get/users/{username}/received_events/public
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/users/USERNAME/received_events/public

Response

Status: 200
[ { "id": "22249084964", "type": "PushEvent", "actor": { "id": 583231, "login": "octocat", "display_login": "octocat", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octocat/Hello-World", "url": "https://api.github.com/repos/octocat/Hello-World" }, "payload": { "push_id": 10115855396, "size": 1, "distinct_size": 1, "ref": "refs/heads/master", "head": "7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300", "before": "883efe034920928c47fe18598c01249d1a9fdabd", "commits": [ { "sha": "7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300", "author": { "email": "octocat@github.com", "name": "Monalisa Octocat" }, "message": "commit", "distinct": true, "url": "https://api.github.com/repos/octocat/Hello-World/commits/7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300" } ] }, "public": true, "created_at": "2022-06-09T12:47:28Z" }, { "id": "22196946742", "type": "CreateEvent", "actor": { "id": 583231, "login": "octocat", "display_login": "octocat", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octocat/Hello-World", "url": "https://api.github.com/repos/octocat/Hello-World" }, "payload": { "ref": null, "ref_type": "repository", "master_branch": "master", "description": null, "pusher_type": "user" }, "public": false, "created_at": "2022-06-07T07:50:26Z", "org": { "id": 9919, "login": "github", "gravatar_id": "", "url": "https://api.github.com/orgs/github", "avatar_url": "https://avatars.githubusercontent.com/u/9919?" } } ]