Skip to main content
Мы публикуем частые обновления нашей документации, и перевод этой страницы может все еще выполняться. Актуальные сведения см. в документации на английском языке.
В настоящее время GitHub AE находится в ограниченном выпуске.

Недавно мы перенесли некоторые из документации по REST API. Если вам не удается найти нужный объект, попробуйте использовать новые страницы REST API Branches, Collaborators, Commits, Deploy Keys, Deployments, GitHub Pages, Releases, Metrics, Webhooks.

Доставка веб-перехватчика репозитория

Используйте REST API для взаимодействия с доставкой веб-перехватчиков репозитория.

List deliveries for a repository webhook

Работа с GitHub Apps

Returns a list of webhook deliveries for a webhook configured in a repository.

Параметры для "List deliveries for a repository webhook"

Заголовки
Имя, Тип, Описание
accept string

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

Параметры пути
Имя, Тип, Описание
owner string Обязательно

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

repo string Обязательно

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

hook_id integer Обязательно

The unique identifier of the hook.

Параметры запроса
Имя, Тип, Описание
per_page integer

The number of results per page (max 100).

Значение по умолчанию: 30

cursor string

Used for pagination: the starting delivery from which the page of deliveries is fetched. Refer to the link header for the next and previous page cursors.

redelivery boolean

Коды состояния HTTP-ответа для "List deliveries for a repository webhook"

Код состоянияОписание
200

OK

400

Bad Request

422

Validation failed, or the endpoint has been spammed.

Примеры кода для "List deliveries for a repository webhook"

get/repos/{owner}/{repo}/hooks/{hook_id}/deliveries
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ https://HOSTNAME/api/v3/repos/OWNER/REPO/hooks/HOOK_ID/deliveries

Response

Status: 200
[ { "id": 12345678, "guid": "0b989ba4-242f-11e5-81e1-c7b6966d2516", "delivered_at": "2019-06-03T00:57:16Z", "redelivery": false, "duration": 0.27, "status": "OK", "status_code": 200, "event": "issues", "action": "opened", "installation_id": 123, "repository_id": 456 }, { "id": 123456789, "guid": "0b989ba4-242f-11e5-81e1-c7b6966d2516", "delivered_at": "2019-06-04T00:57:16Z", "redelivery": true, "duration": 0.28, "status": "OK", "status_code": 200, "event": "issues", "action": "opened", "installation_id": 123, "repository_id": 456 } ]

Get a delivery for a repository webhook

Работа с GitHub Apps

Returns a delivery for a webhook configured in a repository.

Параметры для "Get a delivery for a repository webhook"

Заголовки
Имя, Тип, Описание
accept string

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

Параметры пути
Имя, Тип, Описание
owner string Обязательно

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

repo string Обязательно

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

hook_id integer Обязательно

The unique identifier of the hook.

delivery_id integer Обязательно

Коды состояния HTTP-ответа для "Get a delivery for a repository webhook"

Код состоянияОписание
200

OK

400

Bad Request

422

Validation failed, or the endpoint has been spammed.

Примеры кода для "Get a delivery for a repository webhook"

get/repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ https://HOSTNAME/api/v3/repos/OWNER/REPO/hooks/HOOK_ID/deliveries/DELIVERY_ID

Response

Status: 200
{ "id": 12345678, "guid": "0b989ba4-242f-11e5-81e1-c7b6966d2516", "delivered_at": "2019-06-03T00:57:16Z", "redelivery": false, "duration": 0.27, "status": "OK", "status_code": 200, "event": "issues", "action": "opened", "installation_id": 123, "repository_id": 456, "url": "https://www.example.com", "request": { "headers": { "X-GitHub-Delivery": "0b989ba4-242f-11e5-81e1-c7b6966d2516", "X-Hub-Signature-256": "sha256=6dcb09b5b57875f334f61aebed695e2e4193db5e", "Accept": "*/*", "X-GitHub-Hook-ID": "42", "User-Agent": "GitHub-Hookshot/b8c71d8", "X-GitHub-Event": "issues", "X-GitHub-Hook-Installation-Target-ID": "123", "X-GitHub-Hook-Installation-Target-Type": "repository", "content-type": "application/json" }, "payload": { "action": "opened", "issue": { "body": "foo" }, "repository": { "id": 123 } } }, "response": { "headers": { "Content-Type": "text/html;charset=utf-8" }, "payload": "ok" } }

Redeliver a delivery for a repository webhook

Работа с GitHub Apps

Redeliver a webhook delivery for a webhook configured in a repository.

Параметры для "Redeliver a delivery for a repository webhook"

Заголовки
Имя, Тип, Описание
accept string

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

Параметры пути
Имя, Тип, Описание
owner string Обязательно

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

repo string Обязательно

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

hook_id integer Обязательно

The unique identifier of the hook.

delivery_id integer Обязательно

Коды состояния HTTP-ответа для "Redeliver a delivery for a repository webhook"

Код состоянияОписание
202

Accepted

400

Bad Request

422

Validation failed, or the endpoint has been spammed.

Примеры кода для "Redeliver a delivery for a repository webhook"

post/repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts
curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ https://HOSTNAME/api/v3/repos/OWNER/REPO/hooks/HOOK_ID/deliveries/DELIVERY_ID/attempts

Accepted