Retrieve the profile

Retrieving a profile involves retrieving a Receipt ID, and decrypting it to get the user profile.

After the user scans a QR code and share their profile, the webshare script will perform an redirection from the QR code page to your redirect URI, passing the receipt Id as a query string parameter. This receipt id is URL encoded and should be decoded before being used with the Yoti SDK.

For a Redirect URI set as https://your-redirect-uri in the Share session configuration, the returned URL would look like the following: https://your-redirect-uri?receiptId=.

Yoti will automatically prefix this URL with domain name specified in your Yoti Hub app.

When your web application receives the receipt id via the defined endpoint as a query string parameter, you can easily retrieve the user profile. The user profile object provides a set of user attributes corresponding to the attributes that you request in the share session.

SDK process

When you pass the receipt id to the Yoti Identity Client object, the SDK does the following:

  • Decrypts the wrapped receipt key attribute, using the application private key.
  • Uses the decrypted key to decrypt the other party profile content attribute.
  • Decodes the decrypted profile and returns it to your application.

The profile attributes are central to the SDK and allow you to see and work with the information that your users share with you.

Node.js
Java
PHP
C#
Go
Copy

Sources and Verifiers

You have a choice to allow unverified attributes like full name and address. Before completing the share, the end-user can get the attribute verified. However, if they decide to share the attribute without verification, the share will still go through but the attribute will be unverified. In order to check the verification status for a profile attribute, you can retrieve its source and verifier as describe above.

As an example, if the user has manually entered their address without verification, the postal_address attribute will have a source of USER_PROVIDED and verifier will be blank. If however, they chose to verify their address before sharing, the attribute verifier will be YOTI_IDENTITY and the sub type will contain the processing method of its verification.

Node.js
Java
PHP
C#
Go
Copy

Webhook notifications

If the webhook endpoint is provided during the Share session creation, the notifications will be sent for each share performed by the end-user. These will also contain the Receipt ID that can be used to retrieve the decrypted user profile.

The notifications will be sent in the following format:

COMPLETED:

JSON
Copy

FAILED:

JSON
Copy

Session status

A webhook notification is triggered based on the Session state, which could be one of the following:

StatusDescription
COMPLETEDThe share associated with the session was completed (with success receipt available).
FAILEDThe share associated with the session was completed (with failure receipt available).
CANCELLEDMobile app requested the session to be cancelled (before share was completed).
EXPIREDThe share associated with the session was never completed (no receipt available).
ERRORA "catch-all" status for unexpected/unrecoverable errors that might happen during execution (e.g. we get a receipt but the service fails to parse it, required parameter not present).
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard