Set metadata for a specific token
curl --request PUT \
--url https://api.lootexplus.com/v1/metadata/repos/{metadataRepoId}/tokens/{tokenId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Cool NFT #1",
"description": "This is a really cool NFT",
"image": "https://example.com/image.png",
"animationUrl": "https://example.com/animation.mp4",
"externalUrl": "https://example.com",
"attributes": [
{
"trait_type": "Background",
"value": "Blue",
"display_type": "string"
}
],
"properties": {
"category": "art"
}
}
'import requests
url = "https://api.lootexplus.com/v1/metadata/repos/{metadataRepoId}/tokens/{tokenId}"
payload = {
"name": "Cool NFT #1",
"description": "This is a really cool NFT",
"image": "https://example.com/image.png",
"animationUrl": "https://example.com/animation.mp4",
"externalUrl": "https://example.com",
"attributes": [
{
"trait_type": "Background",
"value": "Blue",
"display_type": "string"
}
],
"properties": { "category": "art" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Cool NFT #1',
description: 'This is a really cool NFT',
image: 'https://example.com/image.png',
animationUrl: 'https://example.com/animation.mp4',
externalUrl: 'https://example.com',
attributes: [{trait_type: 'Background', value: 'Blue', display_type: 'string'}],
properties: {category: 'art'}
})
};
fetch('https://api.lootexplus.com/v1/metadata/repos/{metadataRepoId}/tokens/{tokenId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.lootexplus.com/v1/metadata/repos/{metadataRepoId}/tokens/{tokenId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Cool NFT #1',
'description' => 'This is a really cool NFT',
'image' => 'https://example.com/image.png',
'animationUrl' => 'https://example.com/animation.mp4',
'externalUrl' => 'https://example.com',
'attributes' => [
[
'trait_type' => 'Background',
'value' => 'Blue',
'display_type' => 'string'
]
],
'properties' => [
'category' => 'art'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.lootexplus.com/v1/metadata/repos/{metadataRepoId}/tokens/{tokenId}"
payload := strings.NewReader("{\n \"name\": \"Cool NFT #1\",\n \"description\": \"This is a really cool NFT\",\n \"image\": \"https://example.com/image.png\",\n \"animationUrl\": \"https://example.com/animation.mp4\",\n \"externalUrl\": \"https://example.com\",\n \"attributes\": [\n {\n \"trait_type\": \"Background\",\n \"value\": \"Blue\",\n \"display_type\": \"string\"\n }\n ],\n \"properties\": {\n \"category\": \"art\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.lootexplus.com/v1/metadata/repos/{metadataRepoId}/tokens/{tokenId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Cool NFT #1\",\n \"description\": \"This is a really cool NFT\",\n \"image\": \"https://example.com/image.png\",\n \"animationUrl\": \"https://example.com/animation.mp4\",\n \"externalUrl\": \"https://example.com\",\n \"attributes\": [\n {\n \"trait_type\": \"Background\",\n \"value\": \"Blue\",\n \"display_type\": \"string\"\n }\n ],\n \"properties\": {\n \"category\": \"art\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lootexplus.com/v1/metadata/repos/{metadataRepoId}/tokens/{tokenId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Cool NFT #1\",\n \"description\": \"This is a really cool NFT\",\n \"image\": \"https://example.com/image.png\",\n \"animationUrl\": \"https://example.com/animation.mp4\",\n \"externalUrl\": \"https://example.com\",\n \"attributes\": [\n {\n \"trait_type\": \"Background\",\n \"value\": \"Blue\",\n \"display_type\": \"string\"\n }\n ],\n \"properties\": {\n \"category\": \"art\"\n }\n}"
response = http.request(request)
puts response.read_bodyDrops
Update Token Metadata
Sets or updates metadata for a specific token in a metadata repository. Requires secret key authentication.
PUT
/
v1
/
metadata
/
repos
/
{metadataRepoId}
/
tokens
/
{tokenId}
Set metadata for a specific token
curl --request PUT \
--url https://api.lootexplus.com/v1/metadata/repos/{metadataRepoId}/tokens/{tokenId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Cool NFT #1",
"description": "This is a really cool NFT",
"image": "https://example.com/image.png",
"animationUrl": "https://example.com/animation.mp4",
"externalUrl": "https://example.com",
"attributes": [
{
"trait_type": "Background",
"value": "Blue",
"display_type": "string"
}
],
"properties": {
"category": "art"
}
}
'import requests
url = "https://api.lootexplus.com/v1/metadata/repos/{metadataRepoId}/tokens/{tokenId}"
payload = {
"name": "Cool NFT #1",
"description": "This is a really cool NFT",
"image": "https://example.com/image.png",
"animationUrl": "https://example.com/animation.mp4",
"externalUrl": "https://example.com",
"attributes": [
{
"trait_type": "Background",
"value": "Blue",
"display_type": "string"
}
],
"properties": { "category": "art" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Cool NFT #1',
description: 'This is a really cool NFT',
image: 'https://example.com/image.png',
animationUrl: 'https://example.com/animation.mp4',
externalUrl: 'https://example.com',
attributes: [{trait_type: 'Background', value: 'Blue', display_type: 'string'}],
properties: {category: 'art'}
})
};
fetch('https://api.lootexplus.com/v1/metadata/repos/{metadataRepoId}/tokens/{tokenId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.lootexplus.com/v1/metadata/repos/{metadataRepoId}/tokens/{tokenId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Cool NFT #1',
'description' => 'This is a really cool NFT',
'image' => 'https://example.com/image.png',
'animationUrl' => 'https://example.com/animation.mp4',
'externalUrl' => 'https://example.com',
'attributes' => [
[
'trait_type' => 'Background',
'value' => 'Blue',
'display_type' => 'string'
]
],
'properties' => [
'category' => 'art'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.lootexplus.com/v1/metadata/repos/{metadataRepoId}/tokens/{tokenId}"
payload := strings.NewReader("{\n \"name\": \"Cool NFT #1\",\n \"description\": \"This is a really cool NFT\",\n \"image\": \"https://example.com/image.png\",\n \"animationUrl\": \"https://example.com/animation.mp4\",\n \"externalUrl\": \"https://example.com\",\n \"attributes\": [\n {\n \"trait_type\": \"Background\",\n \"value\": \"Blue\",\n \"display_type\": \"string\"\n }\n ],\n \"properties\": {\n \"category\": \"art\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.lootexplus.com/v1/metadata/repos/{metadataRepoId}/tokens/{tokenId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Cool NFT #1\",\n \"description\": \"This is a really cool NFT\",\n \"image\": \"https://example.com/image.png\",\n \"animationUrl\": \"https://example.com/animation.mp4\",\n \"externalUrl\": \"https://example.com\",\n \"attributes\": [\n {\n \"trait_type\": \"Background\",\n \"value\": \"Blue\",\n \"display_type\": \"string\"\n }\n ],\n \"properties\": {\n \"category\": \"art\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lootexplus.com/v1/metadata/repos/{metadataRepoId}/tokens/{tokenId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Cool NFT #1\",\n \"description\": \"This is a really cool NFT\",\n \"image\": \"https://example.com/image.png\",\n \"animationUrl\": \"https://example.com/animation.mp4\",\n \"externalUrl\": \"https://example.com\",\n \"attributes\": [\n {\n \"trait_type\": \"Background\",\n \"value\": \"Blue\",\n \"display_type\": \"string\"\n }\n ],\n \"properties\": {\n \"category\": \"art\"\n }\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Secret key for authentication
Path Parameters
The metadata repository ID
Example:
"550e8400-e29b-41d4-a716-446655440000"
The token ID
Example:
"1"
Body
application/json
Token name
Example:
"Cool NFT #1"
Token description
Example:
"This is a really cool NFT"
Token image URL
Example:
"https://example.com/image.png"
Animation URL for the token
Example:
"https://example.com/animation.mp4"
External URL for the token
Example:
"https://example.com"
Token attributes
Show child attributes
Show child attributes
Additional properties
Example:
{ "category": "art" }
Response
Token metadata set successfully