JavaScript is required to use Bungie.net

Group Avatar

BungieNetPlatform

"Updates, discussions, and documentation of the BungieNetPlatform API."

Request Join
originally posted in:BungieNetPlatform
Edited by lowlines: 8/13/2015 12:25:34 AM
0

How to Read the Manifest 2.0 (Reference)

A while ago, I wrote a [url=https://www.bungie.net/en/Clan/Post/39966/105901734/0/0]post[/url] showing how I was pulling information from the mobile manifest using PHP at the time. It turned out however, that it was way more efficient to just poll queries directly to the database file rather than trying to extract it out into your own format that might not be good for a large number of table entries (ie DestinyInventoryItemDefinition). This new solution should work for any table definition without needing to know the key/id column. I have added it above my old PHP solution on the [url=http://bungienetplatform.wikia.com/wiki/Manifest]Wikia Manifest page[/url] and you should be able to copy/paste and run it without needing any other code. It's worth noting there's a variable at the top for entering your API Key as this will be required eventually even for getting the manifest. I have tried to separate each task into a separate function to try and make it more clear what's going on, but the only functions you would really interact with are checkManifest (which you should call once first before making any database requests), getDefinition, and getSingleDefinition. You might want to create shorthand names for table names, but I have left this out for the sake of keeping it as simple as possible. [edit] Here's a run down of what the code does: - Request the latest manifest /Platform/Destiny/Manifest, (note: doRequest can be used for any API request) - Check to see whether the language specific database filename has changed - If it has, download and extract the compressed database file and remember where it is - Run a table query and create a list of tables with the columns they contain (ie "DestinyInventoryItemDefinition": ["id", "json"]) and save this for later - Example 1 [GetSingleDefinition]: Do a Single Definition query for the Gjallarhorn by querying against the first column and properly formatting the ID, (ie if it is a string, wrap it in quotes, if it is a hash, include both signed and unsigned versions of the id as some platforms might format it differently, the CASE query thing didn't work for me...) - Example 2 [GetDefinition]: Grab the entire DestinyInventoryBucketDefinition

Posting in language:

 

Play nice. Take a minute to review our Code of Conduct before submitting your post. Cancel Edit Create Fireteam Post

You are not allowed to view this content.
;
preload icon
preload icon
preload icon