{"__v":0,"_id":"57082b6f13a3340e004e707a","category":{"__v":0,"_id":"5705b12221cfed0e00e8c580","project":"56abbf55f25f160d00e17f4e","version":"56abbf55f25f160d00e17f51","sync":{"url":"","isSync":false},"reference":true,"createdAt":"2016-04-07T01:00:18.230Z","from_sync":false,"order":4,"slug":"server-side-api","title":"Server Side API"},"editedParams":true,"editedParams2":true,"parentDoc":null,"project":"56abbf55f25f160d00e17f4e","user":"56abbec30b9e0b0d00616274","version":{"__v":12,"_id":"56abbf55f25f160d00e17f51","project":"56abbf55f25f160d00e17f4e","createdAt":"2016-01-29T19:36:53.665Z","releaseDate":"2016-01-29T19:36:53.665Z","categories":["56abbf56f25f160d00e17f52","56abca6bf9757e0d007c6650","56acddfa0ab3c00d00ce3332","56af65da9d32e30d0006d30f","56af66cab34d210d003d9ad0","56af6afcd21e9c0d00b628d1","56af6d6ecc4cbd0d00ce2c88","5705b12221cfed0e00e8c580","570a5676ade45d0e00c1ad33","570d7d25d1e4b82000d9e385","570eac3c3160d10e0041df0e","575709000fd6a3200010dded"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-04-08T22:06:39.979Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"code":"curl -XGET -H \"Content-type: application/json\" -d '{\n  \"api_key\": \"GAMEAPIKEY\",\n  \"user_id\": 32,\n  \"game_auth_token\": \"TOKEN\",\n  \"id\": 123456789\n}' 'https://api.kongregate.com/api/use_item.json'","language":"curl","name":"Use an Item"}]},"method":"post","results":{"codes":[{"name":"Use an Item","code":"{\n  \"success\": true,\n  \"remaining_uses\": 9,\n  \"usage_record_id\": 7653\n}","language":"json","status":200}]},"settings":"5707e879cfc0992200c2a419","auth":"required","params":[{"_id":"57082b6f13a3340e004e707e","ref":"","in":"body","required":true,"desc":"Your private API key","default":"","type":"string","name":"api_key"},{"_id":"57082b6f13a3340e004e707d","ref":"","in":"body","required":true,"desc":"The Kongregate user ID of the owner of the item","default":"","type":"int","name":"user_id"},{"_id":"57082b6f13a3340e004e707c","ref":"","in":"body","required":true,"desc":"The game_auth_token for the user","default":"","type":"string","name":"game_auth_token"},{"_id":"57082b6f13a3340e004e707b","ref":"","in":"body","required":true,"desc":"The item instance ID","default":"","type":"int","name":"id"}],"url":"/use_item.json"},"isReference":true,"order":8,"body":"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.\n\n**Note:** \n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Note\",\n  \"body\": \"This method is to be called from a server only. If, _and only if_, the game is client-side only with no server, you will need to use our [client API call](doc:client-api-services-useiteminstance) to consume items.\"\n}\n[/block]","excerpt":"Use a consumable item from a user's inventory","slug":"server-api-use-item","type":"endpoint","title":"Items - Consume"}

postItems - Consume

Use a consumable item from a user's inventory

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

api_key:
required
string
Your private API key
user_id:
required
integer
The Kongregate user ID of the owner of the item
game_auth_token:
required
string
The game_auth_token for the user
id:
required
integer
The item instance ID

Examples


Result Format


Documentation

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. **Note:** [block:callout] { "type": "info", "title": "Note", "body": "This method is to be called from a server only. If, _and only if_, the game is client-side only with no server, you will need to use our [client API call](doc:client-api-services-useiteminstance) to consume items." } [/block]

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}