Referencia

Eventos de webhooks

Un sitio lista sus webhooks en sus eventos. Cada cambio envía un evento a cada uno, como JSON en un POST, firmado con el secreto del webhook. parseHollwareEvent de @hollware/core lee uno, y verifyWebhook verifica su firma.

Las descripciones de los campos son las del código, en inglés.

Entrega

Un evento se escribe en el mismo lote que el cambio que cuenta, y después se envía por la cola: un webhook que responde un error lo recibe de nuevo, hasta cinco veces. Los eventos de una revisión llegan a los webhooks en la siguiente pasada del cron, en menos de un minuto. Quien recibe usa el id de un evento para ignorar uno que ya tiene.

  • hollware-event-id: el id del evento, el mismo en cada reintento
  • hollware-timestamp: cuándo se firmó, en segundos; verifyWebhook rechaza uno que esté a más de cinco minutos
  • hollware-signature: v1= y el HMAC-SHA256 del timestamp, un punto y el cuerpo, con el secreto del webhook

entry.published · entry.unpublished

CampoTipoQué es
idstringThe id of the event, the same on every retry: ignore one you already have.
sitestringThe key of the site it happened in.
atstringWhen it happened, as an ISO 8601 timestamp.
cacheTagsstring[]The cache tags of the pages it changed, to purge; none when no page changed.
entryobjectThe entry: its id, collection, locale, slug and translation group.
pathunknownThe path of the entry on the site, from the route of its collection and locale.
urlunknownThe URL of the entry, when the site has a url.

site.changed

CampoTipoQué es
idstringThe id of the event, the same on every retry: ignore one you already have.
sitestringThe key of the site it happened in.
atstringWhen it happened, as an ISO 8601 timestamp.
cacheTagsstring[]The cache tags of the pages it changed, to purge; none when no page changed.

review.requested · review.decided

CampoTipoQué es
idstringThe id of the event, the same on every retry: ignore one you already have.
sitestringThe key of the site it happened in.
atstringWhen it happened, as an ISO 8601 timestamp.
cacheTagsstring[]The cache tags of the pages it changed, to purge; none when no page changed.
reviewobjectThe review: its id, its status (pending when asked, what became of it when decided), the name of who asked, and the note of a reviewer who asked for changes or rejected it.
entryobjectThe entry the review asks to publish.
itemsobject[]Every entry the review changes, the entry above first, and what it does to each.
adminPathstringWhere a person reads the review in the admin, under the URL of this Hollware.