Spydra Docs
For Developers
Spydra Platform
Spydra Platform
  • GETTING STARTED
    • Introduction
    • Why Spydra?
    • Blockchain fundamentals
      • Why Blockchain?
      • Private Blockchain
      • Public Chain
    • ๐ŸŽงGetting started with a Private Network
      • Creating an account
      • Creating an organization
      • Creating a Network
      • Apps
    • ๐Ÿ”ŠGetting started with a Token Store on Public Chain
      • Token store
      • Customise token store front
      • List a real world asset and issue tokens
      • Manage token lifecycle
    • Intro to Hyperledger Fabric
  • Products Overview
    • ๐ŸŽงPrivate Network
      • Organizations
        • Users and Organizations
        • Organisation Hosting - Spydra Hosted and BYOC
        • Organization Statuses
        • Organization Roles & Permissions
        • Organization Dashboard
        • Organization Entities
      • Networks
        • Network Statuses
        • Network Roles & Permissions
        • Network Configurations
        • Mandatory Card Addition
        • Nodes: Peer, Orderer & CA
        • Network Hosting Type
        • Network Dashboard
        • Network Operations
        • Nodes
      • Channels
      • Apps
        • Pre-Configured Apps
        • Custom Apps
      • Asset Tokenization
        • Use cases
        • Asset types
        • References
        • Asset Owners
        • Permissions
      • Tokens & Vault
      • Listeners
        • Network Listeners
        • App Listeners
        • Token Listeners
      • Workflow Builder
      • Oracles
      • GraphQL
      • Block Explorer
      • IPFS
      • Fabric Debug Plugin
    • ๐Ÿ”ŠPublic Chain
      • Token Store
      • Tokenize Real World Assets
      • Tokenomics: Token & Token Sale
      • Trade & Payout
  • How to
    • ๐ŸŽงPrivate Network
      • Account
        • Create an Account
        • Edit Profile details
        • Update email & Password
        • Forgot password
        • Google OAuth Signup - Update Email & Password
        • Deactivating or deleting your account?
      • Organizations
        • Create an Organization
        • Create & Manage BYOC Hosting
        • Invite members to an organisation
        • Edit Organization details
        • Manage Org members
        • Leave an Organization
        • Update Organization member roles
        • Pay Organisation Invoice
        • Update Billing Address
        • View Invoices
        • Organization Dashboard
        • Delete an Organisation
      • Networks
        • Create a Network
        • Advance Settings: Key Vault Store
        • View and edit Network details
          • Update Permissions for Network Members
          • Update Network Configuration
          • Update Key Vault
          • Manage API Keys
          • Delete a network
        • Inviting an organisation to a Network
        • Network Roles & Permissions
        • Joining a Network
        • Network Dashboard
      • Apps
        • Explore Apps
        • Deploy App
          • Deploying Asset Tokenization App
        • Manage Apps
        • Application Dashboard
      • Channels
        • Creating a Channel
        • Create a Consensus Policy
        • Update Channel
        • Channel Members
        • Delete channel
      • Nodes
        • Create Node
        • Node Dashboard
        • Delete Node
      • Pre-configured Apps
        • Deploy Asset Tokenization App
        • Asset Data
      • Custom Apps
        • Deploy Custom Chaincode
        • Chaincode as external service
        • Supported File Formats - ZIP format
        • Building in Binary format
          • Golang - Binary Format
          • Java Jar files
        • Chaincode Logs
      • Workflow
        • Triggers
        • Condition
        • Read
        • Actions
        • End
        • Variables & Identifiers
        • Calculations & Formulas
      • Oracles
        • Create an Oracle
        • Oracle with Asset tokenisation
        • Oracle with Custom Chaincode
      • Listeners
        • Create a Listener
        • Manage Listeners
    • ๐Ÿ”ŠPublic Chain
      • Account
        • Create an Account
        • Edit Profile details
        • Update email & Password
        • Forgot password
        • Google OAuth Signup - Update Email & Password
        • Deactivating or deleting your account?
      • Token Store
        • Create a Token Store
        • Design Store Front
        • Custom Domain Hosting
        • Google Analytics Integration
        • Create & Manage Store Users
          • Store User KYC
        • Accreditation Management
        • Store Payments
        • Token Store Customers
      • Tokenise a Real World Asset
        • Real Estate
        • Other Asset Categories
      • Create a token
        • Define your token
        • Investor & Buyback Settings
        • Configure token returns & payouts
        • Create token sale
      • Additional Configurations
        • Create a Document Workflow
      • Publish Asset
      • Tokenise on TestNet
        • Polygon Amoy
      • Manage Token lifecycle
        • Returns & Payouts
          • Initiate an equity payout
          • Authorise Debt Payouts
          • View all payouts
        • View token investors
        • View token transactions
        • View signed documents
        • View/ Create a token sale
        • Post Token Updates
        • Update Price
        • Buyback Requests
  • Billing & Pricing
    • Pricing
    • Billing
      • Opt-in Billing
      • Opt-out Billing
    • Adding a Card & Autopay
    • Invoice Payments
    • Billing forecast
    • Unpaid Invoices
    • Credits
  • Developers
    • API Reference
      • Asset Tokenization
        • REST API
        • Testing REST API
        • GraphQL
          • Quickstart
          • Simple queries
          • Nested object queries
          • Complex queries
          • Aggregate queries
          • Operators
          • Built-in attributes
          • Pagination
      • Custom Chaincode
        • REST API
        • Testing REST API
        • GraphQL
          • Quickstart
          • Simple queries
          • Complex queries
          • Operators
          • Pagination
      • Token Store (Public Chain)
        • Token Issuer
        • Investor
      • IPFS
    • Developer Tools
      • Monitoring [Coming Soon]
    • API Key
  • Support
    • FAQs
    • My account is banned [D]
    • Why is it recommended to have an Odd number of Orderer nodes on a Network?
    • Support
  • Others
    • Glossary
  • Policies
    • Terms & Conditions
    • Privacy Policies
    • Open Spydra
Powered by GitBook
On this page

Was this helpful?

  1. Developers
  2. API Reference

IPFS

PreviousInvestorNextDeveloper Tools

Last updated 1 year ago

Was this helpful?

You can access the Rest API through the Swagger UI from the App API section. Navigate to Network -> Deployed Apps -> App -> IPFS API

base url: 

https://<membership_id>.ipfs-<region>.spydra.app

Get the base URL from Network -> Deployed Apps -> App -> IPFS API page.
Select your organization at the top right of this page.

post

Uploads a file to IPFS using the given URL, with a maximum accepted size of 512MB. By default wrap-with-directory it is set to true. It is necessary to be able to persist file name in ipfs

Authorizations
Query parameters
urlstringRequired

File's URL

quietbooleanOptional

Write minimal output

quieterbooleanOptional

Write only final hash

silentbooleanOptional

Write no output

progressbooleanOptional

Stream progress data

tricklebooleanOptional

Use trickle-dag format for dag generation

only-hashbooleanOptional

Only chunk and hash - do not write to disk

wrap-with-directorybooleanOptional

Wrap files with a directory object

chunkerstringOptional

Chunking algorithm, size-[bytes], rabin-[min]-[avg]-[max] or buzhash. Default value is size-262144

raw-leavesbooleanOptional

Use raw blocks for leaf nodes

nocopybooleanOptional

Add the file using filestore. Implies raw-leaves

fscachebooleanOptional

Check the filestore for pre-existing blocks

cid-versionnumberOptional

CID version. Defaults to 0 unless an option that depends on CIDv1 is passed. Passing version 1 will cause the raw-leaves option to default to true

hashstringOptional

Hash function to use. Implies CIDv1 if not sha2-256. Default value is sha2-256

inlinebooleanOptional

Inline small blocks into CIDs

inline-limitbooleanOptional

Maximum block size to inline. Default value is 32

pinbooleanOptional

Pin locally to protect added files from garbage collection. Default value is true

to-filesstringOptional

Add reference to Files API (MFS) at the provided path

Responses
200
File uploaded
application/json
400
Bad request
application/json
500
General server error
application/json
post
POST /ipfs/addByUrl?url=text HTTP/1.1
Host: <networkorgid>.ipfs-<region>.<publicdomain>
X-API-KEY: YOUR_API_KEY
Accept: */*
{
  "Bytes": 2454,
  "Hash": "QmSMPFa2op3HqGv7bbpm1GkzPnuHP9cx2rQXiqN1",
  "Name": "test",
  "Size": 1049
}
post

List directory contents for Unix filesystem objects

Authorizations
Query parameters
argstringRequired

The path to the IPFS object(s) to list links from

headersbooleanOptional

Print table headers (Hash, Size, Name)

resolve-typebooleanOptional

Resolve linked objects to find out their types. Default value is true

sizebooleanOptional

Resolve linked objects to find out their file size. Default value is true

streambooleanOptional

Enable experimental streaming of directory entries as they are traversed

Responses
200
List directory contents
application/json
500
General server error
application/json
post
POST /ipfs/ls?arg=text HTTP/1.1
Host: <networkorgid>.ipfs-<region>.<publicdomain>
X-API-KEY: YOUR_API_KEY
Accept: */*
{
  "Objects": [
    {
      "Hash": "QmPJwu6iYBmj4eferq3UJK3uEEii2gKk",
      "Links": [
        {
          "Hash": "QmPJwu6iYBmj4eferq3UJK3uEEii2gKk",
          "Name": "test",
          "Size": 1049,
          "Target": "",
          "Type": 2
        }
      ]
    }
  ]
}
post

Show IPFS object data

Authorizations
Query parameters
argstringRequired

The path to the IPFS object(s) to be outputted

gcbooleanOptional

Overrides garbage collection when retrieving files. By default, when retrieving files, garbage collection is triggered to prevent non-pinned files from being cached or stored in the retrieving node to reduce storage requirements

offsetnumberOptional

Byte offset to begin reading from

lengthnumberOptional

Maximum number of bytes to read

progressbooleanOptional

Stream progress data. Default value is true

Responses
200
File data
500
General server error
application/json
post
POST /ipfs/cat?arg=text HTTP/1.1
Host: <networkorgid>.ipfs-<region>.<publicdomain>
X-API-KEY: YOUR_API_KEY
Accept: */*

No content

post

Pin objects to local storage

Authorizations
Query parameters
argstringRequired

Path to object(s) to be pinned

recursivebooleanOptional

Recursively pin the object linked to by the specified object(s). Default value is true

progressbooleanOptional

Show progress

Responses
200
Newly added pins list
application/json
500
General server error
application/json
post
POST /ipfs/pin/add?arg=text HTTP/1.1
Host: <networkorgid>.ipfs-<region>.<publicdomain>
X-API-KEY: YOUR_API_KEY
Accept: */*
{
  "Pins": [
    "text"
  ],
  "Progress": 1
}
post

Remove object from pin-list. By default garbage collection is called after pin is removed

Authorizations
Query parameters
argstringRequired

Path to object(s) to be unpinned

gcbooleanOptional

Allows you to override the default behaviour of garbage collection when removing a pin. By default, after removing a pin using the pin/rm API, the garbage collection process is automatically triggered. However, it is important to note that using the gc parameter is discouraged for regular usage

recursivebooleanOptional

Recursively unpin the object linked to by the specified object(s). Default value is true

Responses
200
Removed pins list
application/json
500
General server error
application/json
post
POST /ipfs/pin/rm?arg=text HTTP/1.1
Host: <networkorgid>.ipfs-<region>.<publicdomain>
X-API-KEY: YOUR_API_KEY
Accept: */*
{
  "Pins": [
    "text"
  ]
}
post

List objects pinned to local storage

Authorizations
Query parameters
argstringRequired

Path to object(s) to be listed

typestringOptional

The type of pinned keys to list. Can be "direct", "indirect", "recursive", or "all". Default value is all

queitbooleanOptional

Write just hashes of objects

streambooleanOptional

Enable streaming of pins as they are discovered

Responses
200
Pinned list
application/json
500
General server error
application/json
post
POST /ipfs/pin/ls?arg=text HTTP/1.1
Host: <networkorgid>.ipfs-<region>.<publicdomain>
X-API-KEY: YOUR_API_KEY
Accept: */*
{
  "PinLsList": {
    "Keys": {
      "Sample": {
        "Type": "test"
      }
    }
  },
  "PinLsObject": {
    "Cid": "QmPJwu6iYBmj4eferq3UJK3uEEi",
    "Type": "test"
  }
}
  • POST/ipfs/add
  • POST/ipfs/addByUrl
  • POST/ipfs/ls
  • POST/ipfs/cat
  • POST/ipfs/pin/add
  • POST/ipfs/pin/rm
  • POST/ipfs/pin/ls
post

Uploads a file to IPFS using the given URL, with a maximum accepted size of 4MB. For file size larger than 4MB use the /ipfs/addByUrl endpoint

Authorizations
Query parameters
quietbooleanOptional

Write minimal output

quieterbooleanOptional

Write only final hash

silentbooleanOptional

Write no output

progressbooleanOptional

Stream progress data

tricklebooleanOptional

Use trickle-dag format for dag generation

only-hashbooleanOptional

Only chunk and hash - do not write to disk

wrap-with-directorybooleanOptional

Wrap files with a directory object

chunkerstringOptional

Chunking algorithm, size-[bytes], rabin-[min]-[avg]-[max] or buzhash. Default value is size-262144

raw-leavesbooleanOptional

Use raw blocks for leaf nodes

nocopybooleanOptional

Add the file using filestore. Implies raw-leaves

fscachebooleanOptional

Check the filestore for pre-existing blocks

cid-versionnumberOptional

CID version. Defaults to 0 unless an option that depends on CIDv1 is passed. Passing version 1 will cause the raw-leaves option to default to true

hashstringOptional

Hash function to use. Implies CIDv1 if not sha2-256. Default value is sha2-256

inlinebooleanOptional

Inline small blocks into CIDs

inline-limitbooleanOptional

Maximum block size to inline. Default value is 32

pinbooleanOptional

Pin locally to protect added files from garbage collection. Default value is true

to-filesstringOptional

Add reference to Files API (MFS) at the provided path

Body
fileNamestring ยท binaryOptional
Responses
200
File uploaded
application/json
400
Bad request
application/json
500
General server error
application/json
post
POST /ipfs/add HTTP/1.1
Host: <networkorgid>.ipfs-<region>.<publicdomain>
X-API-KEY: YOUR_API_KEY
Content-Type: multipart/form-data
Accept: */*
Content-Length: 21

{
  "fileName": "binary"
}
{
  "Bytes": 2454,
  "Hash": "QmSMPFa2op3HqGv7bbpm1GkzPnuHP9cx2rQXiqN1",
  "Name": "test",
  "Size": 1049
}