Esta versión de GitHub Enterprise se discontinuó el 2022-06-03. No se realizarán lanzamientos de patch, ni siquiera para problemas de seguridad críticos. Para obtener un mejor desempeño, más seguridad y nuevas características, actualiza a la última versión de GitHub Enterprise. Para obtener ayuda con la actualización, contacta al soporte de GitHub Enterprise.
GitHub App webhooks
About the GitHub App webhooks API
Un webhook de GitHub App te permite recibir cargas útiles de POST por HTTP cada que sucedan ciertos eventos para una app. Las API de REST de los webhooks te permiten administrar webhooks de repositorio, organización y aplicación.. También puedes utilizar la API de REST para cambiar la configuración del webhook. Por ejemplo, puedes modificar la URL de la carga útil, el tipo de contenido, la verificación de SSL, y el secreto. Para obtener más información, consulta:
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.
Códigos de estado de respuesta HTTP
| Código de estado | Descripción | 
|---|---|
| 200 | OK | 
Ejemplos 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
| Encabezados | 
|---|
| Nombre, Tipo, Descripción | 
| acceptstringSetting to  | 
| Parámetros de cuerpo | 
| Nombre, Tipo, Descripción | 
| 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  | 
Códigos de estado de respuesta HTTP
| Código de estado | Descripción | 
|---|---|
| 200 | OK | 
Ejemplos 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"
}