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.
Auth Parameters Responses Response Example Request Sample
Name
Meaning
Param Type
Data Type
Name
Meaning
Param Type
Data Type
Required
The name of the uploaed file
The size of the uploaed file
The type of the uploaed file
The url of the uploaed file
Copy {
"file_url": "http://dev.nftrainbow/assets/file/1/nft/67c96aee8ee1293594a4b4ded15c60ea7853e49c0a2eb41a4805a01a70bc3111.jpeg",
"file_size": 11295,
"file_type": "jpeg",
"file_name": "67c96aee8ee1293594a4b4ded15c60ea7853e49c0a2eb41a4805a01a70bc3111"
}
Copy curl --request POST \
--url https://api.nftrainbow.cn/v1/files/ \
--header 'Authorization: Bearer {JWT}' \
--header 'Content-Type: multipart/form-data' \
--header 'content-type: multipart/form-data; boundary=---011000010111000001101001' \
--form file=
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.
Auth Parameters Responses Response Example Request Sample
Name
Meaning
Param Type
Data Type
Name
Meaning
Param Type
Data Type
Required
The name of the uploaed file
The size of the uploaed file
The type of the uploaed file
The url of the uploaed file
Copy {
"file_url": "https://nft-rainbow.oss-cn-hangzhou.aliyuncs.com/file/4/nft/377d21aaeddfff1f4f1fa73498df70a462945bb06f5a984358202cec0682c4d2.jpeg",
"file_size": 11295,
"file_type": "jpeg",
"file_name": "377d21aaeddfff1f4f1fa73498df70a462945bb06f5a984358202cec0682c4d2"
}
Copy curl --request POST \
--url https://api.nftrainbow.cn/v1/files/oss \
--header 'Authorization: Bearer {JWT}' \
--header 'Content-Type: multipart/form-data' \
--header 'content-type: multipart/form-data; boundary=---011000010111000001101001' \
--form file=
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.
Auth Parameters Responses Response Example Request Sample
Name
Meaning
Param Type
Data Type
Name
Meaning
Param Type
Data Type
Required
The number of the uploaed file
The url of the uploaed folder
Copy {
"folder_url": "http://dev.nftrainbow/assets/file/1/nft/e7201e566e70819f09842fba3972c9f0de24d3e57ea667a7b4e3b881d1f4c6fd",
"file_num": 5
}
Copy curl --request POST \
--url https://api.nftrainbow.cn/v1/files/folder \
--header 'Authorization: Bearer {JWT}' \
--header 'Content-Type: multipart/form-data' \
--header 'content-type: multipart/form-data; boundary=---011000010111000001101001' \
--form file=
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.
Auth Parameters Responses Response Example Request Sample
Name
Meaning
Param Type
Data Type
Name
Meaning
Param Type
Data Type
Required
The number of the uploaed file
The url of the uploaed folder
Copy {
"folder_url": "https://nft-rainbow.oss-cn-hangzhou.aliyuncs.com/file/4/nft/377d21aaeddfff1f4f1fa73498df70a462945bb06f5a984358202cec0682c4d2",
"file_num": 5
}
Copy curl --request POST \
--url https://api.nftrainbow.cn/v1/files/folder/oss \
--header 'Authorization: Bearer {JWT}' \
--header 'Content-Type: multipart/form-data' \
--header 'content-type: multipart/form-data; boundary=---011000010111000001101001' \
--form file=
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
.
Auth Parameter Response Response Example Request Sample
Name
Meaning
Param Type
Data Type
Name
Meaning
Param Type
Data Type
Required
Default
The number of the uploaded files
The ExposedFile
struct is lised as follow:
The name of the uploaed file
The size of the uploaed file
The type of the uploaed file
The url of the uploaed file
Copy {
"count": 3,
"items": [
{
"file_url": "http://dev.nftrainbow/assets/file/2/nft/fa6f733c258e3a0f364aeb18198c9e2bae2e2c91bee4d38a1c88fb9cc8a71a1b.jpeg",
"file_size": 11295,
"file_type": "jpeg",
"file_name": "fa6f733c258e3a0f364aeb18198c9e2bae2e2c91bee4d38a1c88fb9cc8a71a1b"
},
{
"file_url": "http://dev.nftrainbow/assets/file/2/nft/06edf22f414234ea59c949104a054ca4af27cd71e87170d99401b50d15651cdc.jpeg",
"file_size": 11295,
"file_type": "jpeg",
"file_name": "06edf22f414234ea59c949104a054ca4af27cd71e87170d99401b50d15651cdc"
},
{
"file_url": "http://dev.nftrainbow/assets/file/2/nft/bf822838b7b3a7dadc96bd6f38defcbb21376852284ded6302aac69a71e58027.jpeg",
"file_size": 11295,
"file_type": "jpeg",
"file_name": "bf822838b7b3a7dadc96bd6f38defcbb21376852284ded6302aac69a71e58027"
}
]
}
Copy curl --request GET \
--url https://api.nftrainbow.cn/v1/files/ \
--header 'Authorization: Bearer {JWT}' \
--header 'Content-Type: application/json'