API Get Privacy Data
Server-Side API endpoint to fetch Privacy Data
This endpoint fetches the underlying Privacy Data from an account that has granted consent for your dApp to access.
NOTE: There is a service library available to you in the Quadrata SDK, for this endpoint.
API endpoint to get PII data that has been granted to your dApp
GET
https://int.quadrata.com/api/v1/privacy/data/${account}
Path Parameters
account*
User's wallet address
Query Parameters
scopes
List[String]
Sparse privacy scopes to fetch
?scopes=FN,EM
If not provided, all granted scopes will be returned.
Use the scope, KYB_FULL
, to fetch all business information.
Headers
Authorization*
Basic ${base64(apiKey)}
Date*
String
Date and time of current request
Wed, 04 Oct 2023 02:39:37 GMT
X-Access-Token*
String
Privacy Access token
Signature*
String
{
"data": {
"attributes": {
"ADR": {
"value": "address city state zip country"
},
"DOB": {
"value": "1985-02-28"
},
"EM": {
"value": "user@email.com"
},
"FN": {
"value": "FirstName"
},
"G": {
"value": "123-gov-id"
},
"GC": {
"value": "class"
},
"GE": {
"value": "2031-05-15"
},
"GI": {
"value": "2022-02-13"
},
"GIS": {
"value": "CA"
},
"GP": {
"value": {
"backPhoto": {
"byteSize": 248197,
"filename": "photo1.jpg",
"url": "https://..."
},
"frontPhoto": {
"byteSize": 2005573,
"filename": "photo2.jpg",
"url": "https://..."
}
}
},
"LN": {
"value": "LastName"
},
"MN": {
"value": "MiddleName"
},
},
"type": "privacy.data"
}
}
{
"data": {
"attributes": {
"KYB_ADR": {
"value": {
"address": "123 Street Adr.",
"country": "US"
}
},
"KYB_DESC": {
"value": {
"description": "Business Description"
}
},
"KYB_NAME": {
"value": {
"dba": "N/A",
"entityName": "Business Name",
"legalName": "Business Legal Name"
}
},
"KYB_PLACE": {
"value": {
"placesOfActivity": "Places of Activity"
}
},
"KYB_PURP": {
"value": {
"businessPurpose": "Purpose of Passport"
}
},
"KYB_TYPE": {
"value": {
"businessType": "CORPORATION"
}
},
"KYB_FILES": {
"value": [
{
"byteSize": 54964,
"filename": "1724179911_File_Name.pdf",
"url": "https://..."
},
{
"byteSize": 1678,
"filename": "1724179911_FORM_FIELDS.json",
"url": "https://..."
}
]
},
"KYB_OWNERS": {
"value": {
"0181c46a-4127-4f26-86ba-6c18b56f4612": {
"attributes": {
"ADR": {
"value": "600 CALIFORNIA STREET SAN FRANCISCO CA 94109 US"
},
"DOB": {
"value": "1977-07-17"
},
"EM": {
"value": ""
},
"FN": {
"value": "Firstname"
},
"G": {
"value": "I1234562"
},
"GC": {
"value": "dl"
},
"GE": {
"value": "2029-08-20"
},
"GI": {
"value": "2023-08-20"
},
"GIS": {
"value": "CA"
},
"GP": {
"value": {
"backPhoto": null,
"frontPhoto": {
"byteSize": 305982,
"filename": "photo1.jpg",
"url": "https://..."
}
}
},
"LN": {
"value": "Lastname"
},
"MN": {
"value": "Middlename"
},
"SLF": {
"value": [
{
"byteSize": 553662,
"page": "left_photo",
"url": "https://..."
},
{
"byteSize": 512015,
"page": "center_photo",
"url": "https://..."
},
{
"byteSize": 550629,
"page": "right_photo",
"url": "https://..."
}
]
}
},
"type": "CONTROLLING"
}
}
},
"KYB_DATE": {
"value": {
"formationDate": "2022-02-04"
}
},
"KYB_JUR": {
"value": {
"formationJurisdiction": "Formation Jurisdiction"
}
},
"KYB_URL": {
"value": {
"website": "https://..."
}
},
"KYB_WALLET": {
"value": [
"0x123"
]
},
"KYB_TIN": {
"value": {
"identificationNumber": "0123456789",
"identificationNumberType": "TAX_IDENTIFICATION_NUMBER"
}
}
},
"type": "privacy.data"
}
}
In order to authenticate properly with this endpoint, you must first request a Privacy Access Token.
Privacy Access Tokens are one time use tokens. Attempting to reuse an access token will return a 401 Unauthorized
response.
Example With Access Token
const buffer = require('buffer');
const privateKeyDer = '...';
// You can find `getPrivateKeyFromDer` in "How to sign API"."Full Example" page
const privateKey = await getPrivateKeyFromDer(privateKeyDer);
const walletAddress = '...';
// You can find `makeRequest` in "How to sign API"."Full Example" page
const accessResponse = await makeRequest({
method: 'get',
privateKey: privateKey,
path: `/api/v1/privacy/access/${walletAddress}`
});
const { data: { authToken, accessToken } } = accessResponse;
const xAccessToken = Buffer
.from(`${authToken}:${accessToken}`)
.toString('base64');
const walletAddress = '...';
const json = await makeRequest({
method: 'get',
privateKey: privateKey,
queryString: 'scopes=FN,EM', // sparse scopes (optional)
path: `/api/v1/privacy/data/${walletAddress}`,
extraHeaders: {
'X-Access-Token': xAccessToken
}
});
console.log(json.data.attributes);
"""
NOTE: you can find make_request in the full example located in the
API Signed Requests documentation page
"""
import base64
import json
wallet_address = '...'
# You can find `make_request` in "How to sign API"."Full Example" page
access_response = make_request(f'/api/v1/privacy/access/{wallet_address}')
auth_token = access_response['data']['authToken']
access_token = access_response['data']['accessToken']
x_access_token = base64.b64encode(
f'{auth_token}:{access_token}'.encode('utf-8')
).decode('utf-8')
pii_response = make_request(
query_string='scopes=FN,EM', # sparse scopes (optional)
path=f'/api/v1/privacy/data/{wallet_address}',
extra_headers={
'X-Access-Token': x_access_token
}
)
print(json.dumps(pii_response, indent=2))
See How to sign API for message signing examples with more coverage and explanations.
Last updated