Конечные точки REST API для событий
Используйте REST API для взаимодействия с событиями GitHub.
Сведения о событиях GitHub
События GitHub могут использовать различные потоки действий на сайте.
REST API можно использовать для возврата различных типов событий, инициируемых действием GitHub Enterprise Server. Дополнительные сведения о конкретных событиях, которые можно получить, см. в разделе "Типы событий GitHub". Кроме того, доступны конечные точки для проблем с репозиторием. Дополнительные сведения см. в разделе Конечные точки REST API для событий проблемы.
События оптимизированы для опроса с заголовком ETag. Если новые события не вызывались, вы увидите ответ "304 Не изменено", а текущее ограничение скорости останется без изменений. Существует также заголовок X-Poll-Interval — он показывает, с какой частотой (в секундах) вы можете проводить опросы. Во время высокой нагрузки на сервер время может увеличиться. Заголовку следует подчиняться.
$ curl -I http(s)://HOSTNAME/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)://HOSTNAME/api/v3/users/tater/events \
$ -H 'If-None-Match: "a18c3bded88eb5dbb5c849a489412bf3"'
> HTTP/2 304
> X-Poll-Interval: 60
На временных шкалах отображаются только события, созданные за последние 90 дней. События старше 90 дней не включаются (даже если общее количество событий на временной шкале меньшее 300).
List public 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.
Подробные маркеры доступа для "List public events
Эта конечная точка работает со следующими точными типами маркеров:
- Маркеры доступа пользователей приложения GitHub
- Маркеры доступа к установке приложений GitHub
- Точные личные маркеры доступа
Для тонкого маркера не требуются разрешения.
Параметры для "List public events"
Имя., Тип, Description |
---|
accept string Setting to |
Имя., Тип, Description |
---|
per_page integer The number of results per page (max 100). For more information, see "Using pagination in the REST API." По умолчанию.: |
page integer The page number of the results to fetch. For more information, see "Using pagination in the REST API." По умолчанию.: |
Коды состояния http-ответа для "List public events"
Код состояния | Описание |
---|---|
200 | OK |
304 | Not modified |
403 | Forbidden |
503 | Service unavailable |
Примеры кода для "List public events"
Пример запроса
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/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
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.
Подробные маркеры доступа для "List public events for a network of repositories
Эта конечная точка работает со следующими точными типами маркеров:
- Маркеры доступа пользователей приложения GitHub
- Маркеры доступа к установке приложений GitHub
- Точные личные маркеры доступа
Для тонкого маркера не требуются разрешения.
Параметры для "List public events for a network of repositories"
Имя., Тип, Description |
---|
accept string Setting to |
Имя., Тип, Description |
---|
owner string Обязательное полеThe account owner of the repository. The name is not case sensitive. |
repo string Обязательное полеThe name of the repository without the |
Имя., Тип, Description |
---|
per_page integer The number of results per page (max 100). For more information, see "Using pagination in the REST API." По умолчанию.: |
page integer The page number of the results to fetch. For more information, see "Using pagination in the REST API." По умолчанию.: |
Коды состояния http-ответа для "List public events for a network of repositories"
Код состояния | Описание |
---|---|
200 | OK |
301 | Moved permanently |
304 | Not modified |
403 | Forbidden |
404 | Resource not found |
Примеры кода для "List public events for a network of repositories"
Пример запроса
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/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
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.
Подробные маркеры доступа для "List public organization events
Эта конечная точка работает со следующими точными типами маркеров:
- Маркеры доступа пользователей приложения GitHub
- Маркеры доступа к установке приложений GitHub
- Точные личные маркеры доступа
Для тонкого маркера не требуются разрешения.
Параметры для "List public organization events"
Имя., Тип, Description |
---|
accept string Setting to |
Имя., Тип, Description |
---|
org string Обязательное полеThe organization name. The name is not case sensitive. |
Имя., Тип, Description |
---|
per_page integer The number of results per page (max 100). For more information, see "Using pagination in the REST API." По умолчанию.: |
page integer The page number of the results to fetch. For more information, see "Using pagination in the REST API." По умолчанию.: |
Коды состояния http-ответа для "List public organization events"
Код состояния | Описание |
---|---|
200 | OK |
Примеры кода для "List public organization events"
Пример запроса
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/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.
Подробные маркеры доступа для "List repository events
Эта конечная точка работает со следующими точными типами маркеров:
- Маркеры доступа пользователей приложения GitHub
- Маркеры доступа к установке приложений GitHub
- Точные личные маркеры доступа
Маркер с точной детализацией должен иметь следующий набор разрешений.:
- "Metadata" repository permissions (read)
Эту конечную точку можно использовать без проверки подлинности или указанных выше разрешений, если запрашиваются только общедоступные ресурсы.
Параметры для "List repository events"
Имя., Тип, Description |
---|
accept string Setting to |
Имя., Тип, Description |
---|
owner string Обязательное полеThe account owner of the repository. The name is not case sensitive. |
repo string Обязательное полеThe name of the repository without the |
Имя., Тип, Description |
---|
per_page integer The number of results per page (max 100). For more information, see "Using pagination in the REST API." По умолчанию.: |
page integer The page number of the results to fetch. For more information, see "Using pagination in the REST API." По умолчанию.: |
Коды состояния http-ответа для "List repository events"
Код состояния | Описание |
---|---|
200 | OK |
Примеры кода для "List repository events"
Пример запроса
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/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. Optional: use the fine-grained token with following permission set to view private events: "Events" user permissions (read).
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.
Подробные маркеры доступа для "List events for the authenticated user
Эта конечная точка работает со следующими точными типами маркеров:
- Маркеры доступа пользователей приложения GitHub
- Маркеры доступа к установке приложений GitHub
- Точные личные маркеры доступа
Для тонкого маркера не требуются разрешения.
Параметры для "List events for the authenticated user"
Имя., Тип, Description |
---|
accept string Setting to |
Имя., Тип, Description |
---|
username string Обязательное полеThe handle for the GitHub user account. |
Имя., Тип, Description |
---|
per_page integer The number of results per page (max 100). For more information, see "Using pagination in the REST API." По умолчанию.: |
page integer The page number of the results to fetch. For more information, see "Using pagination in the REST API." По умолчанию.: |
Коды состояния http-ответа для "List events for the authenticated user"
Код состояния | Описание |
---|---|
200 | OK |
Примеры кода для "List events for the authenticated user"
Пример запроса
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/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.
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.
Подробные маркеры доступа для "List organization events for the authenticated user
Эта конечная точка работает со следующими точными типами маркеров:
Маркер с точной детализацией должен иметь следующий набор разрешений.:
- "Events" organization permissions (read)
Параметры для "List organization events for the authenticated user"
Имя., Тип, Description |
---|
accept string Setting to |
Имя., Тип, Description |
---|
username string Обязательное полеThe handle for the GitHub user account. |
org string Обязательное полеThe organization name. The name is not case sensitive. |
Имя., Тип, Description |
---|
per_page integer The number of results per page (max 100). For more information, see "Using pagination in the REST API." По умолчанию.: |
page integer The page number of the results to fetch. For more information, see "Using pagination in the REST API." По умолчанию.: |
Коды состояния http-ответа для "List organization events for the authenticated user"
Код состояния | Описание |
---|---|
200 | OK |
Примеры кода для "List organization events for the authenticated user"
Пример запроса
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/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
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.
Подробные маркеры доступа для "List public events for a user
Эта конечная точка работает со следующими точными типами маркеров:
- Маркеры доступа пользователей приложения GitHub
- Маркеры доступа к установке приложений GitHub
- Точные личные маркеры доступа
Для тонкого маркера не требуются разрешения.
Параметры для "List public events for a user"
Имя., Тип, Description |
---|
accept string Setting to |
Имя., Тип, Description |
---|
username string Обязательное полеThe handle for the GitHub user account. |
Имя., Тип, Description |
---|
per_page integer The number of results per page (max 100). For more information, see "Using pagination in the REST API." По умолчанию.: |
page integer The page number of the results to fetch. For more information, see "Using pagination in the REST API." По умолчанию.: |
Коды состояния http-ответа для "List public events for a user"
Код состояния | Описание |
---|---|
200 | OK |
Примеры кода для "List public events for a user"
Пример запроса
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/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.
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.
Подробные маркеры доступа для "List events received by the authenticated user
Эта конечная точка работает со следующими точными типами маркеров:
- Маркеры доступа пользователей приложения GitHub
- Маркеры доступа к установке приложений GitHub
- Точные личные маркеры доступа
Для тонкого маркера не требуются разрешения.
Параметры для "List events received by the authenticated user"
Имя., Тип, Description |
---|
accept string Setting to |
Имя., Тип, Description |
---|
username string Обязательное полеThe handle for the GitHub user account. |
Имя., Тип, Description |
---|
per_page integer The number of results per page (max 100). For more information, see "Using pagination in the REST API." По умолчанию.: |
page integer The page number of the results to fetch. For more information, see "Using pagination in the REST API." По умолчанию.: |
Коды состояния http-ответа для "List events received by the authenticated user"
Код состояния | Описание |
---|---|
200 | OK |
Примеры кода для "List events received by the authenticated user"
Пример запроса
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/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
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.
Подробные маркеры доступа для "List public events received by a user
Эта конечная точка работает со следующими точными типами маркеров:
- Маркеры доступа пользователей приложения GitHub
- Маркеры доступа к установке приложений GitHub
- Точные личные маркеры доступа
Для тонкого маркера не требуются разрешения.
Параметры для "List public events received by a user"
Имя., Тип, Description |
---|
accept string Setting to |
Имя., Тип, Description |
---|
username string Обязательное полеThe handle for the GitHub user account. |
Имя., Тип, Description |
---|
per_page integer The number of results per page (max 100). For more information, see "Using pagination in the REST API." По умолчанию.: |
page integer The page number of the results to fetch. For more information, see "Using pagination in the REST API." По умолчанию.: |
Коды состояния http-ответа для "List public events received by a user"
Код состояния | Описание |
---|---|
200 | OK |
Примеры кода для "List public events received by a user"
Пример запроса
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/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?"
}
}
]