Personal Information
Presentation Definition
Below is the sample Presentation Definition for querying personal information from the user’s Affinidi Vault.
Important Note
When querying user’s profile data from the Affinidi Vault, you must always include the$.@context
and $.type
check in the input_descriptors of your Presentation Definition to work.{
"id": "profile_data",
"input_descriptors": [
{
"id": "profile_vc",
"name": "Profile VC",
"purpose": "Get some profile data",
"constraints": {
"fields": [
{
"path": [
"$.@context"
],
"purpose": "Verify VC Context",
"filter": {
"type": "array",
"contains": {
"type": "string",
"pattern": "^https://schema.affinidi.io/profile-template/context.jsonld$"
}
}
},
{
"path": [
"$.type"
],
"purpose": "Verify VC Type",
"filter": {
"type": "array",
"contains": {
"type": "string",
"pattern": "^ProfileTemplate$"
}
}
},
{
"path": [
"$.credentialSubject.person.givenName"
],
"purpose": "Require first name"
},
{
"path": [
"$.credentialSubject.person.familyName"
],
"purpose": "Require last name"
}
]
}
}
]
}
The sample Presentation Definition above requests the user’s first and last name. Additionally, we must include the $.@context
and $.type
filters to ensure we request data from the Profile Template schema.
Available Data Points
Here is a list of available fields in the Personal Information category of the Profile Template that can be requested from the user’s Affinidi Vault.
Address
Property Name:addresses
Property Type:Array
Property Path:$.credentialSubject.person.addresses[0]
Name | Type | Field | Description |
---|---|---|---|
Country | String | addressCountry | Enter country |
City or locality | String | addressLocality | Enter city or locality |
Region | String | addressRegion | Enter region |
Address type | String | addressType | Select address type |
Postal code | String | postalCode | Enter postal code |
Street name and house number | String | streetAddress | Enter street name and house number |
To request the data, use the property path with the field name of the data you require.
For example, $.credentialSubject.person.addresses[0].{FIELD_NAME}
Date of birth
Property Name:birthdate
Property Type:String
Property Path:$.credentialSubject.person
Name | Type | Field | Description |
---|---|---|---|
Date of birth | String | birthdate | Enter date of birth (YYYY-MM-DD) |
To request the data, use the property path with the field name of the data you require.
For example, $.credentialSubject.person.{FIELD_NAME}
Email address
Property Name:email
Property Type:String
Property Path:$.credentialSubject.person
Name | Type | Field | Description |
---|---|---|---|
Email address | String | email | Enter email address |
To request the data, use the property path with the field name of the data you require.
For example, $.credentialSubject.person.{FIELD_NAME}
Family name
Property Name:familyName
Property Type:String
Property Path:$.credentialSubject.person
Name | Type | Field | Description |
---|---|---|---|
Family name | String | familyName | Enter family name |
To request the data, use the property path with the field name of the data you require.
For example, $.credentialSubject.person.{FIELD_NAME}
Gender
Property Name:gender
Property Type:String
Property Path:$.credentialSubject.person
Name | Type | Field | Description |
---|---|---|---|
Gender | String | gender | Select gender |
To request the data, use the property path with the field name of the data you require.
For example, $.credentialSubject.person.{FIELD_NAME}
Given name
Property Name:givenName
Property Type:String
Property Path:$.credentialSubject.person
Name | Type | Field | Description |
---|---|---|---|
Given name | String | givenName | Enter given name |
To request the data, use the property path with the field name of the data you require.
For example, $.credentialSubject.person.{FIELD_NAME}
Highest education degree
Property Name:highestEducationLevel
Property Type:String
Property Path:$.credentialSubject.person
Name | Type | Field | Description |
---|---|---|---|
Highest education degree | String | highestEducationLevel | Enter highest education degree |
To request the data, use the property path with the field name of the data you require.
For example, $.credentialSubject.person.{FIELD_NAME}
Middle name
Property Name:middleName
Property Type:String
Property Path:$.credentialSubject.person
Name | Type | Field | Description |
---|---|---|---|
Middle name | String | middleName | Enter middle name |
To request the data, use the property path with the field name of the data you require.
For example, $.credentialSubject.person.{FIELD_NAME}
Nickname
Property Name:nickname
Property Type:String
Property Path:$.credentialSubject.person
Name | Type | Field | Description |
---|---|---|---|
Nickname | String | nickname | Enter nickname |
To request the data, use the property path with the field name of the data you require.
For example, $.credentialSubject.person.{FIELD_NAME}
Occupation
Property Name:occupation
Property Type:String
Property Path:$.credentialSubject.person
Name | Type | Field | Description |
---|---|---|---|
Occupation | String | occupation | Enter occupation |
To request the data, use the property path with the field name of the data you require.
For example, $.credentialSubject.person.{FIELD_NAME}
Phone number
Property Name:phoneNumber
Property Type:String
Property Path:$.credentialSubject.person
Name | Type | Field | Description |
---|---|---|---|
Phone number | String | phoneNumber | Enter phone number |
To request the data, use the property path with the field name of the data you require.
For example, $.credentialSubject.person.{FIELD_NAME}
Profile Picture
Property Name:picture
Property Type:Object
Property Path:$.credentialSubject.person.picture
Name | Type | Field | Description |
---|---|---|---|
Profile picture caption | String | caption | Enter profile picture caption |
Profile picture URL | String | url | Enter profile picture URL |
To request the data, use the property path with the field name of the data you require.
For example, $.credentialSubject.person.picture.{FIELD_NAME}
Glad to hear it! Please tell us how we can improve more.
Sorry to hear that. Please tell us how we can improve.
Thank you for sharing your feedback so we can improve your experience.