Developers · Webhooks
AvailableHow does my software know that something changed?
With a webhook. Namens calls your address when something happens: the register changed, messages came in, an item got a deadline or a mandate changed state. Every webhook is signed, and none contains the content of a message.
| Event | When |
|---|---|
register.changed | The register changed for a number you follow, or for a company your organisation follows. |
message.received | A new message came in for a followed company. You get the description, not the content. |
message.handled | Someone marked an item as handled. |
deadline.set | An item got a deadline, or the deadline changed. |
mandate.changed | The state of a mandate changed: none, requested, waiting, active or refused. |
How is a webhook built?
- Three headers: the id of the event, the timestamp and the signature.
- The content is JSON, with the type of event and the data.
- The same id never comes back with different content: you can safely deduplicate on it.
What does my address have to do?
- Check the signature with your secret.
- Answer with a 2xx within a few seconds.
- Do the real work afterwards, not during the call.
An organisation can set up 5 addresses, each with its own secret and its own choice of events.
{
"type": "mandate.changed",
"data": {
"company": {
"enterprise_number": "0100000169",
"name": "Bakkerij De Korenaar"
},
"source": "ebox",
"before": "waiting",
"after": "active"
}
}
webhook-id: <event id>
webhook-timestamp: <timestamp>
webhook-signature: v1,<signature>
Frequently asked questions
Is the content of a message in a webhook?
No, never. A webhook describes the item: company, source, sender, type and dates. Fetching the content is a separate, explicit call.
How do I know a webhook really comes from Namens?
Every webhook is signed as the Standard Webhooks convention describes: a signature over the id, the timestamp and the content, with a secret only you and we know. Ready-made libraries exist for this.
What if my address does not answer for a while?
Then we try again, each time with a longer pause: after 1 min, 5 min, 30 min, 2 hours, 12 hours. An address that only failed for 3 days is switched off.
Can I also request the same myself?
Yes. What a webhook reports you also find with an ordinary call: the changes in the register, the inbox, the deadlines. So you miss nothing if a webhook got lost.
Where do I start?
Available- Create an account. You start in the simulator, with sample companies and sample messages.
- Create a test key in the simulator. It answers with the sample companies and never asks anything of the real register.
- Build and test against the test key. A real key then works the same way, on real data.