Difference between revisions of "WebAPI/GetUGCFileDetails"

From Team Fortress Wiki
Jump to: navigation, search
(Creating article)
 
(The method written for generating the ID is a bit roundabout, generally people use bitshifting in most languages. Which is why we assume prior knowledge. Thanks for halp)
Line 13: Line 13:
 
:;size: Size of the file
 
:;size: Size of the file
  
== Fetching decals ==
+
;{{API optional|status}}: Object returned on non-HTTP errors
 +
:;code: Integer identifying error that occurred, currently '''9''' is the only known return value which means that the file with the given ID was not found.
  
This WebAPI method can be used to find the image applied with a [[Decal Tool]] on any of the supported items (which are currently [[Flair!]], the [[Photo Badge]], the [[Clan Pride]] and the [[Conscientious Objector]]). The '''ugcid''' parameter can be found using the [[WebAPI/GetPlayerItems|GetPlayerItems]] WebAPI method under the attributes 152 and 227. Each one of these two attributes constitutes a part of the full id: attribute 152 is the lowest bit and attribute 227 is the highest bit.
+
== Notes ==
 +
 
 +
This request is used to fetch file information for given UGC files. Currently certain items found in a player's backpack that can  have a custom texture applied to a part of them have attributes attached used for generating the 64 bit ID. The attribute values for generating the ID are stored in two attributes for portability reasons: '''custom texture lo''' is the low word, and '''custom texture hi''' is the high word.
  
To get from these two numbers to the full UGC id, you can convert both numbers from decimal to hexadecimal, append both hexadecimal strings together and then convert back to decimal. Here's an example:
 
                                  decimal                          hexadecimal
 
  lowest bit (attribute 152)      540654637                        0x2039BC2D
 
  highest bit (attribute 227)      122214424                        0x748D818
 
  full UGC id                      524906954720132141              0x748D8182039BC2D
 
 
 
 
{{Languages|WebAPI/GetUGCFileDetails}}
 
{{Languages|WebAPI/GetUGCFileDetails}}
  
 
[[Category:WebAPI]]
 
[[Category:WebAPI]]

Revision as of 21:45, 13 May 2012

URL

http://api.steampowered.com/ISteamRemoteStorage/GetUGCFileDetails/v1/

Method-specific parameters

steamid (Optional)
If specified, only returns details if the file is owned by the SteamID specified
ugcid
ID of UGC file to get info for
appid
appID of product

Result data

data
Array containing the file information
filename
Path to the file along with its name
url
URL to the file
size
Size of the file
status (Optional)
Object returned on non-HTTP errors
code
Integer identifying error that occurred, currently 9 is the only known return value which means that the file with the given ID was not found.

Notes

This request is used to fetch file information for given UGC files. Currently certain items found in a player's backpack that can have a custom texture applied to a part of them have attributes attached used for generating the 64 bit ID. The attribute values for generating the ID are stored in two attributes for portability reasons: custom texture lo is the low word, and custom texture hi is the high word.