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

최근에 REST API 설명서 중 일부를 이동했습니다. 원하는 항목을 찾을 수 없는 경우 동작 REST API 페이지를 사용해 볼 수 있습니다.

전역 webhook

REST API를 사용하여 엔터프라이즈의 글로벌 웹후크를 관리합니다.

전역 웹후크 정보

이러한 엔드포인트는 인증된 사이트 관리자에게만 사용할 수 있습니다. 일반 사용자는 응답을 받게 됩니다 404 . 전역 웹후크를 구성하는 방법을 알아보려면 전역 웹후크 정보를 참조하세요.

전역 웹후크는 엔터프라이즈에 자동으로 설치됩니다. 전역 웹후크를 사용하여 엔터프라이즈의 사용자, 조직, 팀 및 리포지토리에 대한 규칙을 자동으로 모니터링하거나 적용하고 대응할 수 있습니다.

전역 웹후크는 조직, 사용자, 리포지토리, , 구성원, 멤버 자격, 포크ping 이벤트 유형을 구독할 수 있습니다.

List global webhooks

"List global webhooks"에 대한 매개 변수

헤더
속성, 형식, Description
accept string

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

쿼리 매개 변수
속성, 형식, Description
per_page integer

The number of results per page (max 100).

기본값: 30

page integer

Page number of the results to fetch.

기본값: 1

"List global webhooks"에 대한 HTTP 응답 상태 코드

상태 코드Description
200

OK

"List global webhooks"에 대한 코드 샘플

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

Response

Status: 200
[ { "type": "Global", "id": 1, "name": "web", "active": true, "events": [ "organization", "user" ], "config": { "url": "https://example.com", "content_type": "json", "insecure_ssl": "0", "secret": "********" }, "updated_at": "2017-12-07T00:14:59Z", "created_at": "2017-12-07T00:14:59Z", "url": "https://HOSTNAME/admin/hooks/1", "ping_url": "https://HOSTNAME/admin/hooks/1/pings" } ]

Create a global webhook

"Create a global webhook"에 대한 매개 변수

헤더
속성, 형식, Description
accept string

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

본문 매개 변수
속성, 형식, Description
name string 필수

Must be passed as "web".

config object 필수

Key/value pairs to provide settings for this webhook.

속성, 형식, Description
url string 필수

The URL to which the payloads will be delivered.

content_type string

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

secret string

If provided, the secret will be used as the key to generate the HMAC hex digest value in the X-Hub-Signature header.

insecure_ssl string

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.

events array of strings

The events that trigger this webhook. A global webhook can be triggered by user and organization events. Default: user and organization.

active boolean

Determines if notifications are sent when the webhook is triggered. Set to true to send notifications.

기본값: true

"Create a global webhook"에 대한 HTTP 응답 상태 코드

상태 코드Description
201

Created

"Create a global webhook"에 대한 코드 샘플

post/admin/hooks
curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/admin/hooks \ -d '{"name":"web","events":["organization","user"],"config":{"url":"https://example.com/webhook","content_type":"json","secret":"secret"}}'

Response

Status: 201
{ "type": "Global", "id": 1, "name": "web", "active": true, "events": [ "organization", "user" ], "config": { "url": "https://example.com", "content_type": "json", "insecure_ssl": "0", "secret": "********" }, "updated_at": "2017-12-07T00:14:59Z", "created_at": "2017-12-07T00:14:59Z", "url": "https://HOSTNAME/admin/hooks/1", "ping_url": "https://HOSTNAME/admin/hooks/1/pings" }

Get a global webhook

"Get a global webhook"에 대한 매개 변수

헤더
속성, 형식, Description
accept string

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

경로 매개 변수
속성, 형식, Description
hook_id integer 필수

The unique identifier of the hook.

"Get a global webhook"에 대한 HTTP 응답 상태 코드

상태 코드Description
200

OK

"Get a global webhook"에 대한 코드 샘플

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

Response

Status: 200
{ "type": "Global", "id": 1, "name": "web", "active": true, "events": [ "organization", "user" ], "config": { "url": "https://example.com", "content_type": "json", "insecure_ssl": "0", "secret": "********" }, "updated_at": "2017-12-07T00:14:59Z", "created_at": "2017-12-07T00:14:59Z", "url": "https://HOSTNAME/admin/hooks/1", "ping_url": "https://HOSTNAME/admin/hooks/1/pings" }

Update a global webhook

Parameters that are not provided will be overwritten with the default value or removed if no default exists.

"Update a global webhook"에 대한 매개 변수

헤더
속성, 형식, Description
accept string

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

경로 매개 변수
속성, 형식, Description
hook_id integer 필수

The unique identifier of the hook.

본문 매개 변수
속성, 형식, Description
config object

Key/value pairs to provide settings for this webhook.

속성, 형식, Description
url string 필수

The URL to which the payloads will be delivered.

content_type string

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

secret string

If provided, the secret will be used as the key to generate the HMAC hex digest value in the X-Hub-Signature header.

insecure_ssl string

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.

events array of strings

The events that trigger this webhook. A global webhook can be triggered by user and organization events. Default: user and organization.

active boolean

Determines if notifications are sent when the webhook is triggered. Set to true to send notifications.

기본값: true

"Update a global webhook"에 대한 HTTP 응답 상태 코드

상태 코드Description
200

OK

"Update a global webhook"에 대한 코드 샘플

patch/admin/hooks/{hook_id}
curl -L \ -X PATCH \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/admin/hooks/HOOK_ID \ -d '{"events":["organization"],"config":{"url":"https://example.com/webhook"}}'

Response

Status: 200
{ "type": "Global", "id": 1, "name": "web", "active": true, "events": [ "organization" ], "config": { "url": "https://example.com", "content_type": "form", "insecure_ssl": "0" }, "updated_at": "2017-12-07T00:14:59Z", "created_at": "2017-12-07T00:14:59Z", "url": "https://HOSTNAME/admin/hooks/1", "ping_url": "https://HOSTNAME/admin/hooks/1/pings" }

Delete a global webhook

"Delete a global webhook"에 대한 매개 변수

헤더
속성, 형식, Description
accept string

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

경로 매개 변수
속성, 형식, Description
hook_id integer 필수

The unique identifier of the hook.

"Delete a global webhook"에 대한 HTTP 응답 상태 코드

상태 코드Description
204

No Content

"Delete a global webhook"에 대한 코드 샘플

delete/admin/hooks/{hook_id}
curl -L \ -X DELETE \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/admin/hooks/HOOK_ID

Response

Status: 204

Ping a global webhook

This will trigger a ping event to be sent to the webhook.

"Ping a global webhook"에 대한 매개 변수

헤더
속성, 형식, Description
accept string

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

경로 매개 변수
속성, 형식, Description
hook_id integer 필수

The unique identifier of the hook.

"Ping a global webhook"에 대한 HTTP 응답 상태 코드

상태 코드Description
204

No Content

"Ping a global webhook"에 대한 코드 샘플

post/admin/hooks/{hook_id}/pings
curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/admin/hooks/HOOK_ID/pings

Response

Status: 204