nChain Event
Back to All
V.1.3.1
V.1.3.1
  • nChain Event User Guide
  • Overview
    • Introduction
      • Target Audience
    • Features and Benefits
      • Independent Operations
      • Web3 Development
    • Core Concepts
    • Encoded and Unencoded Records
  • Using 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
    • API Workflow
      • Write Record
      • Get Location Status
      • Read Record
      • Verify Record
  • Linked Records
    • Introduction
      • Concept - Link Locations
    • Functional Description
      • Create Link Record
      • Read Link Record
      • Update Link Record
      • Delete Link Record
      • Verify Link Record
    • Use Cases
      • Luxury Handbag Provenance
    • Tutorials
      • Collection Integrity
      • Provenance Integrity
    • API Workflow
      • Create Link Record
      • Get Link Location Status
      • Read Link Record
      • Update Link Record
      • Delete Link Record
      • Verify Link Record
  • API Documentation
    • nChain Event API
  • Bitcoin SV Blockchain
    • Features and Benefits
    • Writing to Blockchain
    • Reading from Blockchain
    • Transaction Format
    • Troubleshooting
    • Glossary
Powered by GitBook
On this page
  • Read Encoded Link
  • Read Unencoded Link
  1. Linked Records
  2. API Workflow

Read Link Record

PreviousGet Link Location StatusNextUpdate Link Record

  • The location owner optionally publishes the link location

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

  • They can use any industry-standard tool

Example headers code:

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

Example record code:

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

Read Encoded Link

Example cURL headers response:

content-length: 44
content-type: text/plain; nchain-event-encoded=Sha256v2|Base64
date: Tue,02 Jan 2024 14:15:41 GMT
server: nginx/1.18.0 (Ubuntu)

Example cURL record response:

ytfc5c5wv0V7hOo....G1ucRFzSIe6rw=

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

Read Unencoded Link

Example cURL headers response:

content-length: 6
content-type: application/octet-stream
date: Tue,02 Jan 2024 14:18:52 GMT
server: nginx/1.18.0 (Ubuntu)

Example cURL record response:

hello