CodeVASPCodeVASP
Travel RuleAPI Reference03-Request-API

02-Public-Key-Search

You can use this API to query the Public Key of a specific VASP. While the results from 'VASP List Search' may include some cached data, this API retrieves current data.

For example, when you receive 422 INVALID_RECEIVER_PUBLIC_KEY error, you can call this API to check if the Public Key has been changed.

❗️This API works in a synchronous manner, providing an immediate response upon request.

Endpoint

GET /v1/code/Vasp/{VaspEntityId}/pubkey

Request Parameters

Headers

NameTypeRequiredDescription
X-Code-Req-DatetimestringRequiredISO8601 UTC datetime
X-Code-Req-NoncestringRequiredRandom nonce
X-Code-Req-PubKeystringRequiredYour Public Key
X-Code-Req-SignaturestringRequiredSignature
X-Request-OriginstringRequiredcode:{yourVaspEntityId}
acceptstringOptionalapplication/json

Path Parameters

NameTypeRequiredDescription
VaspEntityIdstringRequiredThe VaspEntityId of the VASP to query.

Response

Fields

NameTypeDescription
pubkeysarrayAn array of pubkey objects registered to VASP. Each object consists of pubkey and ExpiresAt fields.

pubkey object fields:

NameTypeDescription
pubkeystringbase64-encoded pubkey
expiresAtstringISO 8601 UTC expiration time

Examples

Request

curl --request GET \
     --url https://trapi-dev.codevasp.com/v1/code/Vasp/codexchange/pubkey \
     --header 'X-Code-Req-Datetime: 2024-03-04T15:10Z' \
     --header 'X-Code-Req-Nonce: 989166249' \
     --header 'X-Code-Req-PubKey: YourPubkey' \
     --header 'X-Code-Req-Signature: Signature' \
     --header 'X-Request-Origin: code:yourVaspEntityId' \
     --header 'accept: application/json'

Response

{
  "pubkeys": [
    {
      "pubkey": "base64 encoded ascii",
      "expiresAt": "2022-06-31T23:59:59Z"
    }
  ]
}

On this page