Quadrata Integration
  • INTRODUCTION
    • Introduction to Quadrata
    • Passport Attributes
  • HOW TO INTEGRATE
    • Quadrata SDK
      • Get Started Quickly
      • Advanced
        • Installation
        • SDK Configuration
        • Onboarding Example
        • Client Libraries
          • Client Configuration
          • Client Lazy Loading
          • Client Eager Loading
          • Client Helper Component
          • Client React Hooks
            • useOnboardStatus
          • Client Examples
            • With Wagmi Connect
            • KYC Only
            • KYB Only
            • All In One
        • API Libraries
          • API Configuration
          • API Service Options
          • API Service Libraries
            • Create Access Token
            • Create Privacy Access Token
            • Fetch Attribute Values
            • Fetch Onboard Status
            • Fetch Passport List
            • Fetch Privacy Data
            • Fetch Privacy Grants
            • Fetch Wallet Screening
            • Revoke Privacy Grants
    • Onboard users
      • Individual Passport Onboarding
        • 1. Installation
        • 2. API Authentication
        • 3. API Onboard Status
        • 4. QuadClient Package
        • 5. Privacy Data Permissions
        • 6. Full Example
      • Business Passport Onboarding
        • 1. Installation
        • 2. API Authentication
        • 3. QuadrataKyb Package
        • 4. Privacy Data Permissions
        • 5. Full Example
      • All-In-One Passport Onboarding
        • 1. Installation
        • 2. API Authentication
        • 3. QuadrataReact Package
        • 4. Full Example
    • Request Privacy Data
      • List of Privacy Data
      • Privacy Data Permissions
      • API Requests
        • How to sign API
          • Full Example
          • Generate ECDSA Key Pair
        • API Get Privacy Permissions
        • API Privacy Access Token
        • API Get Privacy Data
        • API Revoke Permissions
    • Query attributes
      • Via Smart Contract
        • Query a single attribute
        • Query multiple attributes
        • Query Helper
      • Via API
    • On-Chain Wallet Screening
      • How to sign API
        • Full Example
        • Generate ECDSA Key Pair
      • API Get On-Chain AML Score
    • Webhooks
      • Onboarding Webhooks
      • Ongoing Monitoring Webhooks
      • Webhook Request Signature
    • Burn Passports
  • additional information
    • Smart contracts
    • Quadrata Sandbox
    • Passport Issuers
    • Privileged Roles & Ownership
    • Constants
    • Flex Kit Attributes
      • Smart Contract Addresses
Powered by GitBook
On this page
  • API endpoint to get PII data that has been granted to your dApp
  • Example With Access Token
  1. HOW TO INTEGRATE
  2. Request Privacy Data
  3. API Requests

API Get Privacy Data

Server-Side API endpoint to fetch Privacy Data

PreviousAPI Privacy Access TokenNextAPI Revoke Permissions

Last updated 8 months ago

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 , 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

Name
Type
Description

account*

User's wallet address

Query Parameters

Name
Type
Description

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

Name
Type
Description

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"
  }
}

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))

Signature

In order to authenticate properly with this endpoint, you must first request a .

See for message signing examples with more coverage and explanations.

Quadrata SDK
Privacy Access Token
How to sign API
Get Privacy Access Token
API Signed Request