API Privacy Access Token
Server-Side API endpoint to fetch a privacy access token that grants your dApp access to fetch Privacy Data.
API endpoint to get a privacy access token
GET https://int.quadrata.com/api/v1/privacy/access/${account}
Path Parameters
Name
Type
Description
account*
String
User's wallet address
Headers
Name
Type
Description
Authorization*
String
Basic ${base64(apiKey)}
Date*
String
Date and time of current request
Wed, 04 Oct 2023 02:39:37 GMT
{
  "data": {
    "authToken": "...",
    "accessToken": "...",
    "type": "privacy.grants"
  }
}This endpoint will return an auth token and an access token. Your dApp needs to combine them into one encoded string, delimited by a : and base64 encoded, in order to use it as an X-Access-Token header to fetch PII data.
Privacy Access Tokens are one time use tokens. If you attempt to reuse an access token, you will receive a 401 Unauthorized error.
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 json = await makeRequest({
    method: 'get',
    privateKey: privateKey,
    path: `/api/v1/privacy/access/${walletAddress}`
});
const { data: { authToken, accessToken } } = json;
const xAccessToken = Buffer
    .from(`${authToken}:${accessToken}`)
    .toString('base64');"""
NOTE: you can find make_request in the full example located in the 
      API Signed Requests documentation page
"""
import base64
wallet_address = '...'
# You can find `make_request` in "How to sign API"."Full Example" page
json = make_request(f'/api/v1/privacy/access/{wallet_address}')
auth_token = json['data']['authToken']
access_token = json['data']['accessToken']
x_access_token = base64.b64encode(
    f'{auth_token}:{access_token}'.encode('utf-8')
).decode('utf-8')
Last updated
