Skip to main content

Esta versão do GitHub Enterprise Server foi descontinuada em 2024-03-26. Nenhum lançamento de patch será feito, mesmo para questões críticas de segurança. Para obter melhor desempenho, segurança aprimorada e novos recursos, atualize para a última versão do GitHub Enterprise Server. Para obter ajuda com a atualização, entre em contato com o suporte do GitHub Enterprise.

Depois que um administrador do site fizer upgrade da sua instância do Enterprise Server para Enterprise Server 3.9 ou posterior, o controle de versão da API REST será feito. Para saber como encontrar a versão da sua instância, confira "Sobre as versões do GitHub Docs". Para obter mais informações, confira "Sobre o controle de versão da API".

Pontos de extremidade da API REST para eventos

Use a API REST para interagir com eventos do GitHub.

Sobre os eventos do GitHub

Os eventos do GitHub alimentam os vários fluxos de atividades no site.

Use API REST para retornar diferentes tipos de eventos acionados por atividade no GitHub Enterprise Server. Para obter mais informações sobre os eventos específicos que podem ser recebidos, confira "Tipos de eventos do GitHub". Pontos de extremidade para problemas de repositório também estão disponíveis. Para obter mais informações, confira "Pontos de extremidade da API REST para eventos de issues".

Os eventos são otimizados para sondagem a com o cabeçalho "ETag". Se nenhum novo evento for iniciado, você verá uma resposta "304 Not Modified" e seu limite de taxa atual não será alterado. Há também um cabeçalho "X-Poll-Interval" que especifica quantas vezes (em segundos) você pode fazer uma sondagem. Em tempos de alta carga do servidor, o tempo pode aumentar. Obedeça o cabeçalho.

$ curl -I http(s)://<em>HOSTNAME</em>/api/v3/users/tater/events
> HTTP/2 200
> X-Poll-Interval: 60
> ETag: "a18c3bded88eb5dbb5c849a489412bf3"

# The quotes around the ETag value are important
$ curl -I http(s)://<em>HOSTNAME</em>/api/v3/users/tater/events \
$    -H 'If-None-Match: "a18c3bded88eb5dbb5c849a489412bf3"'
> HTTP/2 304
> X-Poll-Interval: 60

Apenas eventos criados nos últimos 90 dias serão incluídos nas linhas de tempo. Eventos mais antigos que 90 dias não serão incluídos (mesmo que o número total de eventos na linha do tempo seja inferior a 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.

Parâmetros para "List public events"

Cabeçalhos
Nome, Tipo, Descrição
accept string

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

Parâmetros de consulta
Nome, Tipo, Descrição
per_page integer

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

Padrão: 30

page integer

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

Padrão: 1

Códigos de status de resposta HTTP para "List public events"

Código de statusDescrição
200

OK

304

Not modified

403

Forbidden

503

Service unavailable

Exemplos de código para "List public events"

Exemplo de solicitação

get/events
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/events

Response

Status: 200
[ { "id": "22249084947", "type": "WatchEvent", "actor": { "id": 583231, "login": "octocat", "display_login": "octocat", "gravatar_id": "", "url": "https://HOSTNAME/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octocat/Hello-World", "url": "https://HOSTNAME/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://HOSTNAME/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octocat/Hello-World", "url": "https://HOSTNAME/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://HOSTNAME/repos/octocat/Hello-World/commits/7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300" } ] }, "public": true, "created_at": "2022-06-07T07:50:26Z" } ]

List public events for a network of repositories

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

Cabeçalhos
Nome, Tipo, Descrição
accept string

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

Parâmetros de caminho
Nome, Tipo, Descrição
owner string Obrigatório

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

repo string Obrigatório

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

Parâmetros de consulta
Nome, Tipo, Descrição
per_page integer

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

Padrão: 30

page integer

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

Padrão: 1

Códigos de status de resposta HTTP para "List public events for a network of repositories"

Código de statusDescrição
200

OK

301

Moved permanently

304

Not modified

403

Forbidden

404

Resource not found

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

Exemplo de solicitação

get/networks/{owner}/{repo}/events
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/networks/OWNER/REPO/events

Response

Status: 200
[ { "id": "22249084964", "type": "PushEvent", "actor": { "id": 583231, "login": "octocat", "display_login": "octocat", "gravatar_id": "", "url": "https://HOSTNAME/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octocat/Hello-World", "url": "https://HOSTNAME/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://HOSTNAME/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://HOSTNAME/users/rrubenich", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octocat/Hello-World", "url": "https://HOSTNAME/repos/octocat/Hello-World" }, "payload": { "action": "started" }, "public": true, "created_at": "2022-06-08T23:29:25Z" } ]

List public organization events

Parâmetros para "List public organization events"

Cabeçalhos
Nome, Tipo, Descrição
accept string

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

Parâmetros de caminho
Nome, Tipo, Descrição
org string Obrigatório

The organization name. The name is not case sensitive.

Parâmetros de consulta
Nome, Tipo, Descrição
per_page integer

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

Padrão: 30

page integer

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

Padrão: 1

Códigos de status de resposta HTTP para "List public organization events"

Código de statusDescrição
200

OK

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

Exemplo de solicitação

get/orgs/{org}/events
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/orgs/ORG/events

Response

Status: 200
[ { "id": "22237752260", "type": "WatchEvent", "actor": { "id": 583231, "login": "octocat", "display_login": "octocat", "gravatar_id": "", "url": "https://HOSTNAME/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octo-org/octo-repo", "url": "https://HOSTNAME/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://HOSTNAME/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octo-org/octo-repo", "url": "https://HOSTNAME/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://HOSTNAME/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.

Parâmetros para "List repository events"

Cabeçalhos
Nome, Tipo, Descrição
accept string

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

Parâmetros de caminho
Nome, Tipo, Descrição
owner string Obrigatório

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

repo string Obrigatório

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

Parâmetros de consulta
Nome, Tipo, Descrição
per_page integer

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

Padrão: 30

page integer

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

Padrão: 1

Códigos de status de resposta HTTP para "List repository events"

Código de statusDescrição
200

OK

Exemplos de código para "List repository events"

Exemplo de solicitação

get/repos/{owner}/{repo}/events
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/events

Response

Status: 200
[ { "id": "22249084964", "type": "PushEvent", "actor": { "id": 583231, "login": "octocat", "display_login": "octocat", "gravatar_id": "", "url": "https://HOSTNAME/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octocat/Hello-World", "url": "https://HOSTNAME/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://HOSTNAME/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://HOSTNAME/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octocat/Hello-World", "url": "https://HOSTNAME/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.

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

Cabeçalhos
Nome, Tipo, Descrição
accept string

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

Parâmetros de caminho
Nome, Tipo, Descrição
username string Obrigatório

The handle for the GitHub user account.

Parâmetros de consulta
Nome, Tipo, Descrição
per_page integer

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

Padrão: 30

page integer

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

Padrão: 1

Códigos de status de resposta HTTP para "List events for the authenticated user"

Código de statusDescrição
200

OK

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

Exemplo de solicitação

get/users/{username}/events
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/users/USERNAME/events

Response

Status: 200
[ { "id": "22249084947", "type": "WatchEvent", "actor": { "id": 583231, "login": "octocat", "display_login": "octocat", "gravatar_id": "", "url": "https://HOSTNAME/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octocat/Hello-World", "url": "https://HOSTNAME/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://HOSTNAME/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octocat/Hello-World", "url": "https://HOSTNAME/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://HOSTNAME/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.

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

Cabeçalhos
Nome, Tipo, Descrição
accept string

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

Parâmetros de caminho
Nome, Tipo, Descrição
username string Obrigatório

The handle for the GitHub user account.

org string Obrigatório

The organization name. The name is not case sensitive.

Parâmetros de consulta
Nome, Tipo, Descrição
per_page integer

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

Padrão: 30

page integer

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

Padrão: 1

Códigos de status de resposta HTTP para "List organization events for the authenticated user"

Código de statusDescrição
200

OK

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

Exemplo de solicitação

get/users/{username}/events/orgs/{org}
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/users/USERNAME/events/orgs/ORG

Response

Status: 200
[ { "id": "22249084964", "type": "PushEvent", "actor": { "id": 583231, "login": "octocat", "display_login": "octocat", "gravatar_id": "", "url": "https://HOSTNAME/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octocat/Hello-World", "url": "https://HOSTNAME/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://HOSTNAME/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://HOSTNAME/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octocat/Hello-World", "url": "https://HOSTNAME/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://HOSTNAME/orgs/github", "avatar_url": "https://avatars.githubusercontent.com/u/9919?" } } ]

List public events for a user

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

Cabeçalhos
Nome, Tipo, Descrição
accept string

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

Parâmetros de caminho
Nome, Tipo, Descrição
username string Obrigatório

The handle for the GitHub user account.

Parâmetros de consulta
Nome, Tipo, Descrição
per_page integer

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

Padrão: 30

page integer

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

Padrão: 1

Códigos de status de resposta HTTP para "List public events for a user"

Código de statusDescrição
200

OK

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

Exemplo de solicitação

get/users/{username}/events/public
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/users/USERNAME/events/public

Response

Status: 200
[ { "id": "22249084947", "type": "WatchEvent", "actor": { "id": 583231, "login": "octocat", "display_login": "octocat", "gravatar_id": "", "url": "https://HOSTNAME/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octocat/Hello-World", "url": "https://HOSTNAME/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://HOSTNAME/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octocat/Hello-World", "url": "https://HOSTNAME/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://HOSTNAME/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.

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

Cabeçalhos
Nome, Tipo, Descrição
accept string

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

Parâmetros de caminho
Nome, Tipo, Descrição
username string Obrigatório

The handle for the GitHub user account.

Parâmetros de consulta
Nome, Tipo, Descrição
per_page integer

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

Padrão: 30

page integer

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

Padrão: 1

Códigos de status de resposta HTTP para "List events received by the authenticated user"

Código de statusDescrição
200

OK

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

Exemplo de solicitação

get/users/{username}/received_events
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/users/USERNAME/received_events

Response

Status: 200
[ { "id": "22249084964", "type": "PushEvent", "actor": { "id": 583231, "login": "octocat", "display_login": "octocat", "gravatar_id": "", "url": "https://HOSTNAME/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octocat/Hello-World", "url": "https://HOSTNAME/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://HOSTNAME/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://HOSTNAME/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octocat/Hello-World", "url": "https://HOSTNAME/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://HOSTNAME/orgs/github", "avatar_url": "https://avatars.githubusercontent.com/u/9919?" } } ]

List public events received by a user

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

Cabeçalhos
Nome, Tipo, Descrição
accept string

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

Parâmetros de caminho
Nome, Tipo, Descrição
username string Obrigatório

The handle for the GitHub user account.

Parâmetros de consulta
Nome, Tipo, Descrição
per_page integer

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

Padrão: 30

page integer

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

Padrão: 1

Códigos de status de resposta HTTP para "List public events received by a user"

Código de statusDescrição
200

OK

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

Exemplo de solicitação

get/users/{username}/received_events/public
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/users/USERNAME/received_events/public

Response

Status: 200
[ { "id": "22249084964", "type": "PushEvent", "actor": { "id": 583231, "login": "octocat", "display_login": "octocat", "gravatar_id": "", "url": "https://HOSTNAME/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octocat/Hello-World", "url": "https://HOSTNAME/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://HOSTNAME/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://HOSTNAME/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octocat/Hello-World", "url": "https://HOSTNAME/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://HOSTNAME/orgs/github", "avatar_url": "https://avatars.githubusercontent.com/u/9919?" } } ]