Files

The files APIs provide users to make preparations for creating NFTs including uploading files and the corresponding query functions.

Upload File

Upload file API helps users to upload a file to get the corresponding url for creating NFT metadata. The file can be a video, a figure and so on.

Upload file

post

Upload a file which can be a video, an image and so on

Header parameters
AuthorizationstringRequired

Bearer openapi_token

Body
filestringRequired

uploaded file

Responses
200
OK
application/json
post
POST /v1/files/ HTTP/1.1
Host: api.nftrainbow.cn
Authorization: text
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 15

"file='text'"
{
  "file_name": "text",
  "file_size": 1,
  "file_type": "text",
  "file_url": "text"
}
Name
Meaning
Param Type
Data Type

Authorization

Bearer Token

Header

string

Upload File to OSS

OSS is a storage service provided by Alibaba. Users can choose to upload the files to OSS storage. Upload file to OSS API helps users to achieve the target. The file can be a video, a figure and so on.

Upload file to OSS

post

Upload a file to OSS, which can be a video, an image and so on

Header parameters
AuthorizationstringRequired

Bearer openapi_token

Body
filestringRequired

uploaded file

Responses
200
OK
application/json
post
POST /v1/files/oss HTTP/1.1
Host: api.nftrainbow.cn
Authorization: text
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 15

"file='text'"
{
  "file_name": "text",
  "file_size": 1,
  "file_type": "text",
  "file_url": "text"
}
Name
Meaning
Param Type
Data Type

Authorization

Bearer Token

Header

string

Upload File List

Upload File List API helps users to upload a folder to the server. The files can be a video, a figure and so on.

Upload folder

post

Upload a folder containing the files which can be a video, an image and so on

Header parameters
AuthorizationstringRequired

Bearer openapi_token

Body
folderstringRequired

uploaded folder

Responses
200
OK
application/json
post
POST /v1/files/folder HTTP/1.1
Host: api.nftrainbow.cn
Authorization: text
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 17

"folder='text'"
{
  "file_num": 1,
  "folder_url": "text"
}
Name
Meaning
Param Type
Data Type

Authorization

Bearer Token

Header

string

Upload File List To OSS

Upload File List To OSS API helps users to upload a folder to oss. The files in this folder can be a video, a figure and so on.

Upload folder to oss

post

Upload a folder containing the files which can be a video, an image and so on, to oss

Header parameters
AuthorizationstringRequired

Bearer openapi_token

Body
folderstringRequired

uploaded folder

Responses
200
OK
application/json
post
POST /v1/files/folder/oss HTTP/1.1
Host: api.nftrainbow.cn
Authorization: text
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 17

"folder='text'"
{
  "file_num": 1,
  "folder_url": "text"
}
Name
Meaning
Param Type
Data Type

Authorization

Bearer Token

Header

string

Obtain File List

Obtain file list API helps users to obtain the list including the inforamion of the files uploaded in the specified app. The information of each file contains file_url, file_size, file_type and file_name.

Obtain file list

get

Get the file list containing the info of the files uploaded in the specified app

Query parameters
pagestringOptional

page

limitstringOptional

limit

Header parameters
AuthorizationstringRequired

Bearer openapi_token

Responses
200
OK
application/json
get
GET /v1/files/ HTTP/1.1
Host: api.nftrainbow.cn
Authorization: text
Accept: */*
{
  "count": 1,
  "items": [
    {
      "created_at": "text",
      "deleted_at": {
        "time": "text",
        "valid": true
      },
      "file_name": "text",
      "file_size": 1,
      "file_type": "text",
      "file_url": "text",
      "id": 1,
      "updated_at": "text"
    }
  ]
}
Name
Meaning
Param Type
Data Type

Authorization

Bearer Token

Header

string

Last updated