nChain Event
Back to All
V.1.4.3
V.1.4.3
  • nChain Event User Guide
  • πŸ“”Overview
    • Introduction
    • Configuration Symbols
    • Features and Benefits
    • Core Concepts
    • Encoded and Unencoded ‑ Records
  • πŸ€”Using nChain Event
    • How to Use nChain Event
    • Initial Set-Up
  • πŸ”Independent Records
    • Introduction
    • Functional Description
      • Write Record
      • Read Record
      • Verify Record †
    • Use Cases
      • Lucky Number Tickets
      • Internet of Things (IoT) Data
      • Intellectual Property Rights (IPR) Evidence
      • Car Dealership
    • Tutorials
      • Data Integrity
      • Blockchain Unique Identifiers
    • API Workflow
      • Configure API
      • Write Record
      • Get Location Status
      • Read Record
      • Verify Record †
  • πŸ”—Linked Records Β§
    • Introduction
    • Functional Description
      • Create Link Record Β§
      • Read Link Record Β§
      • Update Link Record Β§
      • Delete Link Record Β§
      • Verify Link Record Β§ †
      • Navigate Linked Record Β§ ΒΆ
    • Use Cases
      • Luxury Handbag Provenance
      • Random Prize Draw
    • Tutorials
      • Collection Integrity
      • Provenance Integrity
    • API Workflow
      • Configure API
      • Create Link Record Β§
      • Get Link Location Status Β§
      • Read Link Record Β§
      • Update Link Record Β§
      • Delete Link Record Β§
      • Verify Link Record Β§ †
      • Navigate Link Record Β§ ΒΆ
  • βš™οΈAPI Documentation
    • nChain Event API
  • ⛓️Bitcoin SV Blockchain
    • Features and Benefits
    • Writing to Blockchain
    • Reading from Blockchain
    • Transaction Format
  • ⁉️Troubleshooting
    • Troubleshooting
    • Error Codes
    • Glossary
    • Contact Us
Powered by GitBook
On this page
  • Read Encoded Record
  • Read Unencoded Record ‑
  1. Independent Records
  2. API Workflow

Read Record

PreviousGet Location StatusNextVerify Record †

  1. The location owner optionally publishes the location

  2. Anyone who has the location can read just the headers or the full record

  3. They can use any industry-standard third-party tools

Example headers code:

curl --head $URL/api/v1/records/$LOC/content \
     -H "x-api-key: $KEY" \
     -H "accept: */*"
const response = await fetch('${url}/api/v1/records/${loc}/content', {
  method: 'HEAD',
  headers: {
    'x-api-key': '$KEY',
    'accept': '*/*'
  }
});

Example record code:

curl $URL/api/v1/records/$LOC/content \
     -H "x-api-key: $KEY" \
     -H "accept: text/plain"
const response = await fetch('${url}/api/v1/records/${loc}/content', {
  headers: {
    'x-api-key': '${key}',
    'accept': 'text/plain'
  }
});

Read Encoded Record

Example cURL headers response:

content-length: 32
content-type: application/nce-fingerprint-sha256v2|Base64
date: Tue,02 Jan 2024 13:14:27 GMT
server: nginx/1.18.0 (Ubuntu) 

Example cURL record response:

ytfc5c5wv0V7hOo....G1ucRFzSIe6rw=

You can compare this to the final "output" in the response from the write record command.

To find out whether the resultant fingerprint is valid, the user also needs the original record and the encoding method plus any salt used.

Example cURL headers response:

content-length: 7  
content-type: application/octet-stream  
date: Tue,02 Jan 2024 13:15:31 GMT  
server: Kestrel 

Example cURL record response:

hello 

Read Unencoded Record

πŸ”
‑