Create a Share session

AI Tools

After initialising the Yoti Identity Client, the next step is to configure your backend application to create a Share session. The Yoti SDKs enable integrators to dynamically create these sessions by defining a session configuration. A unique session would also include a share policy, which is a set of requested attributes or schemes for the sharing process.

First, we will describe which attributes are available so you know what policy you would like to build:

Different ID documents have different attributes, bear this in mind when requesting attributes. e.g. A Nationality attribute is common for a Passport.

There is a small explanation of each attribute and what the content type is:

NameContent TypeExplanationExample
remember_me_idSTRINGWhen you retrieve the user profile, you receive a user ID generated by Yoti exclusively for your application. This means that if the same individual logs into another app, Yoti will assign her/him a different ID. See below for more information.<UUID>
parent_remember_me_idSTRINGIf you have more than one application. When you retrieve the user profile, you receive a user ID generated by Yoti exclusively for each application.<UUID>
PhotoJPEGPhotograph of user, encoded as a JPEG image.N/A
full_nameSTRINGThe user's full name. If family_name/given_names are present, this will be equal to the string ${given_names} + " " + ${family)_name}."Jon Jim Fred Foo"
given_namesSTRINGCorresponds to secondary names on a passport, and first/middle names in English."Jon Jim Fred"
family_namesSTRINGFamilyName is the family name. Not all documents provide split given names and family name"Foo"
phone_numberSTRINGThe user's phone number, as verified during registration. This will be a number in E.164 format"+447777123456"
email_addressSTRINGThe user's verified email address."test@test.com"
date_of_birthDATEDate of birth of the user in the form yyyy-mm-dd, or yyyy-mm or yyyy."2000-12-01"
age_over:[1-999]STRINGWhether the user is over the specified age, as calculated from their date of birth. Either "true" or "false"."TRUE", "FALSE"
postal_addressSTRINGFull address"6th Floor, 107 Leadenhall St, London, EC3A 4AF"
structured_postal_addressJSONStructuredPostalAddress is the postal address with the breakdown in address lines, post code and so on as well as the formatted address all in one line. See details for structured_postal_address JSON properties below.N/A
genderSTRINGCorresponds to the gender in the registered document."MALE", "FEMALE", "TRANSGENDER" or "OTHER"
nationalitySTRINGCorresponds to the nationality on the passport. ISO-3166-1 alpha-3 code with ICAO9303 (passport) extensions. See Wikipedia page for ISO-3166-1 alpha-3 codes, and see ICAO 9303 part 3 (section 5 part A) for the extended list of codes."GBR"
selfie_authenticationBOOLEANThis is to prompt the user to take a selfie of themselves live via the Digital ID app as extra level of security.
document_detailsSTRING

TYPE = [PASSPORT | DRIVING_LICENCE | NATIONAL_ID | PASS_CARD]

ISSUING_COUNTRY = alpha-3 country code, e.g. “GBR“ (see nationality above).

DOCUMENT_NUMBER = arbitrary document number

EXPIRATION_DATE = optional date in RFC3339 form (YYYY-MM-DD), e.g. “2016-03-21“ (21st March 2016). If the document does not expire, this field will not be present.

ISSUING_AUTHORITY = optional can either be a country code for a state or the name of the issuing authority.

document_imagesMULTI_VALUEContains a jpeg image of the document.

Unique IDs

When a user completes a share with you, Yoti generates two unique IDs.

  1. A Remember me ID (service level)
  2. A Parent remember me ID (organisation/account level)

One is for the specific application being used, and one is at an organisation level (parent). This means the user does not have to share their personal details every time, as you can just ask for your Remember Me ID instead.

For example, if you have two services:

  1. Service 1 offered by Company ABC
  2. Service 2 is offered by the same Company ABC That share will contain the same Company ABC ID and a different ID for application 2. Yoti has no access to these IDs. This approach is in line with Yoti’s data minimisation principle, meaning users should only share the details relevant to what you are doing.

If a user deletes the Digital ID app without taking a backup, it will generate a new remember me ID when their Digital ID account is set-up.

Address attributes

Yoti has two options to show users' addresses:

1) Full address:- the address as a string.

2) Structured address:- a broken-down version of an address.

There is a small explanation of each attribute and what the content type is.

NameExpected content typeExplanation
building_numberSTRINGThe number of the building.
building_nameSTRINGThe name of the building.
sub_building_nameSTRINGThe subtitle of the building.
address_line_1STRINGThe first line of the address.
address_line_2STRINGThe second line of the address.
address_line_3STRINGThe third line of the address.
townSTRINGThe town of the address.
countrySTRINGThe country of the address.
postal_codeSTRINGThe postcode for the address.
postal_addressSTRINGThe full address.
structured_postal_addressJSONThe full address in both machine readable form and human readable form

The below defines the fields of a JSON structure that can be used to define any address. A subset of fields will be present in each case, and address_format can be used to ascertain which ones for any given address. The country iso should not be used for this purpose.

We have four formats shown below:

FieldFormat 1 (UK)Format 2 (INDIA)Format 3 (USA)Format 4 (ROW)
udprnOptional
care_ofOptional
sub_buildingOptional
building_numberOptional
buildingOptionalOptional
streetOptional
landmartOptional
address_line_1PresentPresentPresent
address_line_2OptionalOptionalOptional
address_line_3OptionalOptional
address_line_4Optional
address_line_n*Optional
localityPresentOptionalPresent
town_cityPresentOptionalPresent
subdistrictOptional
districtOptional
stateOptionalOptionalPresentOptional
postal_codePresentPresentPresent
post_officeOptional
country_isoPresentPresentPresentPresent
countryPresentPresentPresentPresent
formatted_addressPresentPresentPresentPresent

*The letter "n" represents a numerical figure. Yoti supports up to 6 lines of addresses.

Address Format 1

The UK address format is as shown below, with an example:

JSON
Copy

Address Format 2

The Indian address format is as shown below, with an example:

JSON
Copy

Address Format 3

The US address format is as shown below, with an example:

JSON
Copy

Build a policy

A policy is used to define what attributes are requested from the user. You can use the policy builder to define what attributes are needed.

Node.js
Java
PHP
C#
Go
Copy

There are several type of attributes that can be stored on a user's Digital ID app. Yoti provides the ability to request these attributes by specifying a share policy.

The attributes are independent of each other, so they can be requested separately. In order to request the required attributes using our SDKs, see the following examples:

Node.js
Java
PHP
C#
Go
Copy

Specify the Session configuration

The Session configuration is built using:

  • The policy.
  • The redirect URI for share completion. This is where the user will be redirected to after the share is completed. A receiptId query parameter will be added to the URL. You can use this to retrieve the user profile from the share.
  • A subject Id (optional).
  • A notification webhook (optional).
  • Any extensions.
Node.js
Java
PHP
C#
Go
Copy

Create a Share session

Using the session configuration defined above, you can request the creation of a Share session that will be used by the Yoti Webshare script to generate a Yoti QR.

Node.js
Java
PHP
C#
Go
Copy

Error codes

Error codeDescription
400Invalid request payload sent
400One or more of the specified attributes are not known
403Service is disabled
403Service does not belong to an organisation
403Organisation status must be PENDING or VERIFIED to perform shares
403Service isn’t allowed to request the specified 3rd party attribute
403Service isn’t allowed to issue the specified 3rd party attribute
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard