Using an item
This HTTP endpoint allows you to use a limited-use item belonging to a user. You must pass in the id of the item instance to use. This id can be obtained from the user's inventory. It is important to note that this is NOT the same as the item id which is returned from the items action. Calling this action on an unlimited use item will return failure, since that operation is not supported.
POST url: http://www.kongregate.com/api/use_item.json required params: api_key: The api key assigned to your game game_auth_token: The game_auth_token for the user user_id: The user id of the user id: The id (from the user's inventory) of the item instance to use 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 only if successful: remaining_uses: The new amount of remaining uses for the item instance. usage_record_id: The unique id of the usage record for this transaction.
Example: Use a limited-use item
POST http://www.kongregate.com/api/use_item.json
POST data:
api_key=MyApiKey
game_auth_token=GameAuthToken
user_id=765
id=101
{success:true, remaining_uses:9, usage_record_id:7653}
Comments