Processing fact responseManage responses and extract the verified facts
Subscribe
As the user also has the option to accept or reject a fact request, the response also comes with a status property and some helpers like the authentication response.
Additionally a fact response comes with a list of attestations for the requested fact.
Subscribing to a facts response is similar to authentication.
@client.facts.subscribe do |resp|
# GOTO Deal with the response for details
end
// TBD
sdk.facts().subscribe((res: any): any => {
// GOTO Deal with the response for details
})
Processing fact response
The fact response will comes with a status and the same list of helpers as we described on authentication to deal with it.
Additionally each fact of the response has a list of attestations let’s see how to process them.
resp.facts.each do |fact|
p fact.name
fact.attestations do |a|
p "received #{a.value} from #{a.source}/#{a.fact} signed by #{a.origin}"
end
end
for _, f := range resp.Facts {
log.Println(f.Fact, ":", f.AttestedValues())
}
sdk.logger.info(res.attestationValuesFor('unverified_phone_number')[0])