Webhooks for new values
On the Pro plan and above, Quellenkontor reports every new or changed value to your server. That way you keep values current without checking yourself.
When a message is sent
#Webhooks are available from the Pro plan onward. As soon as a new, changed or corrected value appears in the changelog, Quellenkontor sends a message to your address.
- Delivery happens once a day, at 07:00 UTC. So a change from Monday reaches you by Tuesday morning at the latest.
- You only get changes recorded after you created the webhook. Fetch the state from before that once, via the history.
- We add new values once they are officially promulgated, usually weeks before they take effect. That gives your software a lead time.
Create a webhook
#- Enter your server's address under Webhooks in your account. It must start with https:// and have a domain name, not an IP address or an internal name.
- Choose the datasets you are interested in. Without a selection, you get all of them.
- Copy the secret. It starts with
whsec_and is shown only once. You use it to verify the signature. - Trigger a test message with "Send test" and check that your server accepts it.
Up to 10 webhooks are possible per account.
Events
#| ereignis | Meaning |
|---|---|
wert.neu | A new step has been recorded, for example next year's contribution ceilings |
ankuendigung | A promulgated change whose value or field only arrives later, for example a new formula starting next year |
wert.geaendert | An existing step has changed due to a new rule |
korrektur | We corrected an error in a value. Check any calculations that are affected |
datensatz.neu | A new dataset is available |
test | Test message from your account, without a dataset |
Message format
#The message arrives via POST with the header Content-Type: application/json:
| Field | Meaning |
|---|---|
ereignis | Type of change, see above |
id | Number of the entry in the changelog, unique and ascending |
datensatz | Affected dataset, null for test |
gueltig_ab | When the new value takes effect, otherwise null |
text | Short description of the change, in German |
beleg_url | Official source of the change |
abruf | Ready-made API address for fetching the new value |
gesendet_am | Time the message was sent, in UTC |
Verify the signature
#Every message carries the header Quellenkontor-Signatur in the form t=<timestamp>,v1=<signature>. The signature is an HMAC-SHA256 in hex over the timestamp, a period, and the raw text of the request, using the webhook's secret as the key. Here is how you verify it:
- Read the raw text before you parse it as JSON. Even a single different whitespace character changes the signature.
- Compute the signature yourself and compare it to v1 in constant time.
- Discard messages with a timestamp older than five minutes. This protects against replayed messages.
Node.js
Python
Responses and retries
#- Respond within 8 seconds with a 2xx status. Do any heavy work afterward, for example through a queue.
- We do not follow redirects (3xx); they count as a failure.
- On failure, we retry at the next daily run, up to five times in total. After that we give up on that message.
Processing messages
#Store the id of every message you process. If your server processed a message but responded too late, it arrives again at the next run. You recognize this by the id. You then fetch the new value using the address in abruf, which counts as one request.
Something missing or unclear? Write to us and we will extend the docs.