Retrieve the credential

Before you start

Please get familiar with our user profile service with the Yoti App.

Retrieve the profile

Once the user has scanned the Yoti QR code, Yoti will perform a GET request to the defined call-back URL, passing a token as a query string parameter, any additional relying party defined query parameters will also be passed here.

const CONTENT_TYPE_STRING = 1;
const CONTENT_TYPE_JPEG = 2;
const CONTENT_TYPE_DATE = 3;
const CONTENT_TYPE_PNG = 4;
const CONTENT_TYPE_BYTES = 5;
const CONTENT_TYPE_INT = 7;

const stringValue = AttributeConverter.convertValueBasedOnContentType(
profile.getAttribute("Third_Party_Attribute_Name").getValue(),
CONTENT_TYPE_STRING //text/string
);

const imageJPG = AttributeConverter.convertValueBasedOnContentType(
profile.getAttribute("Third_Party_Attribute_Name").getValue(),
CONTENT_TYPE_JPEG //image/jpg
);

const dateTime = AttributeConverter.convertValueBasedOnContentType(
profile.getAttribute("Third_Party_Attribute_Name").getValue(),
CONTENT_TYPE_DATE //DateTime
);

const imagePNG = AttributeConverter.convertValueBasedOnContentType(
Attribute<String> stringValue = profile.getAttribute("Third_Party_Attribute_Name", String.class);
Attribute<Image> imageJPG = profile.getAttribute("Third_Party_Attribute_Name", Image.class);
Attribute<Date> dateTime = profile.getAttribute("Third_Party_Attribute_Name", Date.class);
Attribute<Map<String, Object>> jsonValue = profile.getAttribute("Third_Party_Attribute_Name", (Class) Map.class);
Attribute<Integer> intValue = profile.getAttribute("Third_Party_Attribute_Name", Integer.class);
private const CONTENT_TYPE_STRING = 1;
private const CONTENT_TYPE_JPEG = 2;
private const CONTENT_TYPE_DATE = 3;
private const CONTENT_TYPE_PNG = 4;
private const CONTENT_TYPE_JSON = 5;
private const CONTENT_TYPE_INT = 7;

$stringValue = AttributeConverter::convertValueBasedOnContentType(
$profile->getProfileAttribute('Third_Party_Attribute_Name')->getValue(),
CONTENT_TYPE_STRING, //text/string
null
);

$imageJPG = AttributeConverter::convertValueBasedOnContentType(
$profile->getProfileAttribute('Third_Party_Attribute_Name')->getValue(),
CONTENT_TYPE_JPEG, //image/jpg
null
);

$dateTime = AttributeConverter::convertValueBasedOnContentType(
$profile->getProfileAttribute('Third_Party_Attribute_Name')->getValue(),
from yoti_python_sdk import attribute_parser
from yoti_python_sdk.protobuf import protobuf

def proto():
return protobuf.Protobuf()
stringValue = attribute_parser.value_based_on_content_type(
profile.get_attribute("Third_Party_Attribute_Name").value, proto.STRING
)

imageJPG = attribute_parser.value_based_on_content_type(
profile.get_attribute("Third_Party_Attribute_Name").value, proto.CT_JPEG
)

dateTime = attribute_parser.value_based_on_content_type(
profile.get_attribute("Third_Party_Attribute_Name").value, proto.CT_DATE
)

imagePNG = attribute_parser.value_based_on_content_type(
profile.get_attribute("Third_Party_Attribute_Name").value, proto.CT_PNG
)

jsonValue = attribute_parser.value_based_on_content_type(
profile.GetAttributeByName<string>(name: "_thirdPartyAttributeName"); //text/string
profile.GetAttributeByName<Dictionary<string, JToken>>(name: "_thirdPartyAttributeName"); //application/json
profile.GetAttributeByName<PngImage>(name: "_thirdPartyAttributeName"); //image/png
profile.GetAttributeByName<JpegImage>(name: "_thirdPartyAttributeName"); //image/jpeg
profile.GetAttributeByName<DateTime>(name: "_thirdPartyAttributeName"); //DateTime
profile.GetAttributeByName<int>(name: "_thirdPartyAttributeName"); //integer
stringValue := userProfile.GetStringAttribute("Third_Party_Attribute_Name").Value()
imageJPG := userProfile.GetImageAttribute("Third_Party_Attribute_Name").Value()
dateTime := userProfile.GetAttribute("Third_Party_Attribute_Name").Value()
imagePNG := userProfile.GetImageAttribute("Third_Party_Attribute_Name").Value()
jsonValue := userProfile.GetJSONAttribute("Third_Party_Attribute_Name").Value()
intValue := userProfile.GetAttribute("Third_Party_Attribute_Name").Value()
stringValue = Yoti::Protobuf.value_based_on_content_type(profile.get_attribute('Third_Party_Attribute_Name'), Yoti::Protobuf::CT_STRING)

imageJPG = Yoti::Protobuf.value_based_on_content_type(profile.get_attribute('Third_Party_Attribute_Name'), Yoti::Protobuf::CT_JPEG)

dateTime = Yoti::Protobuf.value_based_on_content_type(profile.get_attribute('Third_Party_Attribute_Name'), Yoti::Protobuf::CT_DATE)

imagePNG = Yoti::Protobuf.value_based_on_content_type(profile.get_attribute('Third_Party_Attribute_Name'), Yoti::Protobuf::CT_PNG)

jsonValue = Yoti::Protobuf.value_based_on_content_type(profile.get_attribute('Third_Party_Attribute_Name'), Yoti::Protobuf::CT_JSON)

intValue = Yoti::Protobuf.value_based_on_content_type(profile.get_attribute('Third_Party_Attribute_Name'), Yoti::Protobuf::CT_INT)