bitcain docs
API Reference

Storage

File storage, IPFS integration, and asset management

Upload Avatar

POST
/api/storage/avatar/upload

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Request Body

multipart/form-data

file*string

Response Body

application/json

application/json

curl -X POST "https://loading/api/storage/avatar/upload" \  -F file="string"
null
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Delete Avatar

DELETE
/api/storage/avatar

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Response Body

application/json

curl -X DELETE "https://loading/api/storage/avatar"
null

List User Files

GET
/api/storage/files

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Response Body

application/json

curl -X GET "https://loading/api/storage/files"
null

Generate Presigned Url

POST
/api/storage/presigned-url

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Query Parameters

filename*string
expiration?integer
Default3600

Response Body

application/json

application/json

curl -X POST "https://loading/api/storage/presigned-url?filename=string"
null
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Health Check

GET
/api/ipfs/health

Response Body

application/json

curl -X GET "https://loading/api/ipfs/health"
{}

Upload File

POST
/api/ipfs/upload

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Request Body

multipart/form-data

file*string
pin?boolean
Defaulttrue

Response Body

application/json

application/json

curl -X POST "https://loading/api/ipfs/upload" \  -F file="string"
{
  "success": true,
  "cid": "string",
  "ipfs_uri": "string",
  "gateway_url": "string",
  "file_size": 0,
  "file_type": "image",
  "pinned": true,
  "timestamp": "2019-08-24T14:15:22Z"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Upload Metadata

POST
/api/ipfs/metadata

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Request Body

application/json

metadata*

NFT metadata structure following OpenSea standards

pin?boolean
Defaulttrue

Response Body

application/json

application/json

curl -X POST "https://loading/api/ipfs/metadata" \  -H "Content-Type: application/json" \  -d '{    "metadata": {      "name": "string",      "description": "string",      "image": "string"    }  }'
{
  "success": true,
  "cid": "string",
  "ipfs_uri": "string",
  "gateway_url": "string",
  "metadata": {
    "name": "string",
    "description": "string",
    "image": "string",
    "external_url": "string",
    "animation_url": "string",
    "background_color": "string",
    "attributes": [
      {
        "trait_type": "string",
        "value": "string",
        "display_type": "string",
        "max_value": 0
      }
    ]
  },
  "pinned": true,
  "timestamp": "2019-08-24T14:15:22Z"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Retrieve File

GET
/api/ipfs/retrieve/{cid}

Path Parameters

cid*string

Response Body

application/json

application/json

curl -X GET "https://loading/api/ipfs/retrieve/string"
null
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Pin Content

POST
/api/ipfs/pin/{cid}

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

cid*string

Response Body

application/json

application/json

curl -X POST "https://loading/api/ipfs/pin/string"
{}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Unpin Content

DELETE
/api/ipfs/pin/{cid}

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

cid*string

Response Body

application/json

application/json

curl -X DELETE "https://loading/api/ipfs/pin/string"
{}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Check Pin Status

GET
/api/ipfs/status/{cid}

Path Parameters

cid*string

Response Body

application/json

application/json

curl -X GET "https://loading/api/ipfs/status/string"
{
  "cid": "string",
  "status": "pinned",
  "pinned_at": "2019-08-24T14:15:22Z",
  "error": "string"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Get Gateway Url

GET
/api/ipfs/gateway-url/{cid}

Path Parameters

cid*string

Response Body

application/json

application/json

curl -X GET "https://loading/api/ipfs/gateway-url/string"
{}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}