LogoLogo
Landing PageMarketplaceDeveloper PortalDeveloper Discord
  • 👋Welcome to Altura
  • Getting started
    • 🚀Altura NFTs
    • 🛍️The Altura Marketplace
    • 🪅Minting & Importing NFTs
    • 👔Users & Authentication
    • 🔑Altura Guard
  • 💻Developer Portal
    • 🧰The Developer Wallet
  • 🌐REST API
    • 🎴Get Your API Key
    • 🔧Methods
      • 🛡️Authenticate User
      • 👤Get User
      • 👥Get Users
      • 🖼️Get a User's Items
      • 🖼️Get Item
      • 🌈Get Items
      • 👾Get an Item's Holders
      • 📜Get an Item's History
      • 💠Transfer ERC1155
      • 💠Transfer ERC721
      • 💠Bulk Transfer ERC1155
      • 🔮Update an Item's Properties
      • ✍️Update an Item's data
      • 🧬Bulk Update an Item's Properties
      • 🪄Update an Item's Image
      • 📸Add a New Image
      • 🪟Mint Additional Supply
      • 📁Get Collection
      • 🗂️Get Collections
      • 🪄Update Collection
      • 🪙Transfer ERC20
      • ☑️Verify item Ownership
      • 🪙Check User's ERC20 Balance
      • 💰Check User's Balance
  • 🔆JavaScript SDK
    • 🛠️Installation
    • 🔧Methods
      • 🛡️Authenticate User
      • 👤Get User
      • 👥Get Users
      • 🖼️Get User's Items
      • 🖼️Get Item
      • 🌈Get Items
      • 👾Get an Item's Holders
      • 📜Get an Item's History
      • 💠Transfer ERC1155
      • 💠Transfer ERC721
      • 💠Bulk Transfer ERC1155
      • 🪟Mint Additional Supply
      • 🔮Update Property
      • 🪄Update Primary Image
      • 🆕Add a New Image
      • 📁Get Collection
      • 🗂️Get Collections
      • 🪄Update Collection
      • 🪙Transfer ERC20
    • 🎛️Schemas
    • ⌨️Connector API
  • 🕹️Unity SDK
    • 🛠️Installation
    • 🔧Methods
      • 🛡️Authenticate User
      • 👤Get User
      • 👥Get Users
      • 🖼️Get User's Items
      • 🖼️Get Item
      • 🌈Get Items
      • 👾Get an Item Holders
      • 📜Get an Item's History
      • 💠Transfer ERC1155
      • 💠Transfer ERC721
      • 💠Bulk Transfer ERC1155
      • 🪟Mint Additional Supply
      • 🔮Update Property
      • 🪄Update Primary Image
      • 📁Get Collection
      • 🗂️Get Collections
      • 🪄Update Collection
      • 🪙Transfer ERC20
    • 🎛️Schema
  • More
    • 🏷️White Label Marketplaces
    • 🛒List Your Game on the Altura Marketplace
    • ☑️Get Your Collection Verified
    • 🎁Create a Loot Box
  • 🎮Unreal SDK (ALPHA)
    • 🛠️Installation (Alpha)
    • 🛡️Authenticate User
    • 👤Get User
    • 👥Get Users
    • 🖼️Get Item
    • 🌈Get Items
    • 👾Get an Item's Holders
    • 📜Get an Item's History
    • 📁Get Collection
    • 📂Get Collections
    • 🪙Get User ERC20 balance
Powered by GitBook
On this page
  • Usage in your script
  • Parameters

Was this helpful?

  1. JavaScript SDK
  2. Methods

Get User's Items

Use this method to get the items of a specific user.

Usage in your script

const response = await alturaUser.getItems();

// customize options
const response = await alturaUser.getItems({
  perPage: 20,
  page: 1,
  sortBy: 'mintDate',
  sortDir: 'desc',
  includeListed: false,
  slim: true,
});

// filter documents by any properties
const response = await alturaUser.getItems(
  {}, // default options
  {
    collectionAddress: "0xdb0047cb1dfc44696f6e9868ef6bb40000280b05"
  } // fetching items with the specified collection address only
)

const items = response.items;
const itemCount = response.count;
const response: { items: IAlturaItem[], count: number } = await alturaUser.getItems();

// customize options
const response: {items: IAlturaItem[], count: number} = await alturaUser.getItems({
  perPage: 20,
  page: 1,
  sortBy: 'mintDate',
  sortDir: 'desc',
  includeListed: false;
  slim: true;
  stateOnly: false;
});

// filter documents by any properties
const response: {items: IAlturaItem[], count: number} = await alturaUser.getItems(
  {}, // default options
  {
    collectionAddress: "0xdb0047cb1dfc44696f6e9868ef6bb40000280b05"
  } // fetching items with the specified collection address only
)

const items = response.items;
const itemCount = response.count;

Parameters

Parameter
Type
Required
Description

perPage

number

Optional

The number of items to return

page

number

Optional

The offset for returned items. Calculated as (page - 1) * perPage

sortBy

string

Optional

The field to sort the items by (any field in the item schema may be used)

sortDir

asc' | 'desc'

Optional

Choose to sort in ascending (asc) or descending (desc) order

includeLIsted

boolean

Optional

If the user's listed NFTs should be included (listed NFTs are still owned by the user, however on the blockchain they are held by a marketplace smart contract)

slim

boolean

Optional

Returns a more condensed version of the items. Limits the item schema to: name, properties, tokenId, collectionAddress, supply, maxSupply, image, imageUrl, imageIndex, and imageCount

PreviousGet UsersNextGet Item

Last updated 2 years ago

Was this helpful?

🔆
🔧
🖼️