Skip to content
RDCpassRDCpassMinistère de l’Économie NumériqueMinistère de l’Économie Numérique
Guides : Webhooks
On this page

Receive webhooks

Be told as soon as a result is ready, without polling the API.

You need: a server reachable over HTTPS from the Internet.

  1. Add an endpoint

    Webhooks tab in the console: table of endpoints with their address, subscribed events, status and success rate.Webhooks tab in the console: table of endpoints with their address, subscribed events, status and success rate.Webhooks tab in the console: table of endpoints with their address, subscribed events, status and success rate.
    An application’s endpoints, in the console.

    In the application’s Webhooks tab, add the HTTPS address and choose the events. The signing secret, whsec_test_… in test, is shown only once: keep it with your other secrets.

  2. Verify the signature

    Each delivery is signed by an HMAC over “timestamp.body”, with the endpoint’s secret. Reject a delivery whose signature does not match.

    The signature comes in the X-RDCPASS-Webhook-Signature header: a hex-encoded HMAC-SHA256 computed over {timestamp}.{raw_body}. The timestamp comes in X-RDCPASS-Webhook-Timestamp.

    Contract to be confirmed by the API team.

    Verifying the signature: code example

  3. Answer fast

    Answer 2xx within 5 seconds, then process the event separately. Otherwise the delivery is retried after 1 minute, 10 minutes, 1 hour, 6 hours and 16 hours, then marked as failed; administrators and developers are told.

  4. Send a test event

    From the console, send the webhook.test event. The deliveries list shows every attempt; in test, with its full payload. A failed delivery is replayed in one click.

Esc