这是与
features/inventory/economy 交互的主接口。
另见:
ISteamEconomy。
请参见
Web API 概览,进一步了解如何使用 Steamworks Web API。
GetHistoryCommandDetails
GET https://partner.steam-api.com/IGameInventory/GetHistoryCommandDetails/v1/
| 名称 | 类型 | 是否必需 | 描述 |
| key | string | ✔ | Steamworks Web API 发行商验证密钥。 |
| appid | uint32 | ✔ | 游戏的 appid。 |
| steamid | uint64 | ✔ | 操作目标帐户的 Steam ID。 |
| command | string | ✔ | 在该资产上运行的命令。 |
| contextid | uint64 | ✔ | 要获取历史记录的上下文。 |
| arguments | string | ✔ | 一开始与命令一起提供的参数。 |
注意: 此调用需要发行商 API 密钥以使用此方法。 因此,此 API
必须通过安全服务器调用,且绝不能由客户端直接调用!
GetUserHistory
GET https://partner.steam-api.com/IGameInventory/GetUserHistory/v1/
| 名称 | 类型 | 是否必需 | 描述 |
| key | string | ✔ | Steamworks Web API 发行商验证密钥。 |
| appid | uint32 | ✔ | 游戏的 appid。 |
| steamid | uint64 | ✔ | 要获取历史记录的 Steam ID。 |
| contextid | uint64 | ✔ | 要获取历史记录的上下文。 |
| starttime | uint32 | ✔ | 要获取的历史记录的开始时间。 |
| endtime | uint32 | ✔ | 要获取的历史记录的结束时间。 |
注意: 此调用需要发行商 API 密钥以使用此方法。 因此,此 API
必须通过安全服务器调用,且绝不能由客户端直接调用!
HistoryExecuteCommands
POST https://partner.steam-api.com/IGameInventory/HistoryExecuteCommands/v1/
| 名称 | 类型 | 是否必需 | 描述 |
| key | string | ✔ | Steamworks Web API 发行商验证密钥。 |
| appid | uint32 | ✔ | 游戏的 appid。 |
| steamid | uint64 | ✔ | 要操作的资产 ID。 |
| contextid | uint64 | ✔ | 要获取历史记录的上下文。 |
| actorid | uint32 | ✔ | 供客服人员执行命令的唯一 32 位 ID。 |
注意: 此调用需要发行商 API 密钥以使用此方法。 因此,此 API
必须通过安全服务器调用,且绝不能由客户端直接调用!
SupportGetAssetHistory
GET https://partner.steam-api.com/IGameInventory/SupportGetAssetHistory/v1/
| 名称 | 类型 | 是否必需 | 描述 |
| key | string | ✔ | Steamworks Web API 发行商验证密钥。 |
| appid | uint32 | ✔ | 游戏的 appid。 |
| assetid | uint64 | ✔ | 要操作的资产 ID。 |
| contextid | uint64 | ✔ | 要获取历史记录的上下文。 |
注意: 此调用需要发行商 API 密钥以使用此方法。 因此,此 API
必须通过安全服务器调用,且绝不能由客户端直接调用!
UpdateItemDefs
POST https://partner.steam-api.com/IGameInventory/UpdateItemDefs/v0001
| 名称 | 类型 | 是否必需 | 描述 |
| key | string | ✔ | Steamworks Web API 发行商验证密钥。 |
| appid | uint32 | ✔ | 游戏的 appid。 |
| itemdefs | JSON array | ✔ | 待更新或创建的一个或多个物品定义,以 JSON 数组显示。 |
响应此方法将以 JSON 对象输出。
- 响应
- success - 如果方法成功,为 true。 如果资产服务器返回 false,应将 error 设置为解释原因的字符串 。
- error - 描述为何此调用失败的字符串。 这条消息将记录在错误日志中,可在 Steamworks 站点的“经济体”选项卡下查看。
- failed - 此调用成功更新的物品定义 ID 数组。
代码示例curl --request POST \
--header "Content-Type: application/x-www-form-urlencoded" \
--form appid=30400 \
--form 'itemdefs=[{"appid":"30400","itemdefid":"418","type":"item","display_type":"bag","name":"Bag of Stuff","description":"This bag contains stuff.","background_color":"993300","tradable": true,"marketable": true,"commodity": true,"tags":"class:human;type:bag"}, {"appid": "30400","itemdefid":"403","type":"item","display_type":"cat","name":"Cat of Bags","description":"This cat contains multitudes."}]'
"https://api.steampowered.com/IGameInventory/UpdateItemDefs/v0001?key=xxxxxx"
输出示例{
"result": {
"updated": [
"418",
"403"
],
"failed": [],
"success": true
}
}