For the complete documentation index, see llms.txt. This page is also available as Markdown.

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
/v1/files/

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

Authorizations
Header parameters
AuthorizationstringRequired

Bearer openapi_token

Body
filestringRequired

uploaded file

Responses
200

OK

application/json
file_namestringOptional
file_sizeintegerOptional
file_typestringOptional
file_urlstringOptional
post/v1/files/
POST /v1/files/ HTTP/1.1
Host: api.nftrainbow.cn
Authorization: text
Content-Type: multipart/form-data
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

Name
Meaning
Param Type
Data Type
Required

file

uploaded file

multipart/form-data

Name
Meaning
Type

file_name

The name of the uploaed file

string

file_size

The size of the uploaed file

integer

file_type

The type of the uploaed file

string

file_url

The url of the uploaed file

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
/v1/files/oss

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

Authorizations
Header parameters
AuthorizationstringRequired

Bearer openapi_token

Body
filestringRequired

uploaded file

Responses
200

OK

application/json
file_namestringOptional
file_sizeintegerOptional
file_typestringOptional
file_urlstringOptional
post/v1/files/oss
POST /v1/files/oss HTTP/1.1
Host: api.nftrainbow.cn
Authorization: text
Content-Type: multipart/form-data
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

Name
Meaning
Param Type
Data Type
Required

file

uploaded file

multipart/form-data

Name
Meaning
Type

file_name

The name of the uploaed file

string

file_size

The size of the uploaed file

integer

file_type

The type of the uploaed file

string

file_url

The url of the uploaed file

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
/v1/files/folder

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

Authorizations
Header parameters
AuthorizationstringRequired

Bearer openapi_token

Body
folderstringRequired

uploaded folder

Responses
200

OK

application/json
file_numintegerOptional
folder_urlstringOptional
post/v1/files/folder
POST /v1/files/folder HTTP/1.1
Host: api.nftrainbow.cn
Authorization: text
Content-Type: multipart/form-data
Accept: */*
Content-Length: 17

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

Authorization

Bearer Token

Header

string

Name
Meaning
Param Type
Data Type
Required

folder

uploaded files

multipart/form-data

Name
Meaning
Type

file_num

The number of the uploaed file

integer

folder_url

The url of the uploaed folder

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
/v1/files/folder/oss

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

Authorizations
Header parameters
AuthorizationstringRequired

Bearer openapi_token

Body
folderstringRequired

uploaded folder

Responses
200

OK

application/json
file_numintegerOptional
folder_urlstringOptional
post/v1/files/folder/oss
POST /v1/files/folder/oss HTTP/1.1
Host: api.nftrainbow.cn
Authorization: text
Content-Type: multipart/form-data
Accept: */*
Content-Length: 17

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

Authorization

Bearer Token

Header

string

Name
Meaning
Param Type
Data Type
Required

folder

uploaded files

multipart/form-data

Name
Meaning
Type

file_num

The number of the uploaed file

integer

folder_url

The url of the uploaed folder

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
/v1/files/

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

Authorizations
Query parameters
pagestringOptional

page

limitstringOptional

limit

Header parameters
AuthorizationstringRequired

Bearer openapi_token

Responses
200

OK

application/json
countintegerOptional
get/v1/files/
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

Name
Meaning
Param Type
Data Type
Required
Default

page

Page Query

query

integer

1

limit

Page Query

query

integer

10

Name
Meaning
Type

count

The number of the uploaded files

integer

items

The files information

[]ExposedFile

The ExposedFile struct is lised as follow:

Name
Meaning
Type

file_name

The name of the uploaed file

string

file_size

The size of the uploaed file

integer

file_type

The type of the uploaed file

string

file_url

The url of the uploaed file

string

Last updated