Interface usada para acessar o
serviço de inventário Steam.
AVISO: esta é uma interface de serviço; os métodos devem ser chamados com o parâmetro
input_json
.
Para mais informações sobre como usar a Web API do Steamworks, consulte a
Visão geral da Web API.
AddItem
POST https://partner.steam-api.com/IInventoryService/AddItem/v1/
Nome | Tipo | Obrigatório | Descrição |
key | string | ✔ | Chave de autenticação da distribuidora para a Web API do Steamworks. |
appid | uint32 | ✔ | O ID do aplicativo associado ao item. |
itemdefid | uint64 | ✔ | Lista de IDs de definição de item a conceder. Deve ser especificado como uma série de parâmetros de nomes "itemdefid[0]", "itemdefid[1]" etc. |
itempropsjson | string | ✔ | |
steamid | uint64 | ✔ | O ID Steam do usuário que receberá os itens. |
notify | bool | ✔ | Opcional, valor padrão: 0. Defina como 1 para indicar que o jogador não está no jogo e deve ser notificado pelo Steam. |
requestid | uint64 | ✔ | Opcional, valor padrão: 0. Clientes podem informar um identificador único para que uma requisição seja executada no máximo uma vez. Quando um ID de requisição é reenviado, o processamento não será realizado novamente; a mensagem de resposta conterá o estado atual dos itens afetados pela execução original. |
trade_restriction | bool | ✔ | Opcional, valor padrão: 0. Defina como 1 para que o Steam aplique uma restrição de troca e comercialização no Mercado da Comunidade Steam se for um item comprado. |
O método AddItem é usado para adicionar itens novos diretamente ao inventário de um usuário. Para cada definição de item, uma instância do tipo é criada e adicionada à conta-alvo.
Itens do tipo "bundle" ou "generator" são desempacotados no momento da adição. A mensagem de resposta conterá os dados dos itens finais adicionados ao inventário.
A chamada falhará se a definição de item não existir, não puder ser desempacotada ou se o jogador-alvo não tiver permissão para o AppID informado.
A notificação de um novo item, se houver, é melhor tratada pelo cliente do jogo. Chamadas ao método AddItem que ocorrerem quando o jogador não estiver em jogo podem definir
notify=1
para que o jogador seja notificado pelo Steam, o que pode ativar qualquer mecanismo de notificação no Steam, incluindo um pop-up no painel.
O parâmetro opcional
requestid
permite que um cliente faça uma chamada idempotente. Se o cliente não tiver certeza de que uma requisição foi concluída com sucesso no servidor, ele pode refazê-la com o ID original.
Se a requisição for refeita, a resposta incluirá o estado atual dos itens afetados pela requisição original sem realizar mais alterações.
Se a requisição original falhar no servidor, repetir o mesmo ID de requisição fará com que o sistema tente realizar o processamento novamente em vez de simplesmente retornar o erro anterior.
If the user owns your app from a free license and has not played in the last 30 days, AddItem will also fail.
AVISO: This call requires a publisher API key to use this method. As such this API
MUST be called from a secure server, and can never be used directly by clients!
Resposta: -
response
-
success
— True se bem-sucedida. Se o servidor de ativos está retornando false, o parâmetro error
deve conter uma string com o motivo;
-
error
— Uma string que descreve o motivo da falha da chamada. A mensagem será armazenada no relatório de erro, disponível na aba Economia do painel de administração de aplicativo no site do Steamworks;
-
item_json
— um vetor com os detalhes dos itens recém-criados, em um formato JSON que contém as propriedades de cada um;
-
replayed
— se true, indica que o ID de requisição foi processado anteriormente, e a resposta é baseada na execução original. Não fará parte da resposta se um ID de requisição não for especificado.
Exemplo de resposta:{
"response": {
"item_json":
"[{ \"accountid\":\"148618792083651397\",\"itemid\":\"17209346500926339\",\"Timestamp\":\"\",\"originalitemid\":\"17209346500926339\",\"itemdefid\":\"120\",\"appid\":480,\"position\":0,\"quantity\":1,\"transid\":\"\",\"state\":\"\",\"origin\":\"external\",\"price\":\"\",\"acquired\":\"20140912T195537Z\"}]"
}
}
Exemplo de chamada:curl -X POST -H "Content-Type: application/x-www-form-urlencoded" \
-d appid=480 \
-d steamid=292733980074050545 \
-d itemdefid[0]=4111 \
-d itemdefid[1]=4112 \
"http://api.steampowered.com/IInventoryService/AddItem/v1?key=xxxxxx"
AddPromoItem
POST https://partner.steam-api.com/IInventoryService/AddPromoItem/v1/
Nome | Tipo | Obrigatório | Descrição |
key | string | ✔ | Chave de autenticação da distribuidora para a Web API do Steamworks. |
appid | uint32 | ✔ | |
itemdefid | uint64 | | |
steamid | uint64 | ✔ | |
notify | bool | | Se o usuário deve ser notificado da adição do item ao inventário Steam. |
requestid | uint64 | Clients may provide a unique identifier for a request to perform at most once execution. When a requestid is resubmitted, it will not cause the work to be performed again; the response message will be the current state of items affected by the original successful execution. | |
Adds a promo item to a user's inventory. If called without the itemdefid parameter, checks for and grants available promo items for the given player.
AVISO: This call requires a publisher API key to use this method. As such this API
MUST be called from a secure server, and can never be used directly by clients!
ConsumeItem
POST https://partner.steam-api.com/IInventoryService/ConsumeItem/v1/
Nome | Tipo | Obrigatório | Descrição |
key | string | ✔ | Chave de autenticação da distribuidora para a Web API do Steamworks. |
appid | uint32 | ✔ | |
itemid | uint64 | ✔ | ID do item a consumir. |
quantity | string | ✔ | A quantidade de itens do agrupamento a consumir. |
steamid | uint64 | ✔ | |
requestid | uint64 | ✔ | Clients may provide a unique identifier for a request to perform at most once execution. When a requestid is resubmitted, it will not cause the work to be performed again; the response message will be the current state of items affected by the original successful execution. |
Marks an item as wholly or partially consumed. This action cannot be reversed.
AVISO: This call requires a publisher API key to use this method. As such this API
MUST be called from a secure server, and can never be used directly by clients!
A client SDK version of this call is also available:
ISteamInventory::ConsumeItemExchangeItem
POST https://partner.steam-api.com/IInventoryService/ExchangeItem/v1/
Nome | Tipo | Obrigatório | Descrição |
key | string | ✔ | Chave de autenticação da distribuidora para a Web API do Steamworks. |
appid | uint32 | ✔ | O ID do aplicativo associado ao item. |
steamid | uint64 | ✔ | O ID Steam do jogador proprietário dos itens. |
materialsitemid | uint64 | ✔ | O ID único de um item no inventário do jogador a converter ao tipo-alvo. Deve ser informado como materialsitemid[0] , materialsitemid[1] etc. |
materialsquantity | uint32 | ✔ | A quantidade do item correspondente a usar na receita. O vetor deve ser do mesmo tamanho de materialsitemid . |
outputitemdefid | uint64 | ✔ | A definição do item a criar. |
ExchangeItem is used for crafting - converting items using a predefined recipe. A successful exchange destroys the set of items required by the crafting recipe, and adds a new instance of the target itemdef to the player's inventory.
The target item definition must have one or more crafting recipes declared in the
exchange
attribute. Recipes declare the number and type of items required to create the target item. If the set of items provided in the ExchangeItems call does not satisfy any recipe, the call fails and no changes are made to the inventory.
See the Inventory Service
Schema documentation for more detail on crafting recipes.
The crafting operation will take trade and market restrictions into account; the created item will have the latest trade restriction of any item used to create it.
If successful, this call returns an encoded JSON blob that lists the items that were changed by this call - the consumed items and the newly created one.
AVISO: Nunca distribua a sua chave da API Steam com o jogo. A API deve ser chamada a partir de um servidor seguro, nunca a partir de clientes.
A client SDK version of this call is also available:
ISteamInventory::ExchangeItemsResposta: -
response
-
item_json
— detalhes de todos os itens afetados pela permuta. Retornado como uma string que contém um JSON codificado com todas as propriedades dos itens. Retorna um vetor vazio para permutas que resultaram em falha.
Exemplo de resposta:{
"response": {
"item_json":
"[{ \"accountid\":\"292733980074050545\",\"itemid\":\"1503713096879725\",\"itemdefid\":\"4111\",\"state\":\"removed\" ...
}
}
Exemplo de chamada:curl --request POST \
--header 'content-type: multipart/form-data' \
--form appid=30400 \
--form 'materialsitemid[0]=1510699974025744' \
--form 'materialsitemid[1]=1510699974025745' \
--form 'materialsitemid[2]=1510699974025746' \
--form 'materialsquantity[0]=1' \
--form 'materialsquantity[1]=1' \
--form 'materialsquantity[2]=5' \
--form steamid=292733980074050545 \
--form outputitemdefid=4111 \
https://api.steampowered.com/IInventoryService/ExchangeItem/v1?key=xxxxxxxxxx'
GetInventory
GET https://partner.steam-api.com/IInventoryService/GetInventory/v1/
Nome | Tipo | Obrigatório | Descrição |
key | string | ✔ | Chave de autenticação da distribuidora para a Web API do Steamworks. |
appid | uint32 | ✔ | O ID do aplicativo associado ao item. |
steamid | uint64 | ✔ | O ID Steam de 64 bits do usuário cujo inventário recuperar. |
GetInventory is used to retrieve a user's inventory.
AVISO: This call requires a publisher API key to use this method. As such this API
MUST be called from a secure server, and can never be used directly by clients!
Resposta: -
response
-
success
— True se bem-sucedida. Se o servidor de ativos está retornando false, o parâmetro error
deve conter uma string com o motivo;
-
error
— Uma string que descreve o motivo da falha da chamada. A mensagem será armazenada no relatório de erro, disponível na aba "Economia" do painel de administração de aplicativo no site do Steamworks;
-
item_json
— um vetor com os detalhes de cada item no inventário. Cada entrada é uma string que contém JSON codificado com as propriedades dos itens.
For detailed description on the output values, refer to the
Core Schema documentation.
Exemplo de resposta:{
"response": {
"item_json":
"[{ \"accountid\":\"xxxxx\",\"itemid\":\"17212166272724458\",\"Timestamp\":\"2014-10-13T22:41:00.4928464Z\",\"originalitemid\":\"17212166272724458\",\"itemdefid\":\"120\",\"appid\":480,\"position\":0,\"quantity\":1,\"transid\":\"\",\"state\":\"\",\"origin\":\"external\",\"price\":\"\",\"acquired\":\"20141013T224100Z\"},
{ \"accountid\":\"xxxxx\",\"itemid\":\"17212166272732706\",\"Timestamp\":\"2014-10-13T22:42:50.1328464Z\",\"originalitemid\":\"17212166272732706\",\"itemdefid\":\"121\",\"appid\":480,\"position\":0,\"quantity\":1,\"transid\":\"\",\"state\":\"\",\"origin\":\"external\",\"price\":\"\",\"acquired\":\"20141013T224250Z\"}
]"
}}
Exemplo de chamada:$fields = array(
'appid' > '480',
'itemlist[0]' > '120',
'itemorigin' > '',
'steamid' > 'xxxxx',
'key' > 'xxxx'
);
var_dump($fields);
$ch = curl_init();
curl_setopt( $ch, CURLOPT_URL, $host.'/IInventoryService/GetInventory/v1?appid=480&steamid=xxxxx&key=yyyyyy' );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
$data = curl_exec( $ch );
var_dump($data);
GetItemDefs
GET https://partner.steam-api.com/IInventoryService/GetItemDefs/v1/
Nome | Tipo | Obrigatório | Descrição |
key | string | ✔ | Chave de autenticação da distribuidora para a Web API do Steamworks. |
appid | uint32 | ✔ | O ID do aplicativo associado ao item. |
modifiedsince | string | ✔ | Use para recuperar apenas atualizações às definições de itens realizadas após dado horário, no formato yyyymmddThhmmssZ (ex.: 20140808T010203Z). |
itemdefids | uint64 | ✔ | Use para recuperar apenas definições de itens com os IDs informados. |
workshopids | uint64 | ✔ | Use para recuperar apenas definições de itens com os IDs da Oficina informados. |
cache_max_age_seconds | uint32 | | Permite o retorno de dados recuperados até a quantidade de segundos informada atrás. |
GetItemDefs is used to retrieve the itemdefs for a given application.
AVISO: This call requires a publisher API key to use this method. As such this API
MUST be called from a secure server, and can never be used directly by clients!
Resposta: -
response
-
success
— True se bem-sucedida. Se o servidor de ativos está retornando false, o parâmetro error
deve conter uma string com o motivo;
-
error
— Uma string que descreve o motivo da falha da chamada. A mensagem será armazenada no relatório de erro, disponível na aba Economia do painel de administração de aplicativo no site do Steamworks;
-
itemdef_json
— um vetor com os detalhes do item recém-criado. Cada entrada é uma string que contém JSON codificado com as propriedades dos itens.
Exemplo de resposta:{ "response":
{ "itemdef_json":"[
{ \"appid\":\"480\",\"itemdefid\":\"10\",\"Timestamp\":\"2014-09-12T01:29:10.4628321Z\",\"modified\":\"20140808T010203Z\",\"type\":\"generator\",\"name\":\"Drop Generator/",/"bundle/":/"100x100;101x50;102x25;103x2;110x20;111x20;120x5;121x3/",/"price/":/"/",/"quantity/":0,/"description/":/"/",/"background_color/":/"3C352E/",/"icon_url/":/"http://cdn.beta.steampowered.com/apps/440/icons/c_fireaxe_pyro_xmas_large.fa878752e1aa09a721a03042a234063b6c929278.png/",/"icon_url_large/":/"http://cdn.beta.steampowered.com/apps/440/icons/c_fireaxe_pyro_xmas_large.fa878752e1aa09a721a03042a234063b6c929278.png/",/"market_name/":/"Drop Generator\",\"market_hash_name\":\"Drop Generator\",\"name_color\":\"7D6D00\",\"workshopid\":\"0\",\"flags\":1,\"game_type\":\"generator\",\"itemslot\":\"generator\"},
{ \"appid\":\"480\",\"itemdefid\":\"100\",\"Timestamp\":\"2014-09-12T01:28:44.4816369Z\",\"modified\":\"20140808T010203Z\",\"type\":\"item\",\"name\":\"Plus ship decoration/",/"bundle/":/"/",/"price/":/"/",/"quantity/":0,/"description/":/"/",/"background_color/":/"3C352E/",/"icon_url/":/"http://cdn.beta.steampowered.com/apps/440/icons/c_fireaxe_pyro_xmas_large.fa878752e1aa09a721a03042a234063b6c929278.png/",/"icon_url_large/":/"http://cdn.beta.steampowered.com/apps/440/icons/c_fireaxe_pyro_xmas_large.fa878752e1aa09a721a03042a234063b6c929278.png/",/"market_name/":/"Plus ship decoration\",\"market_hash_name\":\"Plus ship decoration\",\"name_color\":\"7D6D00\",\"workshopid\":\"0\",\"flags\":1,\"game_type\":\"decoration\",\"itemslot\":\"decoration\"},
{ \"appid\":\"480\",\"itemdefid\":\"101\",\"Timestamp\":\"2014-09-12T01:29:25.5198429Z\",\"modified\":\"20140808T010203Z\",\"type\":\"item\",\"name\":\"Star ship decoration/",/"bundle/":/"/",/"price/":/"/",/"quantity/":0,/"description/":/"/",/"background_color/":/"3C352E/",/"icon_url/":/"http://cdn.beta.steampowered.com/apps/440/icons/c_fireaxe_pyro_xmas_large.fa878752e1aa09a721a03042a234063b6c929278.png/",/"icon_url_large/":/"http://cdn.beta.steampowered.com/apps/440/icons/c_fireaxe_pyro_xmas_large.fa878752e1aa09a721a03042a234063b6c929278.png/",/"market_name/":/"Star ship decoration\",\"market_hash_name\":\"Star ship decoration\",\"name_color\":\"7D6D00\",\"workshopid\":\"0\",\"flags\":1,\"game_type\":\"decoration\",\"itemslot\":\"decoration\"},
{ \"appid\":\"480\",\"itemdefid\":\"102\",\"Timestamp\":\"2014-09-12T01:29:33.6544695Z\",\"modified\":\"20140808T010203Z\",\"type\":\"item\",\"name\":\"Stripe ship decoration/",/"bundle/":/"/",/"price/":/"/",/"quantity/":0,/"description/":/"/",/"background_color/":/"3C352E/",/"icon_url/":/"http://cdn.beta.steampowered.com/apps/440/icons/c_fireaxe_pyro_xmas_large.fa878752e1aa09a721a03042a234063b6c929278.png/",/"icon_url_large/":/"http://cdn.beta.steampowered.com/apps/440/icons/c_fireaxe_pyro_xmas_large.fa878752e1aa09a721a03042a234063b6c929278.png/",/"market_name/":/"Stripe ship decoration\",\"market_hash_name\":\"Stripe ship decoration\",\"name_color\":\"7D6D00\",\"workshopid\":\"0\",\"flags\":1,\"game_type\":\"decoration\",\"itemslot\":\"decoration\"},
{ \"appid\":\"480\",\"itemdefid\":\"103\",\"Timestamp\":\"2014-09-12T01:29:39.5676519Z\",\"modified\":\"20140808T010203Z\",\"type\":\"item\",\"name\":\"Hat ship decoration/",/"bundle/":/"/",/"price/":/"1;USD99/",/"quantity/":0,/"description/":/"/",/"background_color/":/"3C352E/",/"icon_url/":/"http://cdn.beta.steampowered.com/apps/440/icons/c_fireaxe_pyro_xmas_large.fa878752e1aa09a721a03042a234063b6c929278.png/",/"icon_url_large/":/"http://cdn.beta.steampowered.com/apps/440/icons/c_fireaxe_pyro_xmas_large.fa878752e1aa09a721a03042a234063b6c929278.png/",/"market_name/":/"Hat ship decoration\",\"market_hash_name\":\"Hat ship decoration\",\"name_color\":\"7D6D00\",\"workshopid\":\"0\",\"flags\":1,\"game_type\":\"decoration\",\"itemslot\":\"decoration\"},
{ \"appid\":\"480\",\"itemdefid\":\"110\",\"Timestamp\":\"2014-09-12T01:29:44.0715525Z\",\"modified\":\"20140808T010203Z\",\"type\":\"item\",\"name\":\"Doublefire gun/",/"bundle/":/"/",/"price/":/"/",/"quantity/":0,/"description/":/"/",/"background_color/":/"3C352E/",/"icon_url/":/"http://cdn.beta.steampowered.com/apps/440/icons/c_fireaxe_pyro_xmas_large.fa878752e1aa09a721a03042a234063b6c929278.png/",/"icon_url_large/":/"http://cdn.beta.steampowered.com/apps/440/icons/c_fireaxe_pyro_xmas_large.fa878752e1aa09a721a03042a234063b6c929278.png/",/"market_name/":/"Doublefire gun\",\"market_hash_name\":\"Doublefire gun\",\"name_color\":\"7D6D00\",\"workshopid\":\"0\",\"flags\":1,\"game_type\":\"weapon\",\"itemslot\":\"weapon\"},
{ \"appid\":\"480\",\"itemdefid\":\"111\",\"Timestamp\":\"2014-09-12T01:29:48.9635307Z\",\"modified\":\"20140808T010203Z\",\"type\":\"item\",\"name\":\"Fastfire gun/",/"bundle/":/"/",/"price/":/"/",/"quantity/":0,/"description/":/"/",/"background_color/":/"3C352E/",/"icon_url/":/"http://cdn.beta.steampowered.com/apps/440/icons/c_fireaxe_pyro_xmas_large.fa878752e1aa09a721a03042a234063b6c929278.png/",/"icon_url_large/":/"http://cdn.beta.steampowered.com/apps/440/icons/c_fireaxe_pyro_xmas_large.fa878752e1aa09a721a03042a234063b6c929278.png/",/"market_name/":/"Fastfire gun\",\"market_hash_name\":\"Fastfire gun\",\"name_color\":\"7D6D00\",\"workshopid\":\"0\",\"flags\":1,\"game_type\":\"weapon\",\"itemslot\":\"weapon\"},
{ \"appid\":\"480\",\"itemdefid\":\"120\",\"Timestamp\":\"2014-09-12T01:29:52.9633305Z\",\"modified\":\"20140808T010203Z\",\"type\":\"item\",\"name\":\"Cloaking field/",/"bundle/":/"/",/"price/":/"/",/"quantity/":0,/"description/":/"/",/"background_color/":/"3C352E/",/"icon_url/":/"http://cdn.beta.steampowered.com/apps/440/icons/c_fireaxe_pyro_xmas_large.fa878752e1aa09a721a03042a234063b6c929278.png/",/"icon_url_large/":/"http://cdn.beta.steampowered.com/apps/440/icons/c_fireaxe_pyro_xmas_large.fa878752e1aa09a721a03042a234063b6c929278.png/",/"market_name/":/"Cloaking field\",\"market_hash_name\":\"Cloaking field\",\"name_color\":\"7D6D00\",\"workshopid\":\"0\",\"flags\":1,\"game_type\":\"power\",\"itemslot\":\"power\"},
{ \"appid\":\"480\",\"itemdefid\":\"121\",\"Timestamp\":\"2014-09-12T01:30:00.0237423Z\",\"modified\":\"20140808T010203Z\",\"type\":\"item\",\"name\":\"Shield generator/",/"bundle/":/"/",/"price/":/"/",/"quantity/":0,/"description/":/"/",/"background_color/":/"3C352E/",/"icon_url/":/"http://cdn.beta.steampowered.com/apps/440/icons/c_fireaxe_pyro_xmas_large.fa878752e1aa09a721a03042a234063b6c929278.png/",/"icon_url_large/":/"http://cdn.beta.steampowered.com/apps/440/icons/c_fireaxe_pyro_xmas_large.fa878752e1aa09a721a03042a234063b6c929278.png/",/"market_name/":/"Shield generator\",\"market_hash_name\":\"Shield generator\",\"name_color\":\"7D6D00\",\"workshopid\":\"0\",\"flags\":1,\"game_type\":\"power\",\"itemslot\":\"power\"}
]" } }
Exemplo de chamada:$ch = curl_init();
curl_setopt( $ch, CURLOPT_URL, 'https://api.steampowered.com/IInventoryService/GetItemDefs/v1?appid=480&modifiedsince=&itemdefids=&workshopids=&steamid=xxxx&key=xxxxx' );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
$data = curl_exec( $ch );
echo $data . '<br>';
$output = json_decode( $data );
$itemdef = json_decode( $output->response->itemdef_json );
var_dump( $itemdef );
GetPriceSheet
GET https://api.steampowered.com/IInventoryService/GetPriceSheet/v1/
Nome | Tipo | Obrigatório | Descrição |
key | string | ✔ | Chave de autenticação do usuário para a Web API do Steamworks. |
ecurrency | int32 | ✔ | |
Get the Inventory Service price sheet
Consolidate
POST https://partner.steam-api.com/IInventoryService/Consolidate/v1/
Nome | Tipo | Obrigatório | Descrição |
key | string | ✔ | Chave de autenticação da distribuidora para a Web API do Steamworks. |
appid | uint32 | ✔ | |
steamid | uint64 | ✔ | |
itemdefid | vetor de uint64 | ✔ | |
force | bool | | |
Consolidate items of the given type within an user's inventory.
Whenever items are combined into a stack, the resulting stack takes the market and trade restriction values of the most-restricted item. The Consolidate action ignores any item with an active market or trade restriction, unless 'force' is set to true.
AVISO: This call requires a publisher API key to use this method. As such this API
MUST be called from a secure server, and can never be used directly by clients!
GetQuantity
GET https://partner.steam-api.com/IInventoryService/GetQuantity/v1/
Nome | Tipo | Obrigatório | Descrição |
key | string | ✔ | Chave de autenticação da distribuidora para a Web API do Steamworks. |
appid | uint32 | ✔ | |
steamid | uint64 | ✔ | |
itemdefid | uint64[] | ✔ | Lista de IDs de definição de item a consultar. Deve ser especificado como uma série de parâmetros de nomes "itemdefid[0]", "itemdefid[1]" etc. |
force | bool | | |
Get the total number of available items of the given type
AVISO: This call requires a publisher API key to use this method. As such this API
MUST be called from a secure server, and can never be used directly by clients!
ModifyItems
POST https://partner.steam-api.com/IInventoryService/ModifyItems/v1/
Nome | Tipo | Obrigatório | Descrição |
key | string | ✔ | Chave de autenticação da distribuidora para a Web API do Steamworks. |
appid | uint32 | ✔ | |
input_json | string | ✔ | |
steamid | uint64 | ✔ | ID Steam do usuário proprietário dos itens. Deve ser especificado no parâmetro input_json . |
timestamp | uint32 | ✔ | Horário da requisição, no formato de Era Unix. Um erro será retornado se os itens foram modificados depois desse horário. Deve ser especificado no parâmetro input_json . |
updates | message | ✔ | Lista de itens e propriedades a modificar. Deve ser especificado no parâmetro input_json . |
Structure of the
updates
property:
Nome | Tipo | Obrigatório | Descrição |
itemid | uint64 | ✔ | ID do item a ser alterado. |
property_name | string | ✔ | O nome da propriedade dinâmica a adicionar/alterar/remover. |
property_value_string | string | | A string da propriedade a definir. |
property_value_bool | bool | | O valor booleano da propriedade a definir. |
property_value_int | int64 | | O inteiro de 64 bits da propriedade a definir. |
property_value_float | string | | O número de ponto flutuante de 32 bits da propriedade a definir. |
remove_property | bool | | True se a propriedade deve ser removida. |
Modify the
dynamic properties on items for the given user. This call is rate-limited per user and currently only 100 items can be modified in one call.
Exemplo de input_json
:
{
"steamid": "76561197970323416",
"timestamp": 1513274037,
"updates": [
{
"itemid": "1",
"property_name": "efeito",
"property_value_string": "chamas_azuis"
},
{
"itemid": "1",
"property_name": "qualidade",
"property_value_string": "alta"
},
{
"itemid": "1",
"property_name": "cor",
"remove_property": true
}
]
}
Exemplo de chamada:curl --request POST \
--header 'content-type: multipart/form-data' \
--form appid=30400 \
--form 'input_json={ "steamid" : "76561197970323416", "timestamp" : 1513274037, "updates" : [] }' \
https://api.steampowered.com/IInventoryService/ModifyItems/v1?key=xxxxxxxxxx'
AVISO: This call requires a publisher API key to use this method. As such this API
MUST be called from a secure server, and can never be used directly by clients!