Display Your Items on Your Game/Website
Once you have created Items, you can display them on your game or website. This guide will show you how to fetch your items from the Fractal API.
Getting Item Templates
💡
Requests to server api's require a valid auth token scoped to your project.
For a guide on how to get your auth token, see this guide.
Get item templates
curl --request GET \
--url 'https://api.fractal.is/sdk/v1/inventory/solana/items' \
--header 'Authorization: Bearer <PROJECT_API_TOKEN>'
This will return a list of item templates. You can use this list to populate your in-game storefront.
Here is an example response:
{
"collections": {
"templates": [
{
"id": "5fe6d9aa-3959-46be-b499-866ee1ba3185",
"metadata": {
"name": "Spec Ops Soldier",
"description": "A super awesome spec ops soldier to use in our game",
"imageUrl": "https://storage.googleapis.com/fractal-studios/673a38ab-980b-4cba-ab60-3bfc0b16a2ba/aaea772c-6d09-49a9-a6cd-cdeffe94e96a",
"attributes": []
},
"price": { "amount": "1", "unit": "SOL" }
},
{
"id": "676846a7-97bf-45b2-90f4-f55f9880e0aa",
"metadata": {
"name": "Spec Ops Soldier",
"description": "A fractal devex Spec Ops soldier",
"imageUrl": "https://storage.googleapis.com/fractal-studios/673a38ab-980b-4cba-ab60-3bfc0b16a2ba/f0f4c983-5879-4bed-8a64-fec193f50c25",
"attributes": []
},
"price": { "amount": "1", "unit": "SOL" }
},
{
"id": "5f52bf14-c95b-43cb-aa38-8ba5e136df01",
"metadata": {
"name": "Demo NFT",
"description": "Super awesome Fractal Developer experience NFT",
"imageUrl": "https://storage.googleapis.com/fractal-studios/673a38ab-980b-4cba-ab60-3bfc0b16a2ba/19ba3b35-e893-41fb-9617-adeea75d7838",
"attributes": []
},
"price": { "amount": "5", "unit": "SOL" }
},
{
"id": "bfb604ec-5e8b-4dc5-8106-1bec16b07bd9",
"metadata": {
"name": "Ocotopus NFT",
"description": "Super Awesome Octopus NFT",
"imageUrl": "https://storage.googleapis.com/fractal-studios/673a38ab-980b-4cba-ab60-3bfc0b16a2ba/d7d87121-5077-42e4-8544-f46cef8c1062",
"attributes": []
},
"price": { "amount": "1", "unit": "SOL" }
}
]
}
}