Skip to main content
European CommissionEBSI European Blockchain

Track and Trace API

OpenAPI documentation

tnt get <url>

Command to make HTTP GET calls to the Track and Trace API. All endpoints are open to the public.

Parameters:

  • url: Path to get.

Examples:

tnt get /documents
tnt get /documents/0x12ab...
tnt head /accesses?creator=did:ebsi:zkqR9GCLrLYbkubAjuqQZAz

tnt head <url>

Command to make HTTP HEAD calls to the Track and Trace API. It is used to check if a DID is authorised to create documents.

Parameters:

  • url: Path for head.

Example:

tnt head /accesses?creator=did:ebsi:zkqR9GCLrLYbkubAjuqQZAz

Response:

  • Status 204: DID is authorised to create documents (empty body)
  • Status 404: DID is not authorised to create documents

tnt authoriseDid <senderDid> <authorisedDid> <whiteList>

Command to authorise a new DID to create documents in Track and Trace. This operation is restricted to Support Office and other admins in the allowlist. This operation requires an access token with tnt_authorise scope.

Parameters:

  • senderDid: DID of the authoriser.
  • authorisedDid: DID of the new entity to be registered.
  • whiteList: Boolean defining if the entity is authorised or not.

Example:

tnt authoriseDid did:ebsi:zkqR9GCLrLYbkubAjuqQZAz did:ebsi:znbuGDt6tEqpGZNAuGc2uvZ true
note

For a complete tutorial on how to authorise new entities to create documents, see Authorise Document Creator in Track and Trace.

tnt createDocument <documentHash> <documentMetadata> <creator> <timestamp> <timestampProof>

Command to create a new document in Track and Trace. This operation requires an access token with tnt_create scope.

Parameters:

  • documentHash: Document hash.
  • documentMetadata: Document metadata.
  • creator: DID of the creator.
  • timestamp (optional): External timestamp. By default it uses the timestamp from the blockchain
  • timestampProof (optional): Proof for the external timestamp. By default it uses the block number from the blockchain.

Examples:

tnt createDocument 0x29210da926cbf151a09e1c4f8eb9e5c55836016260f5cfa1e2c8c184c6e1943c my-metadata did:ebsi:zkqR9GCLrLYbkubAjuqQZAz
tnt createDocument 0x29210da926cbf151a09e1c4f8eb9e5c55836016260f5cfa1e2c8c184c6e1943c my-metadata did:ebsi:zkqR9GCLrLYbkubAjuqQZAz 2024-01-01 0xae3e3d2c20698c1ebf7888b3c965cf1f30834307b7396b966c9abc11996e13ef

tnt removeDocument <documentHash>

Command to remove a document from Track and Trace. This operation must be done by the creator of the document and requires an access token with tnt_write scope.

Parameters:

  • documentHash: Document hash.

Example:

tnt removeDocument 0x29210da926cbf151a09e1c4f8eb9e5c55836016260f5cfa1e2c8c184c6e1943c

tnt grantAccess <documentHash> <grantedBy> subject> <permission>

Command to grant write or delegate access to other DIDs. This operation requires an access token with tnt_write scope. The "delegate" permission can be granted only by the creator of the document. And the "write" permission can be granted by the creator or by accounts with "delegate" permission.

Parameters:

  • documentHash: Document hash.
  • grantedBy: DID that grants the permission.
  • subject: DID that receives the permission.
  • permission: It should be "write" (to write events) or "delegate" (to be able to grant write access to other DIDs)

Examples:

tnt grantAccess 0x29210da926cbf151a09e1c4f8eb9e5c55836016260f5cfa1e2c8c184c6e1943c did:ebsi:zkqR9GCLrLYbkubAjuqQZAz did:ebsi:znbuGDt6tEqpGZNAuGc2uvZ write
tnt grantAccess 0x29210da926cbf151a09e1c4f8eb9e5c55836016260f5cfa1e2c8c184c6e1943c did:ebsi:zkqR9GCLrLYbkubAjuqQZAz did:key:z2dmzD81cgPx8Vki7JbuuMmFYrWPgYoytykUZ3eyqht1j9KbqS4dNpBRgwn9zaxGz7jY78W4oFkooFwjY1pCFKhUD1xHzawy4g5H2665VZ3onWGWu1xD6MjGR72EP3WrQkSWXgu2ZfGjGngQuefxpMqrYPGX5U8eFHxj6baBE3neZLqyrL delegate

tnt revokeAccess <documentHash> <revokedBy> subject> <permission>

Command to revoke access to an account for a particular document. The revocation must be done by the account granted it in the first place or by the creator of the document. This operation requires an access token with tnt_write scope.

Parameters:

  • documentHash: Document hash.
  • revokedBy: DID that grants the permission.
  • subject: DID that receives the permission.
  • permission: It should be "write" (to write events) or "delegate" (to be able to grant write access to other DIDs)

Example:

tnt revokeAccess 0x29210da926cbf151a09e1c4f8eb9e5c55836016260f5cfa1e2c8c184c6e1943c did:ebsi:zkqR9GCLrLYbkubAjuqQZAz did:ebsi:znbuGDt6tEqpGZNAuGc2uvZ write

tnt writeEvent <documentHash> <externalHash> <sender> <origin> <metadata> <timestamp> <timestampProof>

Command to write an event in a document. The sender must have the "write" permission and requires an access token with tnt_write scope.

Parameters:

  • documentHash: Document hash.
  • externalHash: External hash.
  • sender: DID submitting the event.
  • origin: company name or point to other event.
  • metadata: Event metadata.
  • timestamp (optional): External timestamp. By default it uses the timestamp from the blockchain
  • timestampProof (optional): Proof for the external timestamp. By default it uses the block number from the blockchain.

Examples:

tnt writeEvent 0x29210da926cbf151a09e1c4f8eb9e5c55836016260f5cfa1e2c8c184c6e1943c 0x9265031a923088137405ffc270a56bf2d4df87495eada46257352356071b009e did:ebsi:zkqR9GCLrLYbkubAjuqQZAz my-origin my-metadata
tnt writeEvent 0x29210da926cbf151a09e1c4f8eb9e5c55836016260f5cfa1e2c8c184c6e1943c 0x9265031a923088137405ffc270a56bf2d4df87495eada46257352356071b009e did:ebsi:zkqR9GCLrLYbkubAjuqQZAz my-origin my-metadata 2024-01-0