API Updates - April 8 — Guild Wars 2 Forums

API Updates - April 8

edited April 8, 2019 in API Development

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 Updates


Here are the changes in list format:

  • Added /v2/worldbosses and /v2/account/worldbosses
  • Added /v2/dailycrafting and /v2/account/dailycrafting
  • Added /v2/mapchests and /v2/account/mapchests
  • Added /v2/account/luck

Thank 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

Tagged:

Comments

  • Loving the frequent posts, @Daniel Snider.6241 (and the frequent updates, too).

    "Face the facts. Then act on them. It's ...the only doctrine I have to offer you, & it's harder than you'd think, because I swear humans seem hardwired to do anything but. Face the facts. Don't pray, don't wish, ...FACE THE FACTS. THEN act." — Quellcrist Falconer

  • Sounomi.8503Sounomi.8503 Member ✭✭

    Since its not mentioned, they all need the "progression" scope as well as "unlocks" for luck.

    That daily crafting one is an absolute godsend for me too. <3

  • SwOrly.9362SwOrly.9362 Member ✭✭

    The "Added /v2/account/luck" is supposed to be for what exactly ? I tried it thinking that it will show me my luck levels. Got only ["luck"] answer. Does not seems so helpful to me.

  • Dreggon.6598Dreggon.6598 Member ✭✭

    Are the world bosses only tracked per account? I could have sworn that some of them are character-bound so they can be done more than once per day, though I haven't checked this in years.

  • Vayne.8563Vayne.8563 Member ✭✭✭✭
    edited April 9, 2019

    @Dreggon.6598 said:
    Are the world bosses only tracked per account? I could have sworn that some of them are character-bound so they can be done more than once per day, though I haven't checked this in years.

    You can do the boss as many times a day as you want. The guaranteed rare chest that pops, the reason most do bosses, is only once per day per account. You can still get the "big" chest on each character though. Just not the bouncy chest that pops over your minimap.

  • Drymeat.2861Drymeat.2861 Member ✭✭
    edited April 9, 2019

    It is glad to know that you added those features! Especially daily things. Can you add more daily features? Like Hero Points daily, HoT meta boss chests.

  • is there any tutorials somewhere where can i learn how to set up my own spreadsheets using api? I really wanna get into numbers but i cant find anything how to do it.

  • Sounomi.8503Sounomi.8503 Member ✭✭

    @SwOrly.9362 said:
    The "Added /v2/account/luck" is supposed to be for what exactly ? I tried it thinking that it will show me my luck levels. Got only ["luck"] answer. Does not seems so helpful to me.

    Compare it against the "Total Luck Required" column on the wiki page for Luck since the amount listed on the API is the total earned.

  • @Jackanapes.6492 said:
    is there any tutorials somewhere where can i learn how to set up my own spreadsheets using api? I really wanna get into numbers but i cant find anything how to do it.

    APIs are used for web services. This wiki page explains all of the endpoints for the GW2 API. If you don't know anything about http and json, I'd recommend doing some research.

  • @SwOrly.9362 said:
    The "Added /v2/account/luck" is supposed to be for what exactly ? I tried it thinking that it will show me my luck levels. Got only ["luck"] answer. Does not seems so helpful to me.

    Aha, this is a bug! Thanks for pointing it out. I am working on a fix.

  • Wanze.8410Wanze.8410 Member ✭✭✭

    @Daniel Snider.6241 said:

    @SwOrly.9362 said:
    The "Added /v2/account/luck" is supposed to be for what exactly ? I tried it thinking that it will show me my luck levels. Got only ["luck"] answer. Does not seems so helpful to me.

    Aha, this is a bug! Thanks for pointing it out. I am working on a fix.

    Some time after todays patch, my API keys turned invalid and the new ones i create dont work as well (tested with gw2efficiency and gw2bltc), could this be related to this and I should wait for this fix?

    Friends of mine dont seem to have this problem.

  • @Wanze.8410 said:
    Some time after todays patch, my API keys turned invalid and the new ones i create dont work as well (tested with gw2efficiency and gw2bltc), could this be related to this and I should wait for this fix?

    Friends of mine dont seem to have this problem.

    Same problem. I'm getting either "ErrInternal" or "ErrBadData".
    Also, spent at least 30 minutes logging in to the forum (HTTP Error communicating Code: 400).

  • @fdru.7046 said:

    @Wanze.8410 said:
    Some time after todays patch, my API keys turned invalid and the new ones i create dont work as well (tested with gw2efficiency and gw2bltc), could this be related to this and I should wait for this fix?

    Friends of mine dont seem to have this problem.

    Same problem. I'm getting either "ErrInternal" or "ErrBadData".
    Also, spent at least 30 minutes logging in to the forum (HTTP Error communicating Code: 400).

    These are the errors I am getting from gw2efficency from a new API I just created because my old one wasn't working

    This API key is invalid, has corrupted API data or the API can not be reached.
    This is most commonly caused by a browser extension called "Privacy Badger".
    Error reported by the API: "ErrTimeout"

  • Aru.4571Aru.4571 Member

    I'm also having trouble linking new API keys after today's update. The discord bot only tells me the key is invalid, so I'm not sure what if any error codes it's getting.

  • I've gotten { "text": "ErrBadData" }, { "text": "ErrTimeout" }, what appears to be a generic 504 Gateway Time-out page, and a 502 that looks like it's from IIS while trying to load https://api.guildwars2.com/v2/pvp/games?ids=all&access_token=[redacted] with both a key that worked yesterday and a key I created just now

  • Wanze.8410Wanze.8410 Member ✭✭✭
    edited April 9, 2019

    @Daniel Snider.6241

    Seems there are some more players that have problems with creating invalid API keys after todays patch, according to the last comments.

  • I do not know if this is relates to your bug but /v2/account/mapchests currently returns value from before the daily reset on my account.

  • Wanze.8410Wanze.8410 Member ✭✭✭

    @Daniel Snider.6241 said:
    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!

    Thanks for the update. At least for me, the issue with broken API keys is resolved this morning.

  • Vegeta.2563Vegeta.2563 Member ✭✭✭

    @Daniel Snider.6241 said:
    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 types
    if (src) {
        if (dst->data) {
            dst->data = src->data->payload;
        } else {
            dst->data = 0;
        }
        // ... do more stuff with src
    }
    

    dst->data should be src->data inside the if-statement so that dereferencing src->data doesn't segfault when src->data == nullptr

    Not sure if this is related, but it seems that The Official API is experiencing issues; skill, trait and item data cannot be loaded at the moment.

  • That would be Daniel having a brain fart when coding and crashing things. One's not a true programmer til they've accidentally crashed the infrastructure they were working on, if you ask me.

  • SwOrly.9362SwOrly.9362 Member ✭✭

    @Daniel Snider.6241 said:

    @SwOrly.9362 said:
    The "Added /v2/account/luck" is supposed to be for what exactly ? I tried it thinking that it will show me my luck levels. Got only ["luck"] answer. Does not seems so helpful to me.

    Aha, this is a bug! Thanks for pointing it out. I am working on a fix.

    And mapchests null value is [] when you didnt got any of them that day ? Or is it also a bug ? Just feels that there should be a message that you got nothing for now or something like that.

  • Took me longer that I had hoped, but I finally got around to put the new endpoints to use. Unfortunately I found a problem. :(

    The account endpoints, at least mapchests and dailycrafting, do not properly reset for me. I haven't logged in today* and the account endpoints still show yesterday's progress.

    /account { ..., last_modified: "2019-05-04T22:25:00Z", ... }
    /account/mapchests: [ "verdant_brink_heros_choice_chest" ]
    /account/dailycrafting: [ "lump_of_mithrilium" ]

    Worldbosses is empty, but I think I didn't kill one yesterday. So it's probably affected, too.

    I developed my code assuming that I get the current values and that the requests would be independent of each other and ignorant to reset timing. I could override to empty when account.last_modified < daily_reset, but without massive refactoring that means I'd need twice as many requests.

    *today: in relation to reset. 22:25 UTC is 0:25 local time.

©2010–2018 ArenaNet, LLC. All rights reserved. Guild Wars, Guild Wars 2, Heart of Thorns, Guild Wars 2: Path of Fire, ArenaNet, NCSOFT, the Interlocking NC Logo, and all associated logos and designs are trademarks or registered trademarks of NCSOFT Corporation. All other trademarks are the property of their respective owners.