Notifications
Each session has a configured 'time to live' (TTL) which must be above 60 seconds (1 minute). When a session is created, it remains active until its time to live is reached.
To receive the result of an age verification, an HTTP endpoint (notification URL) needs to be listening for a JSON payload in the format below through a POST method.
Notifications require HTTPS and will be reattempted if a 200 status code is not received. It is important to acknowledge the notification with a 200 status code to avoid receiving repeat notifications.
Notifications will be sent multiple times for cases where retries or the resume flow are enabled. It may be possible for a user to initially 'fail' a check type, but subsequently pass on a retry.
Notifications will be sent out for each age verification attempt that a user undergoes.
Below is an example payload:
Within the notification object, Yoti returns a signature, which allows you to verify that the notification originated from Yoti's Age Verification service.
Verifying the signature may be achieved by:
Create a JSON string from the notification payload, stripping out
sequence_numberandsignature. All spaces in this string must be trimmed.Convert the resulting JSON string into bytes by encoding it as UTF-8.
Hash these bytes using SHA256 (C# and Go only).
Decode the base64-encoded signature to determine its length in bytes and calculate the salt length.
RSA-SHA256 verify the byte value of the JSON string from Step 2 (or hash of the bytes from Step 3) against the byte value of the signature in the webhook response, using PSS padding with SHA256 and the calculated salt length.
The public key is at the bottom of this page.
Example Code
Got a question? Contact us here.