Recibir eventos del webhook de Facebook e Instagram
POST
/facebook/webhook
const url = 'https://api.matiasimpulso.com/facebook/webhook';const options = { method: 'POST', headers: {'x-hub-signature-256': 'example', 'Content-Type': 'application/json'}, body: '{"object":"page","entry":[{}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.matiasimpulso.com/facebook/webhook \ --header 'Content-Type: application/json' \ --header 'x-hub-signature-256: example' \ --data '{ "object": "page", "entry": [ {} ] }'Valida el formato del payload y verifica la firma HMAC-SHA256 (x-hub-signature-256) sobre el cuerpo crudo antes de encolar los eventos de Meta.
Parameters
Sección titulada « Parameters »Header Parameters
Sección titulada « Header Parameters » x-hub-signature-256
required
string
Firma HMAC-SHA256 del cuerpo crudo calculada con el App Secret de Meta (formato sha256=…).
Request Bodyrequired
Sección titulada « Request Bodyrequired » Media type application/json
object
object
required
Tipo de objeto de Meta (page o instagram).
string
Example
page entry
required
Lista de entradas de eventos enviadas por Meta.
Array<object>
object
Responses
Sección titulada « Responses »Evento del webhook validado y encolado exitosamente.
Payload del webhook con formato inválido.
Firma del webhook ausente o inválida.
Límite de tasa de solicitudes del webhook excedido.
Webhook no aceptado temporalmente; Meta reintentará la entrega.