Léim go dtí an príomhábhar

Webhooks — Fógraí Imeachta

Cláraigh críochphointe HTTPS chun imeachtaí a fháil de réir mar a tharlaíonn siad.

Ardleibhéal· 7 nóiméad léite· Nuashonraithe: 2026-05-05· Fuair 31 duine é seo úsáideach
Is fógra é webhook a sheolann Glanevo chuig do sheoladh nuair a tharlaíonn rud éigin. **Clárú.** Socruithe → Forbróirí → Webhooks → + Nua: - URL (HTTPS ag teastáil) - Cineálacha imeachta (roghnaigh roinnt) - Rún (le haghaidh fíorú sínithe) **Cineálacha imeachta.** - `appointment.created`, `appointment.updated`, `appointment.cancelled`, `appointment.no_show` - `customer.created`, `customer.updated` - `payment.succeeded`, `payment.failed`, `payment.refunded` - `invoice.created`, `invoice.paid` - `staff.created` **Sampla ualaigh (`appointment.created`):** ```json { "id": "evt_01HX...", "type": "appointment.created", "createdAt": "2026-05-21T10:30:00Z", "data": { "appointment": { "id": "apt_01HY...", "customerId": "cus_...", "serviceId": "svc_...", "startAt": "2026-05-22T14:00:00Z", "endAt": "2026-05-22T15:30:00Z", "price": 450 } } } ``` **Fíoraigh an síniú.** Iompraíonn gach iarratas ceanntásc `X-Glanevo-Signature`, sínithe le HMAC-SHA256. ```js const crypto = require('crypto'); const expected = crypto .createHmac('sha256', WEBHOOK_SECRET) .update(rawBody) .digest('hex'); if (req.headers['x-glanevo-signature'] !== expected) { return res.status(401).end(); } ``` **Atriail.** Mura bhfilleann tú 2xx, déanaimid atriail cúig huaire le cúlú easpónantúil (2 nóim, 5 nóim, 20 nóim, 1 uair, 6 uair). 📊 Stair webhook: Socruithe → Forbróirí → Loganna.

Ar chabhraigh an t-alt seo leat?