ZELF
Zelf Documentation
Zelf Documentation
  • Welcome
  • Getting Started
    • How it works
    • WhitePaper
    • Zelf Proofs vs Others
    • Privacy Preserving
    • Use cases
    • Downloads
  • Functions
    • Authentication
    • Create a ZelfProof
    • Decrypt a ZelfProof
    • Preview ZelfProof
  • Zelf Name Service
    • Offline Version
      • Decryption
    • Online Version
      • Retrieve public key
      • Create a session
      • PGP Encryption
      • Lease a Zelf Name
      • Preview a ZelfName
      • Decrypt a ZelfName
    • Arweave ZNS Storage
    • Zelf Wallet Design
  • BlockChains
    • MINA
      • Get Balance
      • Get Token
      • Get Transactions
    • ETH
      • Adress Lookup
      • Transactions list
      • Transaction details
      • Gas Tracker
  • Integrations
  • Zelf Legal
    • Team Members
    • Terms of Use
    • Privacy Policy
  • Airdrop
    • Airdrop Rules
    • Reglas de Airdrop
    • Pricing per Domain
  • Verify our Partners
    • Acquisition Team
  • Roadmap
    • Q1 2025
    • Q2 2025
    • Q3 2025
    • Q4 2025
Powered by GitBook
On this page
  • Endpoint: Get Public Key
  • Request
  • Response
  • Why is it needed?

Was this helpful?

  1. Zelf Name Service
  2. Online Version

Retrieve public key

Endpoint: Get Public Key

GET /api/sessions/yek-cilbup

This endpoint retrieves the public key associated with a specified identifier.

Request

  • Endpoint: /api/sessions/yek-cilbup

  • Method: GET

  • Content-Type: application/json

  • Query Parameters:

    • identifier: string (Required) - The unique identifier associated with the session or entity for which the public key is being requested.

Example Request

GET /api/sessions/yek-cilbup?identifier=your_unique_device_identifier

Response

  • 200 OK: The request was successful, and the public key is returned in the response body.

    • Response Body:

      {
        "data": "-----BEGIN PGP PUBLIC KEY BLOCK-----\n\n<base64-encoded public key>\n-----END PGP PUBLIC KEY BLOCK-----"
      }
  • Headers: The request does not require any specific headers, but it may include standard headers like Authorization if the API is secured.

Request

const axios = require('axios');

let config = {
  method: 'get',
  url: 'https://api.zelf.world/api/sessions/yek-cilbup?identifier=AGED',
  headers: { }
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

Response

{
  "data": "-----BEGIN PGP PUBLIC KEY BLOCK-----\n\n<base64-encoded public key>\n-----END PGP PUBLIC KEY BLOCK-----"
}

data: string - Contains the public key in PGP format, which can be used for encrypting data or verifying signatures associated with the identifier.

Error Handling

  • 400 Bad Request: Returned if the identifier parameter is missing or invalid.

  • 404 Not Found: Returned if no public key is found for the given identifier.

  • 500 Internal Server Error: Returned if there is an issue on the server side processing the request.

Why is it needed?

  • Data Encryption: The retrieved public key can be used to encrypt data that can only be decrypted by the corresponding private key holder.

  • Signature Verification: The public key can be used to verify signatures made by the corresponding private key, ensuring the authenticity and integrity of the data.

PreviousOnline VersionNextCreate a session

Last updated 6 months ago

Was this helpful?