DOCUMENTS

Documents of the BORA project.

IPFS APIs

This document provides examples and APIs for how to access the BORA IPFS Services. To learn more about IPFS, please see https://ipfs.io/.

1 Add File

POST /sc/ipfs/v1/add HTTP/1.1
HOST: testnet-chain-api.boraecosystem.com
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW

------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="file"; filename="1.jpeg"
Content-Type: image/jpeg
------WebKitFormBoundary7MA4YWxkTrZu0gW--

Parameters

ParameterRequiredValuesDescriptionParameter TypeData Type
Authorization*Bearer {Client's AccessToken}headerstring
File*File Contentmultipart/form-data

Response

{
"status": 200,
"data: {
"hash": "QmPCkNrfDSLKmnm4t2yxhwoRK4QibYkfNUBphtf2r3Fv36"
}
}

2 Ask File

GET /sc/ipfs/v1/get/{{Hash}} HTTP/1.1
HOST: testnet-chain-api.boraecosystem.com

Parameters

ParameterRequiredValuesDescriptionParameter TypeData Type
Authorization*Bearer {Client's AccessToken}headerstring
Hash*IPFS File Hashquerystring

Response

{{IPFS File Content}}

3 Search Hash

GET /sc/ipfs/v1/search/{{Hash}} HTTP/1.1
HOST: testnet-chain-api.boraecosystem.com

Parameters

ParameterRequiredValuesDescriptionParameter TypeData Type
Authorization*Bearer {Client's AccessToken}headerstring
Hash*IPFS File Hashquerystring

Response

{
"status": 200,
"data": {
"Hash": {{Inserted Hash}},
"NumLinks": {{Number of Links}},
"BlockSize": {{Block Size}},
"LinksSize": {{Link Size}},
"DataSize": {{Data Size in bytes}},
"CumulativeSize": {{Cumulative Size in bytes}},
"uri": "{{IPFS File Path}}"
}
}