The /v1/items/{projectId} route serves as a powerful interface to interact with items within a specified Metafuse project. Through this route, you can either retrieve existing items using the GET method or dynamically generate a new collection of items using the POST method, showcasing Metafuse’s innovative capacity for on-the-fly asset generation. Here’s a detailed breakdown of the available operations on this route:

  • GET Method:
    Facilitates the retrieval of items within the specified Metafuse project. Utilizing query parameters, users can fine-tune the request to list items based on ownership, traits filtering, or paginate through a large set of items.

    • projectId (required, path): A string representing the Metafuse ProjectID, pinpointing the project whose items are to be listed.
    • owner (optional, query): A string representing an address. When specified, lists all items owned by this address within the given project.
    • filter (optional, query): A string enabling trait-based filtering of items, like ?filter[Tier]=One or ?filter[Tier]=One&filter[Color]=Red.
    • lastEvaluatedKey (optional, query): A string returned from a previous query, allowing the fetching of paginated data for seamless navigation through large item sets.

    A successful query returns a 200 status code along with the list of items fulfilling the specified criteria. Conversely, a 400 status code is returned for client-side errors such as missing required parameters or an incorrect filter format.

  • POST Method:
    Enables the on-the-fly generation of an entire collection of assets within the specified Metafuse project, embodying the true innovative spirit of Metafuse.

    • projectId (required, path): The Metafuse ProjectID target for the new collection.
    • collectionSize (required, body): A number specifying the desired size of the new collection.
    • allowDuplicatesOverride (optional, body): A boolean flag to control the allowance of duplicate items, defaulted to false.

    A successful collection generation returns a 200 status code, indicating the successful creation of the new collection. A 400 status code is returned for client-side errors like missing required parameters or incorrect data format.

Click Try It! to start a request and see the response here!