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
  • Signed URL for upload
  • Signed URL for Download
  • Code Example
  • Reference

Was this helpful?

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

Request Signed URL for Upload/Download Files

to generate signed URLs both for uploads and downloads

PreviousIssue & Transfer SRR (NFT)NextFile Information Metadata

Last updated 1 year ago

Was this helpful?

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

Please replace <base_url> as explained .

Precaution

File Size

Our system currently only support file sizes with a maximum limit of strictly less than 2GB, or in other words:

    filesize < 2^31 

This essentially implies that any user interaction with our API involving data transfer would necessitate adherence to this requirement. Manifestly, if a file size exceeds the defined threshold of 2GB, it may possibly impede the operation of the application.

File Name

File name

  1. should not contain space.

  2. should contain the file extension, including but not limited to .jpg, .png, .pdf, etc.

  3. use a unique name for each file. Filename is unique perissuer-address otherwise it will fail.

    This is to avoid modification of files that are already used in SRR. However given the upgrade to the IPFS protocol, there is no need to be concerned for the filename in terms of its look. The filename is not going to exist in the minted SRR since it is going to be converted to IPFS and the filename will be replaced with cid that is a function of the file's content and not file's name.

*In order to make the file names unique anyway, you can prefix/suffix the name with a unique number such as Date.now() .

**Given the underlying usage of IPFS, there is no need to be worried about duplicated contents. Since if two files with different name but same content will eventually be replaced with the same ipfs url.

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

action*

string (write and read)

Field to specify the action of the Signed URL. Value

write

to request upload signed URL, and

read

to request download signed URL.

payload*

array

Array of signed URL request.

payload[*].filename*

string

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 201 when the signed URL is created. The validity of the signed URL is 15 minutes after it is created.

The client’s back-end needs to consider its upload speed. If the files that need to be uploaded are many, client’s back-end may consider splitting the signed URL request to ensure that all of the files are uploaded.

Body Attribute
Description
Format

results

results of the request

Array

results[*].filename

Name of the file, same as one in the request

string

results[*].contentType

Content-Type that was chosen and set for the file. You need to set the same value in Content-Type header when uploading or downloading the file with the signed URL. Otherwise, you will get an error about signature mismatch.

string

results[*].url

string

results[*].finalUrl

The URL that client should save and use when calling issue endpoint. Check below for details

string

Usage of Final URL

category
Usage
example

artwork

On issue endpoint, use it for payload.attachmentFiles[*].url

certificate, installation, for_authenticity

On issue endpoint, use it for payload.attachmentFiles[*].url

non_attachment_file

use it for the field in metadata on the image, payload[*].metadata.thumbnailURL or payload[*].metadata.contractTerms.fileURL

{
  "results": [
    // Example result for non_attachment_file and artwork category
    {
      "filename": "artwork.jpg",
      "contentType": "image/jpeg",
      "url": "https://storage.googleapis.com/bucket/directory/luw-address/artwork.jpg?signature=xyz",
      "finalUrl": "https://static-files.startrail.io/directory/luw-address/artwork.jpg"
    },
    // Example for other categories
    {
      "filename": "certificate.jpg",
      "contentType": "image/jpeg",
      "url": "https://storage.googleapis.com/bucket/directory/luw-address/certificate.jpg?signature=xyz",
      "finalUrl": "https://storage.googleapis.com/bucket/directory/luw-address/certificate.jpg"
    }
  ]
}

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

// If the payload is incorrect
{
  "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 and also storage provider, currently it is Google Cloud Storage.

// If the network is error or unknown error. Startbahn side needs to check.
{
  "statusCode": 502,
  "message": "Bad Gateway"
}

Swagger Endpoint (Test Environment)

Required Permissions

Request Body Example

Signed URL for upload

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

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

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

Signed URL for Download

{
  "payload": [
    {
      "filename": "certificate.pdf",
      "category": "certificate"
    }
  ],
  "action": "read"
}

Code Example

Reference

The filename must meet the constraints mentioned .

Please refer to to understand the difference among the categories.

The signed URL that client can use to perform action such as upload or download. NOTE: This URL is only valid for 15 minutes and should not be saved. Please check the .

.

Check .

Check .

📬
here
Swagger to test
parent page
parent page
https://cloud.google.com/storage/docs/access-control/signed-urls
this page
reference below
https://static-files-stg.startrail.startbahn.jp/srr-images/0xf1B51E02804A7AF4Eb4c2f57dc9a05510A513C17/221208_royalty-01-001.jpg
https://storage.googleapis.com/artwork-staging-images/srr-images/luw-address-1/certificate.tif
https://storage.googleapis.com/artwork-staging-images/srr-images/0xf1B51E02804A7AF4Eb4c2f57dc9a05510A513C17/Contract_Terms_test.pdf
above