IPFS

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 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
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
}
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
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
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
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
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
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
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"
  }
}

Last updated

Was this helpful?