Closed Gedankendreher closed 4 years ago
Can you provide some example URLs that produce a 404? I've just tested those endpoints, and they do return 206 if one or more of the IDs is invalid.
https://api.guildwars2.com/v2/items?ids=6,24,999999,5000
To my knowledge, the API already responds 200 to a full success, and 206 to a partial.
I just run my junit tests and wasn't able to reproduce the issue. My work arounds for achievement and items haven't been triggered at all. I worked on achievements and progress a couple of days ago so this could be something temporary.
When requesting a bunch of items or achievements, an error 404 is returned when one or more ids could not be fetched. Apart from the fact that the error 404 commonly is used for a completely different context (the endpoint was not found), the error is totally wrong and working around it introduces extra load and delays due to additional queries.
In the past, having a non-resolvable reference ID in the query resulted in a list with the resolvable items at least. This is great - after exactly one query I got the data available from the service and was able to handle the missing ids locally. Now, if there is one unresolvable ID within the query, the API returns 404 (all ids are invalid). This not true. Removing the unresolvable IDs only results in the expected result - a list of all resolved ids.
Now, there is no benefit in asking for more than one ID per query as the service just lies because of a (usually small) subset. To list the content of a bigger bank for example, this could easily multiply the number of required queries by something hundred. Other strategies could deal with it in 20, 30 queries but this still consumes much more resources than the one query...
The API should be consistent for types (achievements, items, titles, minis, outfits etc) and: