Kongregate Developers

Request User Items

This HTTP endpoint allows you to request the list of items that belong to a user. These are referred to as item instances. Item instances will only be returned by this method if they have remaining uses, or are unlimited-use items. This should be done after receiving a callback or successful transaction event, as well as each time the game loads in order to check for un-credited items in the inventory.

Note: This call should only be made from a server. To retrieve a user's items from your client, see the requestUserItemList method.

GET url: http://www.kongregate.com/api/user_items.json
Required params:
  • api_key: The api key assigned to your game
  • user_id: The user_id of the user to request items for
Response fields:
  • success:True/false depending on if the request was successful
  • error: Error code integer, if any
  • error_description: Error code description string, if any
If successful:
  • items: An array of item instance objects
    • id: Unique integer id for the owned item instance
    • identifier: String identifier for the item
    • name: Name of the item
    • description: Description of the item
    • remaining_uses: The number of remaining uses for this item, or null for unlimited
    • data: The optional string of metadata you attached to the instance at checkout time

Example: Request all items for a user

GET https://api.kongregate.com/api/user_items.json?api_key=MyApiKey&user_id=765
{
  "success": true,
  "items": [
    {
      "id": 100,
      "identifier": "sharp-sword",
      "name": "Sharp Sword",
      "description": "A sharp sword",
      "remaining_uses": null,
      "data": null
    },
    {
      "id": 101,
      "identifier": "potion",
      "name": "Potion",
      "description": "A Healing Potion",
      "remaining_uses": 10,
      "data": null
    }
  ]
}

Comments