Skip to navigation

On Consent Submitted

View as Markdown

Triggered when your customer accepts the consent and the legal documents shown in the widget. From this point the sources may be queried on their behalf.

This is the event to store. data carries what was agreed and the proof of it: accepted_features is the scope granted, accepted_documents the exact version and hash of every text accepted, and the address, the agent and the timestamp say from where and when.

An application that shows no documents of its own on our screen sends accepted_documents empty. Consent is the act; the documents are what the application had to show.

What data carries, and what actually travels

The schema below describes data decrypted — on purpose, so this reference has a model you can read and code against. What arrives at your endpoint depends on how the session was created:

  • With an aes_key: data is a single string, aes::Base64(IV + Ciphertext + Tag). Decrypt it and you get exactly the object documented below. The walkthrough and the code are in Payload Encryption.
  • Without an aes_key: data is not in the body at all — absent, not null. Somebody’s records are never put on the wire unencrypted, so the event tells you what happened and you read the content from Get Session Results when it arrives.

Answer 2xx as soon as the payload reaches you, whatever your processing does with it afterwards: any other status is recorded as a failed delivery even though the event arrived. Answering a delivery has the handler to copy.

Payload

The payload of this webhook request is an object.
event_class"EsPublicAdministrationV1FlowEvent"Required

Payload class discriminator — always this value for Spain Public Administration events.

app_idstringRequiredformat: "object-id"
customer_idstringRequired1-64 characters
session_idstringRequiredformat: "object-id"
producer"es-public-administration"Required
The flow that produced the event.
event"es-public-administration:consent"Required

The event type: consent.

status_codeenumRequired
Describes the status of a flow.
datestringOptionalformat: "datetime"
status_messagestring or nullOptional
dataobjectOptional

What the customer agreed to, and the proof of it. Documented decrypted: on the wire it is the aes::… string of this object when the session carries an aes_key, and absent when it does not.

Response

200
Successful Response
422
Validation Error