Update NFT Information

NFT API

update NFT metadata

put https://api.dappportal.io/api/b2b-v1/nfts/{chain}/{contract_address}/{token_id}/metadata To ensure the security of your secret key, this API should be called from a secure server environment rather than directly than from webpage(FrontEnd).

Parameters

Name
Description

chain *required string (path)

chain name : "kairos", "kaia"

contract_address *required string (path)

contract address of NFT

token_id *required string (path)

token id of NFT

X-Auth-Signature *required string (header)

HMAC (clientId + method + path + timestamp + salt) key={secret} You can find the code example below.

X-Auth-ClientId *required string (header)

client id obtained from support team

X-Auth-Timestamp *required string (header)

Timestamp used in the X-Auth-Signature (request time) This parameter is included to protect against replay attacks.

X-Auth-Salt *required string (header)

Salt used in the X-Auth-Signature (a unique random value provided by the client for each request) (Length: 36 characters, UUID v4 format)

HMAC Signature Generation Example (Node.js)

Example code to generate X-Auth-Signature header for secure API calls.

const crypto = require('crypto');
/**
 * Generates an HMAC signature for API authentication.
 * @param {string} secret - Shared secret key used for HMAC.
 * @param {string} clientId - Public client identifier.
 * @param {string} method - HTTP method (e.g., GET, POST).
 * @param {string} path - Request path (e.g., /api/v1/resource).
 * @param {string} timestamp - UNIX timestamp (in seconds).
 * @param {string} salt - Random value (e.g., UUID or random bytes).
 * @returns {string} - Base64-encoded HMAC signature.
 */
function generateHmacSignature(secret, clientId, method, path, timestamp, salt) {
  const message = `${clientId}|${method.toUpperCase()}|${path}|${timestamp}|${salt}`;
  const hmac = crypto.createHmac('sha256', secret);
  hmac.update(message);
  return hmac.digest('base64');
}
 
const secret = 'your-secret-key';
const clientId = 'client-abc-123';
const method = 'POST';
const path = '/api/v1/order';
const timestamp = Math.floor(Date.now() / 1000).toString();
const salt = crypto.randomUUID(); 
const signature = generateHmacSignature(secret, clientId, method, path, timestamp, salt);
 
// debug code
console.log('X-Client-Id:', clientId);
console.log('X-Timestamp:', timestamp);
console.log('X-Salt:', salt);
console.log('X-Auth-Signature:', signature);

Request Body

Example Value
Schema

Responses

HTTP Status Code
description

200

null

400

400

400

429

500

500

Code Example (python)

Request Timeout

Read Timeout: Must be at least 10 seconds

  • The server may take several seconds to respond depending on load and metadata processing time.

  • Please ensure your HTTP client is configured to wait at least 10 seconds for a response.

Last updated