File Information Metadata

to get file metadata

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

Please replace <base_url> as explained here. 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

NameTypeDescription

commerce-api-key*

string

Commerce API Key

issuer-address*

string

Contract Address of API Key owner

Request Body

NameTypeDescription

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

Please refer to this page to understand the difference among the categories.

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 AttributeDescriptionFormat

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

Swagger Endpoint (Test Environment)

Swagger to test

Required Permissions

Check the parent page.

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

Check parent page.

Last updated

©2023 Startbahn, Inc.