Skip to main content
설명서에 자주 업데이트를 게시하며 이 페이지의 번역이 계속 진행 중일 수 있습니다. 최신 정보는 영어 설명서를 참조하세요.

이 버전의 GitHub Enterprise는 다음 날짜에 중단됩니다. 2023-03-15. 중요한 보안 문제에 대해서도 패치 릴리스가 이루어지지 않습니다. 성능 향상, 향상된 보안, 새로운 기능을 위해 최신 버전의 GitHub Enterprise로 업그레이드합니다. 업그레이드에 대한 도움말은 GitHub Enterprise 지원에 문의하세요.

We've recently moved some of the REST API documentation. If you can't find what you're looking for, you might try the new Branches, Collaborators, Commits, Deploy Keys, Deployments, GitHub Pages, Releases, Metrics, Webhooks REST API pages.

리포지토리 웹후크 구성

REST API를 사용하여 리포지토리 웹후크에 대한 구성을 관리합니다.

Get a webhook configuration for a repository

에서 작동 GitHub Apps

Returns the webhook configuration for a repository. To get more information about the webhook, including the active state and events, use "Get a repository webhook."

Access tokens must have the read:repo_hook or repo scope, and GitHub Apps must have the repository_hooks:read permission.

매개 변수

헤더
이름, 형식, 설명
acceptstring

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

경로 매개 변수
이름, 형식, 설명
ownerstring필수

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

repostring필수

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

hook_idinteger필수

The unique identifier of the hook.

HTTP 응답 상태 코드

상태 코드Description
200

OK

코드 샘플

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

Response

Status: 200
{ "content_type": "json", "insecure_ssl": "0", "secret": "********", "url": "https://example.com/webhook" }

Update a webhook configuration for a repository

에서 작동 GitHub Apps

Updates the webhook configuration for a repository. To update more information about the webhook, including the active state and events, use "Update a repository webhook."

Access tokens must have the write:repo_hook or repo scope, and GitHub Apps must have the repository_hooks:write permission.

매개 변수

헤더
이름, 형식, 설명
acceptstring

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

경로 매개 변수
이름, 형식, 설명
ownerstring필수

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

repostring필수

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

hook_idinteger필수

The unique identifier of the hook.

본문 매개 변수
이름, 형식, 설명
urlstring

The URL to which the payloads will be delivered.

content_typestring

The media type used to serialize the payloads. Supported values include json and form. The default is form.

secretstring

If provided, the secret will be used as the key to generate the HMAC hex digest value for delivery signature headers.

insecure_sslstring or number

Determines whether the SSL certificate of the host for url will be verified when delivering payloads. Supported values include 0 (verification is performed) and 1 (verification is not performed). The default is 0. We strongly recommend not setting this to 1 as you are subject to man-in-the-middle and other attacks.

HTTP 응답 상태 코드

상태 코드Description
200

OK

코드 샘플

patch/repos/{owner}/{repo}/hooks/{hook_id}/config
curl \ -X PATCH \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/hooks/HOOK_ID/config \ -d '{"content_type":"json","url":"https://example.com/webhook"}'

Response

Status: 200
{ "content_type": "json", "insecure_ssl": "0", "secret": "********", "url": "https://example.com/webhook" }