Jump to content
  • Sign Up

API Updates - April 8


Recommended Posts

  • ArenaNet Staff

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

Link to comment
Share on other sites

@"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.

Link to comment
Share on other sites

@"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.

Link to comment
Share on other sites

@"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.

Link to comment
Share on other sites

  • ArenaNet Staff

@"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.

Link to comment
Share on other sites

@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.

Link to comment
Share on other sites

@"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).

Link to comment
Share on other sites

@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"

Link to comment
Share on other sites

  • ArenaNet Staff

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}

 

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

 

Link to comment
Share on other sites

  • 2 weeks later...

@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 typesif (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.

Link to comment
Share on other sites

@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.

Link to comment
Share on other sites

  • 2 weeks later...

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.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...