NFT & API Response Mode
Once NFT data has been added against a Tag Code, it's possible to extract both the NFT data (contract, token, owner) and also the NFT metadata (name, description, image, etc) via the API Response Mode.
What this means is that with a single API call, you can verify the authenticity of the physical NFC tag, verify the owner of the NFT (blockchain owner vs. ixkio stored owner) and get the NFT metadata itself.
This tutorial assumes that you already have created your Tag Code and have set the NFT contract, token and owner. are calling via the API. We are going to use the Tag Code 'q8w3sbcz' in this example.
A standard authentication API call would be :
Providing the pass/fail rules are set up (see example configuration under API Mode for authentication), you would expect to see a JSON response :
Now we are going to add the NFT metadata into the Response.
Extended Data fields allow additional data to be associated with Tag Groups or Tag Codes. Extended Data can be included in the API Response. To allow the NFT metadata to display in the Response, we need to create a field to put it in.
Navigate to the Active Folder level for your Tag Code, then Folder Function Panel > Data Tab. Add a field called 'NFT' with a Type of JSON.
In the same Active Folder, now navigate to Folder Function Panel > Response Tab. You should see the NFT Data Name in the table (if not, refresh the page). Change the dropdown to 'Add to Response' and click Update.
As NFT data is dynamic, we are going to use Subtags to instruct ixkio to dynamically add the data into the Response. You can do this at the Tag Group level so it affects all Tag Codes under that Group, or you can do it on a Tag Code level. We will do it at the Tag Group level here.
Navigate to the Tag Group screen for your Tag Code, then Tag Group Data > Extended. You should see your Extended Data field 'NFT'. Into here, we are going to add :
and click Update.
That's it. Now you should see the metadata also included in the API Response.
As an example (redacted to keep the example shorter) :
"title": "Ixkio NFT Robot",
"description": "The Ixkio NFT Demonstration Robot"
Note that the "NFT" property is the "NFT" that you named in the Extended Data field in Step 1.
Be aware that ixkio will usually provide an authentication API Response extremely quickly. However, when requesting NFT data, we use a third party API and, on rare occasions, this can create a delay in the API Response that is out of our control.
If you want to verify the NFT owner stored within ixkio against that of the blockchain NFT, then there are a few ways to do this. As one example, you can create two additional Extended Data fields (step 1 and 2 above) - perhaps called 'ixkio_owner' and 'bc_owner' both with a Type 'Text' instead of 'JSON'.
Then for step 3, instead of adding the nft_meta subtag, include the NFT owner (ixkio) subtag and the NFT owner (blockchain) subtags, one in each Extended Data field :
Into the ixkio_owner :
and into the bc_owner :
This would then add the property into the JSON which can be compared.
Last modified 12d ago