Can anyone confirm that these recipes are actually in the game?
Recipe 9642 would be a Chef recipe, even though it isn’t specified by the API. I don’t have a chef to test this recipe in-game, but someone could go and try to discover it using the 4 ingredients.
Recipe 9642 (link)
This recipe does not specify a single crafting discipline. Also, its output item ID (66200) does not exist in the item details API.
Further research indicates that this recipe produces an “Unidentified Orange Dye”.
Chat link codes:
- [&CqolAAA=]
- [&AgGYAgEA]
If this recipe clearly exists in the game, why does the API behave like this?
(edited by StevenL.3761)
There is no official chat API, so there’s no guide that you could’ve missed.
For a list of services that you can use, look at the documentation.
Shameless self-promotion: if you’re planning to use C#, don’t even think about starting from scratch. Instead, use the great and awesome GW2.NET code library.
GW2.NET implements support for every official API endpoint.
I can confirm that the original chat code represents item_id 3792. My decoder returns the same result.
Does the chat code work in-game? Then there probably is a real issue.
Again with the 404… why? No really… WHY?! It can’t possibly be that difficult to return http status 500 when the error really is a server error.
@API developers, here’s a nice little cheat sheet:
4xx: client-side error
5xx: server-side error
For a detailed overview: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
Possibly added constant: weapon.damage_type = “Choking”
Example:
https://api.guildwars2.com/v1/item_details.json?item_id=6
Icon:
https://render.guildwars2.com/file/CC2E01E0F566A6EEF4F2EC2B19AA7A3E1FEFB1B4/60984.png
Not sure if this is real or not
Pretty good list. Especially the upgrade component types have been bothering me as well. Not in that it hurts my application, but it’s just weird.
Items have no indication if they are usable by a crafting profession (this info is available in in-game tooltip) and the relative level requirment.
Actually… you can export the data from recipe_details into a database, then filter that data by the crafting material’s item_id. This way, you should be able to get both the minimum required rating as well as all of the professions that have a recipe that requires the material.
I used Excel to generate the XML file from the table that was posted in the news article. Are you sure that you’re not just mixing up the time zones? All times are encoded as + 00:00, otherwise known as UTC. You can convert to CET (+ 01:00), CEST (+ 02:00) or other time zones in code.
Impossible, because the event_details endpoint itself does not have entries for these 3 events. Otherwise I would have added them to the rotations.
Alternatively, you can assign your own ID values, separate from the event_id values that are used for the events API.
<rotations>
<rotation local_id="0" event_id="00000000-0000-0000-0000-000000000000">
</rotation>
</rotations>
—
Instead of that, I’d wait for a fix. The Triple Trouble event is not even a popular event anyway. Considering that it’s impossible to do with an unorganized group, you’d think that anyone who’s actually interested in completing the event knows when it starts.
The event APIs seem to be missing entries for the Triple Trouble wurm events. Bug?
I wouldn’t say stolen. Perhaps inspired by. The code is not similar enough to state that @Indy even knew this blog post existed before writing his own version.
Regardless, we have little use for this stuff on these forums. I’d be much more interested to see what other sorts of cool stuff you can do with Node.js, but this time targeting the official APIs.
I didn’t like the format that was used in the other forum post. This attachment is my idea of what an event schedule should look like.
While making this schedule, I noticed that the triple trouble wurms don’t appear in the event_details API. Is this a bug or a feature?
Attachments:
I’d be willing to throw something together for you. But you could probably do it faster yourself using the information in this news article: https://www.guildwars2.com/en/news/the-megaserver-system-world-bosses-and-events/
Here’s a template that you could use as a guideline:
XML
<rotations>
<rotation event_id="00000000-0000-0000-0000-000000000000">
<shift>00:00:00</shift>
<shift>00:00:00</shift>
<shift>00:00:00</shift>
</rotation>
</rotations>
—
JSON
{
"00000000-0000-0000-0000-000000000000":{
"shifts":[
"00:00:00",
"00:00:00",
"00:00:00"
]
}
}
—
EDIT
Looks like someone already did this: https://forum-en.gw2archive.eu/forum/community/api/XML-for-the-new-world-event-schedules/3853510
(edited by StevenL.3761)
v0.9.1.0
I’ve gone ahead and updated the library to include all of the latest bugfixes and features that didn’t make it into the previous release. Mostly regarding the item_details endpoint.
You can get the updated binaries from the project page. The updated Nuget package should follow soon(ish).
Possibly removed constant: armor.weight_class = “Clothing”
Can anyone confirm?
https://api.guildwars2.com/v1/skin_details.json?skin_id=2388
{"error":10,"product":71,"module":2,"line":314,"text":null}
source of skin_id: https://api.guildwars2.com/v1/item_details.json?item_id=23009
I’m doing some manual regression testing to verify that my code still works after recent updates. Indeed, there have been some changes that are as of yet undocumented.
In this thread, I’ll make and update a bullet list of changes as I find them.
Removed Properties
= item_details.json =
- infusion_slot.item
- string
- was reserved for future use, now gone
New Properties
= item_details.json =
- infusion_slot.item_id
- optional
- string, implicit int
- example: https://api.guildwars2.com/v1/item_details.json?item_id=37013
- default_skin
- optional (only for types “Armor”, “Back”, “Gathering” or “Weapon”)
- string, implicit int
- example: https://api.guildwars2.com/v1/item_details.json?item_id=28445
- armor.secondary_suffix_item_id
- back.secondary_suffix_item_id
- weapon.secondary_suffix_item_id
- optional
- string, implicit int
- example: https://api.guildwars2.com/v1/item_details.json?item_id=38875
Changed Properties
= item_details.json =
- description
- Now optional, in the sense that it will not be present in the response
New Constants
= item_details.json =
- flags.AccountBindOnUse
- Presumably has something to do with legendaries being account bound now
(edited by StevenL.3761)
As you can see it isn’t very interesting yet since you can only cross-reference skins that are the ‘default_skin’ of certain items. But will be more useful once we ship APIs that show personalized items, such as the /characters API.
What exactly is this /characters API? I have to know now.
Wait, what? What /characters API are we talking about here? There’s going to be an API that returns the unlocked skins and stuff?
(off-topic) Can you guys please not quote all 4+ paragraphs of the post that is directly above yours? We know who you’re responding to.
Thanks for the heads up. But what do you mean by breaking a field? Do these item names display as empty strings now?
(edited by StevenL.3761)
Well the owners might have requested explicit permission to use these icons. Or the use of these icons might be defended as being “fair use” (see wikipedia).
There’s also the Guild Wars 2 Asset Kit. As far as I know, that’s the only source of media for which you have explicit permission to use it in your own product.
(edited by StevenL.3761)
From the wiki:
These APIs are wholly owned by ArenaNet, LLC (“ArenaNet”). Any use of the APIs must comply with the Website Terms of Use and Content Terms of Use, however you may use the APIs to make commercial products so long as they are otherwise compliant and do not compete with ArenaNet. ArenaNet may revoke your right to use the APIs at any time. In addition, ArenaNet may create and/or amend any terms or conditions applicable to the APIs or their use at any time and from time to time. You understand and agree that ArenaNet is in the process of developing a full license agreement for these APIs and ArenaNet will publish it when it is complete. Your continued use of the APIs constitutes acceptance of the full license agreement and any related terms or conditions when they are posted.
Regardless, you shouldn’t violate copyright laws (*) no matter whether you are getting paid.
(*): unauthorized use of graphics, music tracks, …
With all that in mind, my personal advice for someone who’s new to programming is to not turn greedy. Build an app for the fun of it, and let it be a learning experience. That’s worth so much more than the couple of cents you’ll make by charging for your app.
Perhaps you could mention that you accept Black Lion Trading Company gifts somewhere in the “About” page of your app. That way, you indirectly support Anet.
So if I write a program that makes a 1:1 local copy of the static data, I only have to worry about updating my local copy when the build number changes?
For discovery endpoints, the build number doesn’t matter as much, right? I’m guessing that new identifiers are only added to the output as they are discovered by in-game players?
What is the actual significance of the build number? More specifically: if the build number changes, what does that mean for other endpoints?
On the wiki, it says that the build ID can be used to for example register when event timers reset due to server restarts. This is suggesting that there are other uses, yet none of them are documented.
The thing that I’m most interested in: for as long as the build number remains the same, will static data remain the same?
Examples of changes that I have in mind:
- changing the level requirement for an item_details object
- fixing a typo in an event_names object
- adding a new color to the colors object
Do these sort of changes (always) require a new build?
I suggest taking a look at the list of application that use the API. Some of these are actually really good. But even the smaller ones are in no way useless.
Which API response is this about? I’m trying to figure out what’s changed for myself.
Thanks for taking the time to post all that. You saved me a lot of typing. :P
Here’s the demo website that was mentioned in the post above: http://guildwars2netdemo.apphb.com/
This website is also entirely open-source (currently without a license, but I’m leaning towards the MIT license). To anyone reading this: I am desperately in need of someone who knows how to tame HTML/CSS/JavaScript and has experience with (or is willing to learn about) ASP.NET MVC 4.
Your job will be to:
- figure out how to use the GW2.NET library (with my personal guidance)
- provide feedback about code that we’ve written
- develop example applications that demonstrate how the library can be put to good use
If you are this person, send me a private message. I check these forums at least daily.
It’s a simple association property. Or navigation property. Or however you want to call it. Anyway, they are just identifiers. Redundancy is not an argument here.
edit
Just for funsies, try and tell me which continent and floor this data belongs to:
{
"texture_dims":[
32768,
32768
],
"clamped_view":[
[
1662,
2816
],
[
12544,
8062
]
],
"regions":{
"29":{
"name":"Super Adventure Box",
"label_coord":[
6272,
2432
],
"maps":{
"935":{
"name":"Super Adventure Box",
"min_level":1,
"max_level":80,
"default_floor":20,
"map_rect":[
[
-15360,
-30720
],
[
15360,
30720
]
],
"continent_rect":[
[
1574,
5972
],
[
2854,
8532
]
],
"points_of_interest":[
{
"poi_id":1824,
"name":"",
"type":"waypoint",
"floor":20,
"coord":[
2206.49,
7275.1
]
}
],
"tasks":[
],
"skill_challenges":[
],
"sectors":[
{
"sector_id":1128,
"name":"Super Adventure Box",
"level":80,
"coord":[
2175.26,
7206.06
]
}
]
}
}
}
}
}
(edited by StevenL.3761)
That’s how I’m doing it now, but it’s a hack. The ugliest one so far.
The problem is that my request and response objects are decoupled, so the response object knows nothing about the origin of the data. I use manager classes to put all the pieces together. The fact that the response data does not contain identifiers puts the web service manager in a position where it has to fill in those blanks, rather than the JSON serializer.
(edited by StevenL.3761)
My caching algorithm requires that API response objects have some indication of what they represent. Currently, this is not the case for map_floor objects.
My suggestion is to add the continent_id and floor values as properties.
Example: /v1/map_floor.json?continent_id=1&floor=1
{
continent_id: 1,
floor: 1,
texture_dims: [...]
regions: {...}
}
—
Thank you
I’m not an expert in these things, but I think they’d rather have you send 25 requests every second than 250 requests all at once every tenth second.
I’m assuming that IDs are generally ordered by when the location was added to the map. I mean, what else would you base the waypoint/vista/task IDs on? And why not do the same for skill challenges?
Also, you can’t just assign your own ID. You could, but for all practical intents, that number would be meaningless.
It just occurred to me that, in the output for map_floor.json, the skill_challenge objects do not have an ID, only a set of coordinates. Renown Tasks and Points of Interest do have an ID property.
Was this merely an oversight, or are skill challenge locations so fundamentally different from other map locations that they don’t need to have an ID for some reason?
Hi all. Yes, we are still working on the v2 APIs. It has been a little bit slow going for me due to having been pulled aside for higher priority items over the last few months. But progress is being made.
Is there any chance you’d let us help speed things up? I’ve been working with the API almost every day over the last few months, and I’m sure there are others like me. We know exactly what we want, and we’d love to implement it ourselves if given the opportunity. I’m thinking you could make parts of your SDK publicly available, just enough for us to try and reduce the backlog for v2 and submit the results as patches.
I took a slightly different approach. Rather than testing a particular response, I turn it into a JSON schema by replacing every value with a generic substitute.
numeric : 0
text : ""
collection : []
complex type: {}
With that as the input, all I have to do is
- check that every object property is initialized to its default
- check that the serializer could find a matching property on the .NET class for every property in the JSON input.
Example: https://gw2dotnet.codeplex.com/SourceControl/latest#GW2.NET-Http/GW2.NET Tests/Core/ItemsInformation/Details/ItemTest.cs
That’s the main reason why I’d like to see OData support. Sorting through megabytes of response data just to get maybe 5 or 6 objects that match a set of parameters is just not very RESTful.
What DarkSpirit is getting at is that the response objects do not follow any standards, meaning that any client library that wants to use the API has to be custom-tailored.
On the other hand, there are many REST libraries out there that have OData support baked into it, meaning you can just plug the library in to your program and start using the API right away.
In my humble opinion, OData support would be a huge improvement, but a lot of its potential would go to waste because the APIs are read-only.
Alright, I think I get it now.
My idea is to write individual tests for each ItemDetails property. One test to check that the target property isn’t null, and for properties where the range of allowed values is finite, one additional null-test per known value (e.g. ‘item_details.type’, ‘item_details.rarity’).
Would that be a meaningful way to test?
Sorry, I wasn’t referring to the JSON’s response format. I remembered one of the devs talking about how they designed the APIs.
I don’t have much experience using JSON libraries that map to strongly-typed objects. We didn’t really design the API in mind with that use-case, so I’m not surprised that there are places where it breaks or doesn’t make sense.
So anyway, a test fixture is nothing but a vague description of a unit test that uses static sample data from an otherwise dynamic data source as input? I think that gave me an idea.
(edited by StevenL.3761)
This may be far-fetched, but I often find myself using third-party websites to check when world bosses will spawn.
See Dragon Timer
Is this something that can be turned into an overlay somehow?
Hello forum
If I’m not mistaken, the APIs we’re given are designed to be consumed in loosely typed languages. Nevertheless, we successfully wrote a .NET library that wraps the API in strongly typed classes.
The problem is that I’m not exactly sure how to go about unit testing code that relies on external data.
For APIs that do not require any parameters, I can simply get the data once and use that to verify that my code behaves as expected.
As an example, I test my code for the ‘items.json’ API like this:
[Test]
public void GetItemsCatalog()
{
var request = new ItemsRequest();
var response = request.GetResponse(client);
Assume.That(response.IsSuccessStatusCode);
Assume.That(response.IsJsonResponse);
var itemsResult = response.Deserialize();
Assert.IsNotNull(itemsResult);
Assert.IsEmpty(itemsResult.ExtensionData, "The '{0}' class is missing one or more properties.", typeof(ItemsResult).FullName);
Assert.IsNotNull(itemsResult.Items);
Assert.IsNotEmpty(itemsResult.Items);
Assert.IsEmpty(itemsResult.Items.ExtensionData, "The '{0}' class is missing one or more properties.", typeof(Items).FullName);
Trace.WriteLine(string.Format("Number of items: {0}", itemsResult.Items.Count));
}
Although this unit test assumes that my machine has a working internet connection (and that the web service is up), its test results are fairly accurate. Either my code behaves as intended, or it doesn’t.
But what do I test for when an API’s response data changes over time due to the dynamic nature of the game?
At the time of writing, there are 31,864 unique item IDs that can be used to query the ‘item_details.json’ API. In order to say with 100% certainty that my ItemDetails class behaves as expected, I would have to test my code with 31,864 different inputs.
Obviously, this is a no-go. So how do I test this code?
So the question is why something like:
“type”:“Weapon”
isn’t translated to:
“type”:“Arme”
—
You don’t want that because you’d have multiple names to indicate the same type.
At best, this means that you’d have duplicate code for every supported language.
A more likely scenario is that an English item won’t be recognized as equal when compared to the exact same item in French.
myEnglishLongbow.type = "Weapon"
myFrenchLongbow.type = "Arme"
myEnglishLongbow.type != myFrenchLongbow.type
@cvpcs
We’re working on something quite similar over at the GW2.NET project.
I wrote the following classes over the past couple of weeks:
- ApiRequest : RestRequest
- ContinentsRequest : ApiRequest
- ApiResponse<TContent> : RestResponse<T>
- ContinentsResponse
- Continent
You seem to know your stuff. Would you be interested in becoming a contributor?
At this point, it would be far more damaging to change the spec and break everyone’s stuff, so I would prefer it if no changes were made. However, presenting a consistent format for all new APIs going forward would be a great idea.
The best way forward (imo) would be to go ahead and make the breaking changes, but make the improved APIs available alongside the existing APIs as v2/*.json. Then when everyone has migrated, perhaps a year later, they can take the old version offline.
I still don’t understand what’s the significance of the z-axis in relation to a flat world map. Am I missing the point, or does it have other uses?
I find it actually quite useful to have the results collection be a named property of the root object. At least, that way you can refer to it by name.
It’s just annoying that the API is so inconsistent. For example: the “continents.json” API has this behavior whereas the “event_names.json” API doesn’t. As @Rhino suggests, you gotta write a different hack for each endpoint. It would be nice being able to reuse the same sloppy code for everything.
Hi there
Generally speaking, I’m pretty happy with the API documentation. But what is going on with the event_details page? The documentation cuts off right in the middle of the interesting part.
Can someone please explain what the different types of location object are for? Perhaps with some (C#) code samples of what the entities should look like?
Thanks!