Jump to content
  • Sign Up

Daniel Snider.6241

ArenaNet Staff
  • Posts

    30
  • Joined

  • Last visited

Everything posted by Daniel Snider.6241

  1. Try this:https://api.guildwars2.com/v2/professions/Guardian?v=2019-12-19T00:00:00Z You need to view the document at the latest schema version to get the new fields. There is documentation about schema versions here: https://wiki.guildwars2.com/wiki/API:Main#Schema_Versionsand you can find my original post introducing the feature here: https://en-forum.guildwars2.com/discussion/72091/api-updates-march-22-2019
  2. Hello all, Build and equipment templates are now available on the API! I've also included some necessary data for decoding/encoding build chat links (I provide the format in this post). Recent API UpdatesFirst, here is the change in list format: Added code and skills_by_palette to /v2/professions.Added code to /v2/legends.Added build_storage_slots to /v2/account.Added build_tabs_unlocked, active_build_tab, and build_tabs to /v2/characters/:id.Added equipment_tabs_unlocked, active_equipment_tab and equipment_tabs to /v2/characters/:id.Added equipment.location and equipment.tabs to /v2/characters/:id.Removed skills and specializations from /v2/characters/:id.All of the above changes come with the latest schema version. Check out the full list of migrations in v2.json Build StorageYou can store build templates in your account-wide "Build Storage". This data is available on the API at /v2/account/buildstorage?ids=all. This acts like a typical "bulk" endpoint so you can also make requests for specific slots. Each build object contains the skills (terrestrial & aquatic), the specializations, the profession it applies to, the legends (terrestrial & aquatic), pets (terrestrial & aquatic), and the chosen name of the template. I've tried to keep the format as similar to the old skills & specializations objects. In the response at /v2/account you'll also find the build_storage_slots, which tells you how many slots have been unlocked for this account. Build TabsEach character has a number of build "tabs". This data is available on the API at /v2/characters/:id under the build_tabs field. In addition, there is a bulk endpoint that lets you access individual tabs at e.g. /v2/characters/:id/buildtabs?tabs=1,3. For convenience I've added the active build at /v2/characters/:id/buildtabs/active. I've kept the format of the builds in these tabs exactly the same as in the build storage endpoints, so your parsing code can handle them both the same way. In the response at /v2/characters/:id I've also added build_tabs_unlocked which tells you how many build tabs the character has unlocked, and active_build_tab which gives the index for the active tab for the character. Equipment TabsYour character’s equipment, attributes, and upgrades (excluding gathering tools) are stored in equipment tabs. This data is available on the API at /v2/characters/:id under the equipment_tabs field. In addition, there is a bulk endpoint that lets you access individual tabs at e.g. /v2/characters/:id/equipmenttabs?tabs=1,3. For convenience I've added the active equipment at /v2/characters/:id/equipmenttabs/active. In the response at /v2/characters/:id I've also added build_tabs_unlocked which tells you how many build tabs the character has unlocked, and active_build_tab which gives the index for the active tab for the character. Equipment changesBecause of how the equipment tabs work, items linked to an inactive tab don't appear in your inventory. Also, items can appear multiple times in different tabs. If you only have equipment_tabs to look at, you may think a character owns more items than they really do. For example, I might use the same legendary weapon on 5 different tabs, but that doesn't mean I actually own 5 of that weapon. Therefore, I have kept the equipment field in /v2/characters/:id and I have added all of the linked items to the list. Each item in the list has a location field with either Equipped or Armory. For convenience I also have a tabs field with an array of tab indices you can find that item in. Build chat linksBuild chat links are base64 encoded data surrounded by [& ]. The format of the encoded data is represented here by this C++ struct: #include <cstdint>// PACKEDstruct BuildChatLink { std::uint8_t magic = 0xd; // Profession codes can be found in the `code` field at // https://api.guildwars2.com/professions std::uint8_t profession; // Specializations can be found at // https://api.guildwars2.com/specializations/:id // To find a trait ID given a specialization, first find the `major_traits` // array at https://api.guildwars2.com/v2/specializations/:id // Then, reference this table to find the trait ID: // field | value | trait ID // ====================+=======+================= // traitAdeptN | 0 | None // | 1 | major_traits[0] // | 2 | major_traits[1] // | 3 | major_traits[2] // traitMasterN | 0 | None // | 1 | major_traits[3] // | 2 | major_traits[4] // | 3 | major_traits[5] // traitGrandmasterN | 0 | None // | 1 | major_traits[6] // | 2 | major_traits[7] // | 3 | major_traits[8] // Traits themselves can be found at https://api.guildwars2.com/traits/:id std::uint8_t specialization1; std::uint8_t traitAdept1 : 2; std::uint8_t traitMaster1 : 2; std::uint8_t traitGrandmaster1 : 2; std::uint8_t traitPadding1 : 2; std::uint8_t specialization2; std::uint8_t traitAdept2 : 2; std::uint8_t traitMaster2 : 2; std::uint8_t traitGrandmaster2 : 2; std::uint8_t traitPadding2 : 2; std::uint8_t specialization3; std::uint8_t traitAdept3 : 2; std::uint8_t traitMaster3 : 2; std::uint8_t traitGrandmaster3 : 2; std::uint8_t traitPadding3 : 2; // To find a skill ID given a palette ID, first find the `skills_by_palette` array // at https://api.guildwars2.com/v2/professions/:id for this build's profession. // Then, find the pair with the palette ID and use the mapped value. // For example, in javascript you might look it up like so: // new Map(skills_by_palette).get(paletteID) // Skills themselves can be found at https://api.guildwars2.com/v2/skills/:id std::uint16_t terrestrialHealingSkillPalette; std::uint16_t aquaticHealingSkillPalette; std::uint16_t terrestrialUtilitySkillPalette1; std::uint16_t aquaticUtilitySkillPalette1; std::uint16_t terrestrialUtilitySkillPalette2; std::uint16_t aquaticUtilitySkillPalette2; std::uint16_t terrestrialUtilitySkillPalette3; std::uint16_t aquaticUtilitySkillPalette3; std::uint16_t terrestrialEliteSkillPalette; std::uint16_t aquaticEliteSkillPalette; union { struct { // Pets can be found at // https://api.guildwars2.com/v2/pets/:id std::uint8_t terrestrialPet1; std::uint8_t terrestrialPet2; std::uint8_t aquaticPet1; std::uint8_t aquaticPet2; } ranger; struct { // Legend codes can be found in the `code` field at // https://api.guildwars2.com/v2/legends/:id std::uint8_t activeTerriestralLegend; std::uint8_t inactiveTerrestrialLegend; std::uint8_t activeAquaticLegend; std::uint8_t inactiveAquaticLegend; std::uint16_t inactiveTerrestrialLegendUtilitySkillPalette1; std::uint16_t inactiveTerrestrialLegendUtilitySkillPalette2; std::uint16_t inactiveTerrestrialLegendUtilitySkillPalette3; std::uint16_t inactiveAquaticLegendUtilitySkillPalette1; std::uint16_t inactiveAquaticLegendUtilitySkillPalette2; std::uint16_t inactiveAquaticLegendUtilitySkillPalette3; } revenant; };};As mentioned in the comments above, I've added skills_by_palette under each profession in /v2/professions/:id. I've also included a code field under /v2/professions/:id and a code field under /v2/legends/:id. This was a very big change that touched a lot of API code, so please report any bugs here. That includes any mistakes I made with old schema versions; I don't want to break existing applications if possible. Finally, I want to apologize for the delay in deploying these changes, I was on leave during the release of the build templates feature. Thanks!Snider
  3. Hello all, I added some missing content to the API: two home instance nodes, some missing novelties and the latest mount skin. I have also added a new quests endpoint so you can see all the finer-grained details of the quests available in the game (completing the trio of /v2/stories, /v2/stories/seasons and now /v2/quests) I also put in a /v2/characters/:id/quests endpoint to let you see all the quests you've completed per character! This also means you can automatically track which paths of the personal story your characters have completed (I hope someone writes an app for it :D) Recent API UpdatesHere is the change in list format: /v2/novelties has previously missing data./v2/mounts/skins has previously missing data./v2/quests and /v2/characters/:id/quests have been addedThank you to those who have been pointing out issues with the API. If you notice any more, please let me know Thanks!Snider
  4. Hello all, Just a small update on the API to coincide with today's release. Recent API Updates/v2/novelties is now available with the novelty data./v2/account/novelties is now available to show what novelties you've unlocked.Thanks!Snider
  5. Without promising anything, the outlook is good. :)
  6. Hello, I'd like to give a quick update on what's going on with render.guildwars2.com just so there's clarity into the progress being made. The Short Versionrender.guildwars2.com is still broken, but we're working on it. We'll understand the problem better after tomorrow's patch. The Longer VersionThe code behind render.guildwars2.com has two changes that will go out with the deploy tomorrow. First is better logging. Internally we send a signal to the server to have it "go to sleep" and "wake back up". It's going to sleep, but only parts of it are waking back up which puts us into a bad state. We've improved the logs so that we can see how we're getting into this state and why. While in this strange zombie state, the server is leaking system resources. An innocent victim of this is API white list server which figuratively explodes when it gets starved of the resource (there is an independent investigation to improve the robustness of the white list server). The second change is that the resource leak is fixed. What Does All This Mean?render.guildwars2.com will still be broken until we solve the root cause.render.guildwars2.com won't cause the API white list to lose its data at random times anymore.Thank you everyone for your patience while we solve this issue. -Snider
  7. Hello, I know you all have noticed the API breaking frequently recently and I wanted to write a post about it to help describe exactly what parts are breaking for clarity. render.guildwars2.com is a piece of the API that converts game asset images into jpgs and pngs for the public to use in their apps and sites. It's backed by a pretty simple standalone piece of server software whose sole responsibility is to cache the assets, convert them, and serve them as images. This server has been getting stuck in a bad state about every other month or so for a while now (I think a little over a year). It has been on my backlog of things to fix, but since the solution is a gentle reboot now-and-then, I admit I flagged it as low priority. Over the last few weeks, for reasons I haven't yet figured out, it's been getting stuck very frequently, sometimes twice in a day and at least once every weekend. It's gotten so bad that due to server configuration reasons, it wiped the white list server which had to be recovered manually (which is why the item endpoint died recently). Thank you for your reports of failure on the forum. I have been using these reports to manually fix the server while we try to work on a real solution. The priority for fixing render.guildwars2.com has been bumped up and is being actively worked on. The current status is debugging and gathering info on why it's breaking. As soon as we know, we'll fix it as soon as possible. Thanks again for your reports, and thank you for your patience while we try to put out this fire for good. -Snider
  8. Hmm. Some non-static endpoints require an access key but do not require any permissions. Off the top of my head, I believe /v2/tokeninfo doesn't require any permissions. Maybe that endpoint was built that way because it assumes account is always set. I'm not sure why you'd want to generate a token that expires in the past. I could have it error when exp < iat, but there's not a whole lot of benefit other than helpful sanity checking for the user of the endpoint. Also, if I have time at some point (and I remember), I'll put some cache-control properties in the response headers to tell the client not to cache the endpoint since it does change on every refresh due to iat being encoded in the response.
  9. You're right, it really should be POST. I chose GET because for API internal reasons POST is much harder and I wanted to get a fast turnaround on this feature. That said, I think GET is OK here because it's still a stateless call: the subtoken parameters are just stored in the subtoken itself. Nothing is written and no state is modified on the API server-side when /v2/createsubtoken is accessed.
  10. No. I decided to start with a required expire time and a maximum. I figured the endpoint should start more restrictive, then wait to see if we need to loosen the restrictions depending on app developers' needs.
  11. Hello all, A while back I introduced the concept of schema versions to allow the API to change easily without breaking existing apps. I've bumped the schema version a few times since then and I've been asked to provide a way to access the schema version changes. That can now be found in /v2.json (when accessed with a recent schema version, of course). Recent API UpdatesHere is the change in list format: Modified /v2.json to list all schema versions with a short description.Thank you for all the bug reports, they've been a big help. If you see any more issues let me know. Thanks!Snider
  12. A quick update: Some users have already pointed out some bugs with the new /v2/createsubtoken endpoint. Those have been fixed.I have also changed /v2/tokeninfo to understand subtokens, given a recent schema version parameter (e.g. ?v=latest). If you see any more issues, let me know. Thanks!
  13. Hello all, I put together a quick change to the API to allow some more fine-tuned control over sharing API keys a few weeks ago, and I had a chance to deploy it today. I have added an endpoint for creating what I'm calling "subtokens". Recent API UpdatesFirst, here is the change in list format: Added the /v2/createsubtoken endpointSubtokensAs a warning: this change's uses are niche. A subtoken is a special API key that can be used anywhere a normal API key can be used. It is simply a wrapper around a regular API key with reduced permissions. It can be created by accessing /v2/createsubtoken with several options: Subset of permissions (e.g. account, inventories)Expire timeList of urls that can be accessed (optional: if no urls are provided, then all urls are allowed)Here is an example that shows the full functionality: GET https://api.guildwars2.com/v2/createsubtoken?permissions=account&expire=2019-12-25%2012:34:56&urls=/v2/characters/My%20Cool%20Character,/v2/account/home/catsAuthorization: Bearer MY_API_KEYThe API will respond with: { "subtoken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ3YlRodVdNNGExMUduZlpYSTdaa0pHck52 SVVPUWhMejZHTXpOeE9TUC1rIiwiaWF0IjoxNTU4Mzk3OTUwLCJleHAiOjE1NzczMDYwOTYsInBlcm1pc3Npb25zIjpbIn Byb2dyZXNzaW9uIiwiYWNjb3VudCIsInVubG9ja3MiXSwidXJscyI6WyIvdjIvY2hhcmFjdGVycy9NeSUyMENvb2wlMjBD aGFyYWN0ZXIiLCIvdjIvYWNjb3VudC9ob21lL2NhdHMiXX0.UdLlafgo8lxkb1Hn88paZT83aw_9mHEYVZJLDgObNSc"}I can then see what cats I have unlocked with this large subtoken GET https://api.guildwars2.com/v2/account/home/catsAuthorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ3YlRodVdNNGExMUduZlpYSTdaa0pHck52SVVPUWhMejZHTXpOeE9TUC1rIiwiaWF0IjoxNTU4Mzk3OTUwLCJleHAiOjE1NzczMDYwOTYsInBlcm1pc3Npb25zIjpbInByb2dyZXNzaW9uIiwiYWNjb3VudCIsInVubG9ja3MiXSwidXJscyI6WyIvdjIvY2hhcmFjdGVycy9NeSUyMENvb2wlMjBDaGFyYWN0ZXIiLCIvdjIvYWNjb3VudC9ob21lL2NhdHMiXX0.UdLlafgo8lxkb1Hn88paZT83aw_9mHEYVZJLDgObNScand get normal results. The request will be rejected if: The reduced permissions do not meet the permission requirements of the endpointThe subtoken time is expiredThe request url does not match the restricted url set (unless there are no url restrictions)The original API key which was used to create the subtoken is deletedSubtoken usesAs I admitted earlier, there aren't a huge amount of uses for a subtoken. Here are the two use-cases I considered while making this change: First and foremost, subtokens lets an app (App 1) accept & store an API key from a player and then pass that API key on to another app (App 2) with more control over what App 2 can do with the player's key. The other case is for savvy users who want more control over what they share with their API key. They can use the endpoint to generate subtokens to hand over to apps with, e.g. expire times or restrictions to certain character endpoints. I'd love to hear thoughts and feedback for this change, as well as any bug reports. Thanks!Snider EDIT: Added a bit about deleting the original API Key
  14. Hello all, I recently mentioned some backend changes I made that went live with yesterday's patch. As a result I am rolling out some fixes that weren't possible before. The daily achievements you see in-game are different depending on which expansions you own for that account. Because listing the daily achievements doesn't require an API key, there are flags on each achievement that describe the access requirements for each. The way those requirements were represented changed at some point in the past to be a bit more complex. I have updated the API to understand the new format and I've bumped the schema version. Recent API UpdatesHere are the changes in list format: /v2/achievements/daily and /v2/achievements/daily/tomorrow now show an access_requirement with a product and condition field as of the latest schema version.product is either "HeartOfThorns" or "PathOfFire".condition is either HasAccess or NoAccess.Let me know if there are any issues with this change! Thanks,Snider
  15. Hello all, As of today's patch some backend changes to support the API have gone live. I will be working to bring some of the benefits of those changes over the coming weeks. One of the changes broke the mounts endpoint for several hours today (it is now fixed), but in return all missing mount skins have been added to the API. Recent API UpdatesHere are the changes in list format: Missing skins have been added to the API.Thanks,Snider
  16. The API issue has been resolved. If you're curious what went wrong, I made a rookie mistake. It should be easy to spot: // src and dst are pointers and are of different typesif (src) { if (dst->data) { dst->data = src->data->payload; } else { dst->data = 0; } // ... do more stuff with src}
  17. The API is currently broken due to a backend server crash Translation: I broke the API with today's release :# A fix is in the pipe!
  18. Aha, this is a bug! Thanks for pointing it out. I am working on a fix.
  19. Hello all, I recently posted about some internal changes I made to how API content is managed. Some of the fruits of that labor are here in the form of some new endpoints. First, I've added the world boss clears and map chests to the API so you (or your tools) can keep track of those daily rewards. Also, I've added daily crafting progress to the API, which is helpful for keeping tabs on the daily cooldowns. Finally, I added account luck to the API. The schema is weird due to the way its stored internally, but if it causes too much trouble, please let me know so I can modify it to something more sensible. Recent API UpdatesHere are the changes in list format: Added /v2/worldbosses and /v2/account/worldbossesAdded /v2/dailycrafting and /v2/account/dailycraftingAdded /v2/mapchests and /v2/account/mapchestsAdded /v2/account/luckThank you to those who have pointed out issues with the API. If you see any bugs with these new changes, please let me know, your reports are greatly appreciated. Thanks,Snider
  20. Hello, v2/accounts/mounts is now available! Note: newer mount skins are still missing. account/mounts/typesThis endpoint will list all mount types that you have unlocked. Compare to https://api.guildwars2.com/v2/mounts/types to see what is available. The json schema is available here: https://github.com/arenanet/api-cdi/blob/wip/v3/v3/schemas/account-mounts-types.json Here is an example response: [ "raptor", "skimmer"]account/mounts/skinsThis endpoint will list all mount skin IDs that you have unlocked. Compare to https://api.guildwars2.com/v2/mounts/skins to see what is available. The json schema is available here: https://github.com/arenanet/api-cdi/blob/wip/v3/v3/schemas/account-mounts-skins.json Here is an example response: [1, 2, 3, 4]
×
×
  • Create New...