Esta versão do GitHub Enterprise foi descontinuada em 2022-06-03. Nenhum lançamento de patch será feito, mesmo para questões críticas de segurança. Para obter melhor desempenho, melhorar a segurança e novos recursos, upgrade to the latest version of GitHub Enterprise. Para ajuda com a atualização, contact GitHub Enterprise support.
Webhooks do aplicativo GitHub
Sobre a API de webhooks do aplicativo GitHub
O webhook de aplicativo GitHub permite que você receba cargas POST de HTTP sempre que certos eventos ocorrerem para um aplicativo. The webhook REST APIs enable you to manage repository, organization, and app webhooks. You can also use the REST API to change the configuration of the webhook. Por exemplo, você pode modificar a URL da carga, tipo de conteúdo, verificação de SSL e segredo. Para obter mais informações, consulte:
Get a webhook configuration for an app
Returns the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see "Creating a GitHub App."
You must use a JWT to access this endpoint.
HTTP response status codes
| Status code | Descrição | 
|---|---|
| 200 | OK | 
Amostras de código
curl \
  -H "Accept: application/vnd.github.v3+json" \ 
  -H "Authorization: token <TOKEN>" \
  http(s)://HOSTNAME/api/v3/app/hook/configResponse
Status: 200{
  "content_type": "json",
  "insecure_ssl": "0",
  "secret": "********",
  "url": "https://example.com/webhook"
}Update a webhook configuration for an app
Updates the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see "Creating a GitHub App."
You must use a JWT to access this endpoint.
Parâmetros
| Headers | 
|---|
| Nome, Tipo, Descrição | 
| acceptstringSetting to  | 
| Body parameters | 
| Nome, Tipo, Descrição | 
| urlstringThe URL to which the payloads will be delivered. | 
| content_typestringThe media type used to serialize the payloads. Supported values include  | 
| secretstringIf provided, the  | 
| insecure_sslstring or number orDetermines whether the SSL certificate of the host for  | 
HTTP response status codes
| Status code | Descrição | 
|---|---|
| 200 | OK | 
Amostras de código
curl \
  -X PATCH \
  -H "Accept: application/vnd.github.v3+json" \ 
  -H "Authorization: token <TOKEN>" \
  http(s)://HOSTNAME/api/v3/app/hook/config \
  -d '{"content_type":"json","insecure_ssl":"0","secret":"********","url":"https://example.com/webhook"}'Response
Status: 200{
  "content_type": "json",
  "insecure_ssl": "0",
  "secret": "********",
  "url": "https://example.com/webhook"
}