Startrail APIs
  • 🛫Startrail PORT: All in one document for API/SDK
    • 🔀URL per environment
  • Issue transfer api
    • 📬Issue & Transfer SRR (NFT)
      • Request Signed URL for Upload/Download Files
      • File Information Metadata
      • Issue & Transfer
      • Webhook Setup
    • 📂Collection
      • Create Collection
      • Get Collection of LUW
    • 📢Change Logs
      • v1.2.0
      • v1.1.0
      • v1.0.1
  • Metadata Schema
    • 🪅Startrail Registry (SRR)
      • Version 2.2
      • Version 2.1
      • Version 2.0
    • 📤Transfer
      • Version 1.2
      • Version 1.1
      • Version 1.0
    • ☸️Custom History
      • Custom History of Exhibition
        • Version 1.2
      • Custom History of Auction
        • Version 1.3
      • Custom History of Appraisal
        • Version 1.1
      • Custom History of Restoration
        • Version 1.0
      • Custom History of Offchain
        • Version 1.1
  • Get SRR API
    • Get Owned SRRs
    • Get SRR by Collection contract address and Token Id
      • 🚫Get SRR by Token Id
    • Description Of SRR Data
  • Ethereum Signature Validator API
    • 🔏Ethereum Signature Validator API
      • Change Logs
  • Startrail SDK Js
    • 🔰Introduction
    • 🏃Getting Started
      • RPC endpoint and chainId
    • 💳Wallet Methods
    • 🔮Startrail API Methods
      • Add Custom Histories To SRRs
      • Approve SRR By Commitment
      • Bulk
      • Check ERC2981 Royalty
      • Create Collection
      • Convert Metadata
      • Create SRR
      • Transfer Collection Ownership
      • Transfer SRR To Ethereum Address
      • Transfer From With Provenance
      • Update Metadata
    • 📱Login Providers
      • Interface
      • Whitelabeling/Customizing
        • Email Password
      • Hints
      • Multi Factor Account Management
    • 🦊MetaMask
    • 🎎Authentication Integration
    • 👾Errors
    • 📢Change logs
      • v1.35.0
      • v1.34.0
      • v1.33.2
      • v1.33.1
      • v1.32.0
      • v1.31.1
      • v1.30.6
      • v1.30.5
      • v1.30.4
      • v1.30.3
      • v1.30.2
      • v1.30.1
      • v1.30.0
      • v1.29.1
      • v1.29.0
      • v1.28.2
      • v1.28.1
      • v1.28.0
      • v1.27.1
      • v1.27.0
      • v1.26.0
      • v1.25.2(Security Patch)
  • Startrail API
    • 💱Transfer SRR Ownership By RevealHash
    • Get Transaction Data
    • Get Metadata By tokenid
  • Subgraph
    • 📊A introduction of subgraph
    • How to retrieve SRR metadata
Powered by GitBook

©2023 Startbahn, Inc.

On this page
  • Precaution
  • Swagger Endpoint (Test Environment)
  • Required Permissions
  • Request Body Example
  • Code Example

Was this helpful?

  1. Issue transfer api
  2. Issue & Transfer SRR (NFT)

File Information Metadata

to get file metadata

PreviousRequest Signed URL for Upload/Download FilesNextIssue & Transfer

Last updated 1 year ago

Was this helpful?

POST <base_url>/port/api/v1/commerce/fileMetadata

Please replace <base_url> as explained . Please note that file information metadata is different from SRR metadata.

Precaution

Multiple files

When requesting for multiple files:

If all files are found in our buckets and the requested is authorized for the access, the response is going to succeed and include the respective information per requested file. However in any other case the response status is not 200 and the return information will be only including inaccessible files that is <= the requested files.

Use case

If the file information metadata exists, it means the file is ready to be included in Issue & Transfer SRR call.

Headers

Name
Type
Description

commerce-api-key*

string

Commerce API Key

issuer-address*

string

Contract Address of API Key owner

Request Body

Name
Type
Description

payload*

array

Array of the request. Each element of the array corresponds to a file.

payload[*].filename*

string

Name of the file. Should contain file extensions (.jpg, .png, .pdf, etc).

Should not contain space. Use a unique name for each file.

If the filename is already used by the client, then it will fail when uploading. (unique for each LUW, but can be same for different LUW).

This is to avoid modification of files that are already used in SRR.

If the client needs to delete an existing file, please contact Startbahn.

payload[*].category*

string

Use non_attachment_file to upload thumbnails and contract terms.

The API responds with 200 if the check to the storage provider success. Bear in mind that client’s back end needs to check the results[*].message if there is a problem with each file.

Body Attribute
Description
Format

payload

Array of the results. The order of the array is same as the request.

array

payload[*].filename

The value will be same as parameter sent in request.

string

payload[*].hash

The value of calculated hash. If the hash still in calculation, file is not ready yet. If the file size is above 20 GB, you need to contact to Startbahn to calculate hash manually.

string

payload[*].cid

The value of IPFS CID v1. Like the hash, ones for very large files need to be contacted to Startbahn.

string

payload[*].size

The size in bytes.

number

payload[*].message

Exist if there is problem describing it.

string

// Example result
{
  "results": [
    // correct result
    {
      "filename": "test.jpg",
      "hash": "sha256-a63238ce3b8c4f8a99fb453d716d5451f75508c2e403a58af0412014187e7a61",
      "cid": "bafkreiehikh4kiuahuyqmxt3zy6pap7eouewmmpf4b5326qp3zqmjtzfy4"
      "size": 712
    },
    // if hash calculation is not yet finished
    {
      "filename": "hash-not-yet-calulated.jpg",
      "message": "HASH_STILL_IN_CALCULATION"
    }
  ]
}

The API responds with 400 if the request body is invalid.

// If payload is invalid
{
  "statusCode": 400,
  "message": [
    "payload.0.category must be one of the following values: certificate,for_authenticity,artwork,installation,non_attachment_file"
  ]
}

The API responds with 5xx if there is an issue between the network or storage provider, currently, it uses Google Cloud Storage.

// If the network is error or unknown error. Startbahn side need to check.
{
  "statusCode": 502,
  "message": "Bad Gateway"
}
// If one or more files are not found
{
  "statusCode": 404,
  "message": [
    {
      "index": 0,
      "filePath": "srr-images/0x0000000000000000000000000000000000000000/not-found.png"
    }
  ]   
}

Swagger Endpoint (Test Environment)

Required Permissions

Request Body Example

// Example for thumbnail
{
  "payload": [
    {
      "filename": "thumbnail.jpg",
      "category": "non_attachment_file"
    }
  ]
}

// Example for contract terms
{
  "payload": [
    {
      "filename": "contract.pdf",
      "category": "non_attachment_file"
    }
  ]
}

// Example for other categories
{
  "payload": [
    {
      "filename": "certificate.pdf",
      "category": "certificate"
    }
  ]
}

Code Example

Please refer to to understand the difference among the categories.

Check the .

Check .

📬
here
Swagger to test
parent page
parent page
this page