Metadata
The metadata APIs provide users to make preparations for creating NFTs including creating NFT metadata and the corresponding query functions.
Create NFT Metadata
Create NFT metadata
API helps users to create their own metadata after calling Upload File to get the corresponding file url. To call Create NFT metadata
, users have to provide the metadata information including name
, file
, external_link
and so on.
Authorization
Bearer Token
Header
string
name
The name of the metadata
body
string
image
The file url of the metadata
body
string
external_link
The externanl link of the metadata
body
string
description
The description of the metadata
body
string
animation_url
A URL to a multi-media attachment for the item. The file extensions GLTF, GLB, WEBM, MP4, M4V, OGV, and OGG are supported, along with the audio-only extensions MP3, WAV, and OGA.
body
string
attributes
The attributes of the metadata
array
attribute
The struct of the MetadataAttribute is listed as bellow.
attribute_name
The name of the attribute
body
string
display_type
The display type of the attribute
body
string
trait_type
The trait type of the attribute
body
string
value
The value of the attribute
body
string
{
"attributes": [
{
"attribute_name": "mouse",
"display_type": "test hey hey",
"trait_type": "big",
"value": "big"
}
],
"description": "this is a test metadata",
"image": "http://dev.nftrainbow/assets/file/1/nft/67c96aee8ee1293594a4b4ded15c60ea7853e49c0a2eb41a4805a01a70bc3111.jpeg",
"name": "test",
"external_link": "https://www.google.com/search",
"animation_url": "https://www.google.com/search"
}
uri
The uri of the metadata
string
metadata_id
The id of the metadata
string
description
The description of the metadata
string
external_link
The external link of the metadata
string
image
The file url of the metadata
string
metadata_id
The id of the metadata
string
name
The name of the metadata
string
animation_url
A URL to a multi-media attachment for the item. The file extensions GLTF, GLB, WEBM, MP4, M4V, OGV, and OGG are supported, along with the audio-only extensions MP3, WAV, and OGA.
string
attributes
The attribute of the metadata
[]ExposedMetadataAttribute
The ExposedMetadataAttribute struct is listed as follow:
attribute_name
The name of the attribute
string
display_type
The display type of the attribut
string
trait_type
The trait type of the attribute
string
value
The value of the attribute
string
{
"attributes": [
{
"attribute_name": "mouse",
"display_type": "test hey hey",
"trait_type": "big",
"value": "big"
}
],
"description": "this is a test metadata",
"metadata_id": "f35c25ced3f537e8850a377c01d22aa7507069270054d12587ddbe5fc47ec490",
"image": "http://dev.nftrainbow/assets/file/1/nft/67c96aee8ee1293594a4b4ded15c60ea7853e49c0a2eb41a4805a01a70bc3111.jpeg",
"name": "test",
"external_link": "https://www.google.com/search",
"animation_url": "https://www.google.com/search",
"uri": "https://dev.nftrainbow.cn/assets/metadata/2/nft/db2078aed6187e487a46a19624ba1559faddeb096849c4688347302023c40f6b.json"
}
curl --request POST
--url https://api.nftrainbow.cn/v1/metadata/ \
--header 'Authorization: Bearer {JWT}' \
--header 'Content-Type: application/json' \
--data-raw '{
"attributes": [
{
"attribute_name": "mouse",
"display_type": "test hey hey",
"trait_type": "big",
"value": "big"
}
],
"description": "this is a test metadata",
"image": "https://www.google.com/search",
"external_link": "https://www.google.com/search",
"animation_url": "https://www.google.com/search",
"name": "test"
}
Query Metadata
Query metadata
API helps users to query the detailed information of the specified metadata according to metadata_id
. This api returns the name
, description
, external link
, file
and attributes
of the queried metada.
Authorization
Bearer Token
Header
string
metadata_id
The id of the metadata
Path
Integer
attributes
The attribute of the metadata
[]ExposedMetadataAttribute
description
The description of the metadata
string
external_link
The external link of the metadata
string
animation_url
A URL to a multi-media attachment for the item. The file extensions GLTF, GLB, WEBM, MP4, M4V, OGV, and OGG are supported, along with the audio-only extensions MP3, WAV, and OGA.
string
image
The file url of the metadata
string
metadata_id
The id of the metadata
string
name
The name of the metadata
string
The ExposedMetadataAttribute struct is listed as follow:
attribute_name
The name of the attribute
string
display_type
The display type of the attribut
string
trait_type
The trait type of the attribute
string
value
The value of the attribute
string
{
"attributes": [
{
"attribute_name": "mouse",
"display_type": "test hey hey",
"trait_type": "big",
"value": "big"
}
],
"description": "this is a test metadata",
"external_link": "https://www.google.com/search",
"animation_url": "https://www.google.com/search",
"metadata_id": "f35c25ced3f537e8850a377c01d22aa7507069270054d12587ddbe5fc47ec490",
"image": "http://dev.nftrainbow/assets/file/1/nft/67c96aee8ee1293594a4b4ded15c60ea7853e49c0a2eb41a4805a01a70bc3111.jpeg",
"name": "test",
"uri": "https://dev.nftrainbow.cn/assets/metadata/2/nft/db2078aed6187e487a46a19624ba1559faddeb096849c4688347302023c40f6b.json"
}
curl --request GET \
--url https://dev.nftrainbow/v1/metadata/:metadata_id \
--header 'Authorization: 'Bearer {JWT}' \
--header 'Content-Type: application/json'
Obtain Metadata List
Query metadata list
API helps users to obain the metadata list including the information of the metadata created in the specified app. This API returns the array of the result from calling Query matadata.
Authorization
Bearer Token
Header
string
page
Page Query
query
integer
1
limit
Page Query
query
integer
10
count
The number of the uploaded files
integer
items
The files information
[]QueryMetadataRsponse
The QueryMetadataResponse struct
is listed as follow:
attributes
The attribute of the
[]attributes
description
The description of the metadata
string
external_link
The external link of the metadata
string
animation_url
A URL to a multi-media attachment for the item. The file extensions GLTF, GLB, WEBM, MP4, M4V, OGV, and OGG are supported, along with the audio-only extensions MP3, WAV, and OGA.
string
image
The file url of the metadata
string
metadata_id
The id of the metadata
string
name
The name of the metadata
string
The attributes struct
is listed as follow:
attribute_name
The name of the attribute
string
display_type
The display type of the attribut
string
trait_type
The trait type of the attribute
string
value
The value of the attribute
string
{
"count": 1,
"items": [
{
"metadata": {
"name": "test",
"description": "this is a test metadata",
"metadata_id": "f35c25ced3f537e8850a377c01d22aa7507069270054d12587ddbe5fc47ec490",
"image": "http://dev.nftrainbow/assets/file/1/nft/67c96aee8ee1293594a4b4ded15c60ea7853e49c0a2eb41a4805a01a70bc3111.jpeg",
"external_link": "https://www.google.com/search",
"animation_url": "https://www.google.com/search",
"attributes": [
{
"attribute_name": "eyes",
"trait_type": "test trait",
"display_type": "",
"value": "big"
},
{
"attribute_name": "mouse",
"trait_type": "test hey hey",
"display_type": "",
"value": "big"
}
]
},
"uri": "http://dev.nftrainbow/assets/metadata/1/nft/46708cf66a806743cfc27b110a41a2ea2e1b7a47fbcfb2efc9cac8fd3bf29cd1.json"
}
]
}
curl --request GET \
--url https://api.nftrainbow.cn/v1/metadata/ \
--header 'Authorization: Bearer {JWT}' \
--header 'Content-Type: application/json'
Last updated