Update NFT Item

If you are yet to deploy an NFT collection, you can modify the details of its NFT items. To accomplish this, send a PATCH request to the /nft/<nft_item_name> endpoint.

Update NFT Item details.

PATCH https://api.playfix.io/nft/<nft_item_name>

Path Parameters

Name
Type
Description

nft_item_name

String

An automatically generated unique name of the NFT item. This begins with nftitems/, followed by a ULID.

Headers

Name
Type
Description

Authorization*

String

Bearer <your_access_token>

Request Body

Name
Type
Description

attributes

String

An array of objects. Each object is an attribute of the NFT item.

imageCoverCid

String

IPFS CID for the NFT item's image.

description

String

A short description of the NFT item.

title

String

The title of the NFT item.

nft

String

Name of the NFT collection the NFT item will be added to. This should be the value of name from a previously created NFT collection.

{
  "name": "nftitems/01ggdqqd0mkkt7hz57a1g130yq"
  "nft": "<nft_collection_name>",
  "title": "Fast Car",
  "number": "1",
  "description": "blazing fast car",
  "imageUrl": "https://ipfs-gateway.playfix.io/ipfs/QmbAVZQhTmRwy57pr4NWuDMhxAC9yzU21GtaGP1f6bay8W",
  "imageCid": "QmbAVZQhTmRwy57pr4NWuDMhxAC9yzU21GtaGP1f6bay8W",
  "attributes": [
    {
      "property": {
        "name": "eyes",
        "value": "brown"
      }
    }
  ],
  "mintingTransactionHash": ""
}

Example cURL Call

curl --request PATCH \
  --url 'https://api.playfix.io/nft/<nft_item_name>' \
  --header 'Authorization: Bearer <your_access_token>' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
    "nft": "<nft_collection_name>",
    "title": "Fastest Car",
    "number": "1",
    "description": "blazing fast car",
    "imageCid": "QmbAVZQhTmRwy57pr4NWuDMhxAC9yzU21GtaGP1f6bay8W",
    "attributes": [
      {
        "property": {
        "name": "eyes",
        "value": "brown"
        }
      }
    ]
  }'

Example Python Call

import requests
import json

payload = {
    "nft": "<nft_collection_name>",
    "title": "Fastest Car",
    "number": "1",
    "description": "blazing fast car",
    "imageCid": "QmbAVZQhTmRwy57pr4NWuDMhxAC9yzU21GtaGP1f6bay8W",
    "attributes": [
      {
        "property": {
        "name": "eyes",
        "value": "brown"
        }
      }
    ]
  }
r = requests.patch(
    "https://api.playfix.io/token/<token_name>",
    headers = {
        "Authorization": "Bearer <your_access_token>",
        "Accept": "application/json",
        "Content-Type": "application/json"
        },
    data = json.dumps(payload)
    )

print(r.text)

Response

{
  "name": "nftitems/01ggdqqd0mkkt7hz57a1g130yq"
  "nft": "<nft_collection_name>",
  "title": "Fast Car",
  "number": "1",
  "description": "blazing fast car",
  "imageUrl": "https://ipfs-gateway.playfix.io/ipfs/QmbAVZQhTmRwy57pr4NWuDMhxAC9yzU21GtaGP1f6bay8W",
  "imageCid": "QmbAVZQhTmRwy57pr4NWuDMhxAC9yzU21GtaGP1f6bay8W",
  "attributes": [
    {
      "property": {
        "name": "eyes",
        "value": "brown"
      }
    }
  ],
  "mintingTransactionHash": ""
}

You can only update an NFT item if you are yet to deploy the NFT collection.

Last updated