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
  1. Linked Records §
  2. API Workflow

Navigate Link Record § ¶

PreviousVerify Link Record § †NextFeatures and Benefits

Last updated 6 months ago

  1. Anyone with a link location and access to nChain Event can obtain either earlier or later link locations

  2. Specify the link location to navigate from - this can be any link location in the set of linked records

  3. Specify the maximum number of links you want in the "links" parameter, from 1 to a manageable number - if the number of links is too large, you may experience inconvenient timeouts

  4. Specify a negative value for earlier link locations

  5. Specify a positive value for later link locations

  6. The response indicates whether there are any link locations availble at all

  7. And whether the beginning or the end of the linked records has been reached

  8. Use Read Link Record to read the content of the resultant link locations

Example code:

curl -X GET "$URL/api/v1/linkedrecords/$LOC/navigate?links=9" \
     -H "x-api-key: $KEY" \
     -H "accept: text/plain"
const response = await fetch('${url}/api/v1/linkedrecords/${loc1}/navigate?links=9', {
  method: 'GET',
  headers: {
    'x-api-key': '${key}',
    'accept': 'text/plain'
  }
});

Example Responses

Example cURL response with later link locations:

{
  "txIds": [
    "9004f5621798965cf082ce....2222222222222222222222",
    "d205c1bcb4e796a70f70b1....3333333333333333333333"
  ],
  "endOfLinks": true
}

In this example, there are 2 later links than the supplied link, and the second one is the last in the linked records, so endOfLinks has been reached, as indicated by "true".

If the navigation had been 9 link locations forward from the last location ("d205c1bcb4e796a70f70b1...." in the list above), the result would have been:

Example cURL response with no link locations:

{
  "txIds": [
  ],
  "endOfLinks": true
}

If the navigation had been 9 link locations backwards from the last location, assuming that there are only 3 link locations in the set, the result would have been:

Example cURL response with earlier link locations:

{
  "txIds": [
    "d205c1bcb4e796a70f70b1....3333333333333333333333",
    "9004f5621798965cf082ce....2222222222222222222222",
    "29d728ba82160c1b327abe....1111111111111111111111"
  ],
  "endOfLinks": true
}

🔗