I’m probably going to put QR codes on the API key management page so that native apps can “copy-paste” the key into the application in a gross but somewhat feasible manner.
Yeah. This has to happen. My API use-case is for mobile devices and, at the very least, you guys providing QR codes will be a big help.
I’m not surprised by the move away from OAuth2. smiley and I have always agreed, and he’s right again, Though, from a business/support standpoint, OAuth2 is untenable; it makes it too easy for players to click-through and grant access to an application without fully understanding the ramifications.
Fantastic news! Thanks for all your hard work guys.
I’d probably store the attributes of each subtype in a separate table to maximize normalization. e.g., the
items
table would just store the attributes common to all items; for items with a “consumable” type, theitems_consumable
table would have the corresponding type-specific fields; and for consumables with an “unlock” type, theitems_unlock_dye
oritems_unlock_recipe
would have those details.
This is the exact solution I came to in my own applications; gets the job done.
As an aside: thanks for your ongoing communications in this subforum, Lawton!
thanks, smiley
Hey guys,
The API wiki says that ‘X-Result-Total’ (and ‘Count’) should be returned when querying the service using pagination.
However, they don’t seem be to be showing up. Here is the response header I get when testing with ?page=0&page_size=0
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Server: Microsoft-IIS/7.5
X-Content-Type-Options: nosniff
Link: </v2/commerce/listings?page=1>; rel=next, </v2/commerce/listings?page=0>; rel=self, </v2/commerce/listings?page=0>; rel=first, </v2/commerce/listings?page=441>; rel=last
X-Page-Total: 442
X-Page-Size: 50
Access-Control-Allow-Origin: *
Date: Wed, 10 Sep 2014 00:13:48 GMT
Connection: close
Content-Length: 206944
Trading Post 2.0 will use /v2/commerce APIs? I’m sceptical, but I hope you’re right.
I didn’t say any of that. But if you think so, I hope you’re right. We shall see today.
(edited by Killer Rhino.6794)
Like many of you, I’ve been very annoyed by the lack of updates regarding the APIs. That being said, the changes so far mentioned in the upcoming September feature pack (Sept. 9th) suggests that ArenaNet is dog-fooding the mythical API v2.
Things like the new crafting UI and more sophisticated, fine-grained improvements to the wardrobe all suggest that the back-end has been upgraded with services which and improve the client experience.
The biggest indication IMO is that, in two days, we get to see what “Trading Post 2.0” is all about.
I’m not saying this means that we, the public developers, will get to use any of this by the time September feature pack is released. But it might demonstrate that there has been progress on the APIs.
GW2Kit – Update (Aug. 15th)
GW2Kit on GitHub
Abandonment Notice
I’ve given up. I’ve totally lost any interest I had in this project. If v2 does come out, I expect to completely reboot the source anyways. See you “soon™”.
(tableflip)
I don’t have any inside knowledge, but the primary developer who was leading the API project, Cliff, left ArenaNet for SpaceX soon after the APIs got released.
My guess is there was a lot domain knowledge about getting info from the game’s servers into a safe and public form that left with Cliff, and this info needed to be rediscovered when new staff took over.
Furthermore, I suspect that the APIs started off internally under the assumption that it would take a backseat to the core game development life cycle. To that end, it would, and probably still, takes a lot of persuading by the employees who maintain the project now to justify the time needed to work on them. The APIs make no money for the company, and only directly serves a community of probably 100-200 people. Once OAuth2 support is added, it could potentially increase the customer service support strain on the company from gamers who are logging into third-party services developed by you and me.
When v2 is released, and when it sees a concerted effort of support by ArenaNet, it will probably be because they found a solid enough business reason to do so. At current, that may not exist.
The APIs are missing OAuth support.
Here’s your answer: “Yes. For now.”
It’s been a very long time since the APIs have seen any activity. Having said that, I’m sure they’ll see an update during Season 2 of the living story, but that could still be months away.
In regards to GW2Kit, I’ve had emails asking about it: it’s going to get rewritten once API v2 is released. I’ve been utterly demotivated to do anything with it since the APIs, themselves, feel abandoned.
sigh
So, umm…any further updates? Honestly, at this point, I have zero problem with: “Ain’t happening till 2015.”
(tableflip)
I would love to see an API for build templates. That would be incredibly interesting. It would give the PvP community a lot to discuss and theory craft over.
Steady weapons were removed as part of the many PvP changes in the April 2014 feature pack.
Keep up the good work, Wolf! I enjoy your PvP videos the most.
The APIs are missing OAuth support.
The APIs are missing OAuth support.
Hi All, thank you for the report. Turns out there were more APIs affected by megaservers that I originally thought. I am working on a fix and hope to have it out shortly.
Hi !
I know this is probably not the right thread, but I really need a fast answer since the API v1 is 1 year old and so are a lot of domain names we bought when creating sites 1 year ago ==> is there any chance that an "api v2" comes out and revives event-api-based sites by using megaservers ? => should I renew my domain name ?
https://forum-en.gw2archive.eu/forum/community/api/Events-API-2-0
thanks
Eowyn
Don’t take this the wrong way, and it’s entirely my own opinion, but I don’t think you should expect an answer (or indication) from ANet on the state of your domain renewals. Even still, these questions should be sent directly to ANet’s community managers, and not blindly posted on forum threads.
It’s a bit…ummm…not their problem? More explicitly, they (or any company in a similar position) aren’t beholden to your particular business needs because they’ve provided public APIs.
Again, these thoughts are my own. I would expect that if dev energy is spent on this forum, it would be focused on only those discussions which are universally relevant to all API developers.
Hopefully this means good things!
NEW APIs!?!? Thank you so much, Dr Ishmael!
Stefan, my eternal gratitude!
And that won’t be possible, if they do it at all, until after OAuth2 is implemented. So don’t expect it anytime soon.
From the blog post:
As mentioned in the original blog about the megaserver system, on April 15 we’ll start by rolling out this technology to level 1–15 maps, the PvP lobby, and major cities. Later in 2014, we’ll expand this system to the entire game.
I predict “Later in 2014” is when we’ll see OAuth2 APIs, and that after April 15th, the v1 APIs will be in a state of half-broken limbo.
Alternatively, if OAuth2 came next week, it would only be relevant to a very small portion of the game, but well all could begin adding it to our code in anticipation.
shrug
(edited by Killer Rhino.6794)
You’ll probably want to remove the app from the App Store by April 15th, since the established APIs will no longer be relevant after that, and update accordingly. Afterwards, you’ll need to evaluate the API changes in relation to your app. It’s all pretty common sense stuff.
Do you use, or have looked at, GW2Kit?
Can someone please share the most recent list of event IDs which correspond to world events such as dragons, temples, and bosses?
Honestly, I tried using the forum search, but we all know that’s a total P.O.S. Also, I’m guessing others, besides myself, might like to have an updated reference.
Thanks in advance!
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.
Thanks for the update, Stefan.
~shrug~
When I do a search for OData, which I had never heard of before reading this thread, almost all of the top results are from Microsoft oriented sites/projects — https://duckduckgo.com/?q=odata
The first interesting result that pertains to this conversation is a StackOverflow question — http://stackoverflow.com/questions/2458407/difference-between-odata-and-rest-web-services . The accepted answer should tell you why no one here is excited by your suggestion:
As Franci said, OData is based on Atom Pub. However, they have layered some functionality on top and unfortunately have ignored some of the REST constraints in the process.
The querying capability of an OData service requires you to construct URIs based on information that is not available, or linked to in the response. It is what REST people call out-of-band information and introduces hidden coupling between the client and server.
While the current API isn’t exactly transparent, it doesn’t bind you to using a specific technology (other than being able to parse text). OData is brining nothing useful to the table.
I haven’t addressed your insistence on “it also supports JSON” because there really isn’t any point. Why would it supporting JSON immediately make it a worthwhile change? JSON as an output format doesn’t make the added complexity of being able to get the output worth it.
I’m not “biased against technologies from Microsoft simply because [I] hate Microsoft.” But I’m certainly no fan of their style and won’t just accept using their solution when a simpler, more open one, is possible.
Man, you nailed it.
“Point was well made, and delivery was fast. A++++, would buy again!”
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.
So let’s solve that problem with a proprietary protocol nobody has every heard of!
/sarcasm
As for the metadata, I agree that not being able to list them in JSON format is a slight drawback.
You might have misinterpreted my point. Or I might be misunderstand you.
Either way, I don’t want metadata or type information in my responses. JSON is simple and easy to use because it eschews this sort of verbosity.
It also have full CRUD support for maybe something like a new trading post api …
As it were, for now GW2’s APIs only have one mode: GET. I could see how OData might make a service you’re designing internally more robust, though.
You can also see the metadata describing the objects returned by the database
I can’t say this enough: No XML!
Look, a more descriptive data format might make sense for your use case, but in most other cases, it’s a waste of bytes that the majority of wrappers probably won’t make use of.
Here’s an example of why descriptive data-types are so limiting
map-names.json, world-names.json, and event-names.json all return the same object structure — ‘id’ and ‘name’. However, it would appear that map-names.json and world-names.json have IDs that are numeric, while event-names.json have IDs that are alphanumeric.
The truth is, it shouldn’t matter how these object properties get represented client-side. Individual developers would handle this particular idiosyncrasy in whatever implementation makes sense for their wrapper’s particular language. The wise developer might use the same wrapper object to map to all three. In the end, the only thing that really matters is that the GW2 API defines name objects in two parts: — ‘id’ and ‘name’, not “some int” and “some string”. And trying to impose such via the service’s responses would be a complete waste.
Yeah, I’m also confused. As with the previous commentator, what problem are you trying to solve?
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.
A fixture is the static sample data.
If I’m not mistaken, the APIs we’re given are designed to be consumed in loosely typed languages.
You are mistaken. JSON is just a data exchange format which describes values. It does nothing to impose a specific “language” meant to consume it (yes, I realize that it originated from JavaScript). If JSON wasn’t as flexible as it is, and it was so restrictive as to make it difficult for developers of, say, statically type languages, to consume, it would not be so widely used.
If a client application consumes JSON, and, for example, a value for ‘someID’ is passed down as a string, then if a programmer decides to convert that string value to an unsigned integer, so be it. That’s a architectural design decision, but this has nothing to do with the JSON concept or the provider of the APIs. If it works, it works.
The problem is that I’m not exactly sure how to go about unit testing code that relies on external data.
Unit tests should be self-sustaining. You shouldn’t bake external dependencies within your tests, if you can help it. That that I recently solved this was with a testing concept called ‘fixtures’. A fixture can be considered pre-determined input passed into the unit test which mirror real-world data.
Note: unit testing is a broad topic. Here, fixtures are present as just one possible solution. There are other alternatives, such as mock objects.
I recent created a development branch in GW2KIt which adds a plethora of unit tests. These tests use fixtures I created from version 1 (v1) of the APIs.
Again, look here for list of v1 fixtures I use.
Edit
But what do I test for when an API’s response data changes over time due to the dynamic nature of the game?
You do your best to mitigate issues. “Doing your best” means combing the documentation, in this case item_details, and writing tests based on what’s described there. You might want to try making a fixture for one of each type of item, and running it through your unit test.
If you’ve done your job correctly, you’ll be pretty well set. Then, it’s up to the API’s creators to communicate with the community about possible breaking changes. (Spoiler Alert: things will be changing soon).
(edited by Killer Rhino.6794)
NO XML! Srsly.
To repeat what smiley said, I just don’t get it….I just…why?! You could write a JSON→CSV parser in a weekend if absolutely need some format to import into Excel.
Also, doesn’t this do what you need? http://stackoverflow.com/a/7300926/623771
In closing: JSON.
Hey gang,
Mentioned by Stefan in this recent API article:
“These new APIs, along with all previous v1 APIs, will be released under a new v2 root, which is a bit cleaner and more consistent than our v1 APIs, and offers some bulk access capabilities,” Larimore says.
Which is to say, the GW2 API will be versioned, and your wrapper’s requests and responses will need to be updated.
If your wrapper happens to be open-sourced, I’d recommend reading these pro tips on how to be a good ocommunity-developer steward, and ways to demonstrate good, positive stewardship overall.
end communication
Yeah…nothing different from when I prodded Stefan 2 months ago.
The world holds it breath.
Lazarus,
I would highly discourage you from modifying your NSURLConnection delegate to ignore certificate checks. Please review that SSL post; it contains some very relevant links for someone like you, who is developing with Cocoa-technologies.
Just read that post. Thanks for the write-up. I’ll implement pinning as recommended in the next version. Cheers.
In GWKit, networking is obfuscated behind RestKit (which, in turn, relies on AFNetworking for its networking layer).
Although I’m not cert pinning, if you want reliable, easy cert pinning in a shortest amount of time, AFNetworking can provide you that.
Lazarus,
Author of GW2Kit here, and I can not reproduce your certificate issue (just pulled Events using GW2Kit’s iOS test app, both on the simulator and the device).
I would highly discourage you from modifying your NSURLConnection delegate to ignore certificate checks. Please review that SSL post; it contains some very relevant links for someone like you, who is developing with Cocoa-technologies.
110% agree with the OP. The response structure is certainly kludgy, and I’m surprised that this hasn’t been more of a contentious topic here.
I suspect that most people are just used to it at this point. The good news is that there’s so few updates to the APIs that you’ll have plenty of time to work on hacks which can compensate.
OH SNAP!
See this thread: https://forum-en.gw2archive.eu/forum/community/api/Event-Details-API-location-coordinates/2262330
or the TL;DR version over here: https://github.com/codemasher/gw2api-tools/blob/master/examples/gw2location.php#L209
MY EYES!!! THEY’RE BLEEDING OUT MY SKULL!!!
Orthas,
I wouldn’t take it personally. smiley has been one of the most gracious voices on this sub forum, and sometimes answering the same thing all the time bums one out.
Building the type of experience you’re describing is a lot of work, no matter what the language you program it in. First, see if the answers provided in similar forum posts help you get the ball rolling. If your research only leads to more questions, I’d encourage you to post follow-up questions, resurrecting the very thread you found unclear.
We’ve seen this same question asked every couple of weeks, for the last six months almost. Can we please sticky this?
To Wolf Fivousix.4319:
If u are new to C++ and want an easy time working with the GW2 json based service, you really should look more at the REST API. Check this:
Here is the MSDN Blog post about Casablanca from back in February, which, I feel, could help provide some context for less experienced coders.
I’m still putzing around about requesting wiki access, but in the meantime, it occurred to me that myself and other regulars on this sub forum are constantly reading and replying to many of the same questions over and over.
Thankfully, getting involved with the APIs seems to be getting more popular over time, and I think a Beginner/Intro FAQ on the API section of the wiki (and conveniently sticky’d to the top of this sub forum) which includes answers to all the common questions (rate limits, authorized requests, response format, etc.) would be really helpful for newcomers.
Just throwing it out there. Keep up the good work, er’body!
Any way to get the historical prices of the items from the API ? (sell and buy sides)
Right now I’m using GW2Spidy api but relying on GW2 servers would be better for me.
thx !
Nope. In order to aggregate TP data over time, you would need to do exactly what gw2spidy.com is already doing, which is to say, constantly poll, collect and store the TP data in some manner.
If you don’t want to rely on gw2spidy.com remotely, you can fire up your own version of the site. For some time, the author of gw2spidy.com has graciously open sourced his code and provided detailed instructions on how to use it on the project’s GitHub page
Shameless Plug: If you want to write iOS or OS X apps which can query gw2spidy.com, check out GW2Kit
Can we get an update on the progress of OAuth? Thanks!
To be clear: this is a forum to discuss the publicly available API’s which ArenaNet has released for community developers to gain access to certain in-game information, such as the state of dynamic events for a given map, or the values of a WvW matchup between two certain worlds. (Sound neat? Check out its wiki page for more information on what’s available).
It is not a discussion, technical review, or pulpit for commentary on the inner-workings of the game’s engine. Guild Wars 2’s game engine is entirely private and non-accessible to anyone other than the appropriate employees of ANet, so I’m guessing you won’t get the answer you’re looking for here.
Wolf,
This should help you get started: Client/Server Programming with TCP/IP. It’s quite descriptive, with specific client-side C++ examples for Windows using winsock.
Wolf, my first suggestion is to stop thinking about your goal in terms of any specific language.
Take a step back and look through the API’s wiki page: http://wiki.guildwars2.com/wiki/API
The main API wiki page lists the services (also referred to as “endpoints”) that can be contacted for specific information. It is a good idea to read through each service’s description to better understand what data you can query Also, this is your chance to consider what specific information you’d be most interested in pulling down first when you eventually start coding.
It’s tempting, as a first-time explorer, to say, “I’m going to get ALL the THINGS!” But, if this really is your first foray, having a simple, concrete goal will keep you focused and less prone to failure.
Next, look through a couple of endpoints on the wiki. It might not be obvious, but all of the services return their data in the same lightweight data-interchange format, called JSON (short for “Javascript Object Notation”).
Portable data formats have come a long way in the last twenty years, and JSON is one of the simplest among them. It only is capable of encoding 6 types of values:
- string
- number
- array
- ordered collection of other value types
- boolean (yes/no)
- object
- a key/value pair;
- ‘key’ must be a string;
- ‘value’ must be one of the 6 other valid types;
- don’t confuse these with C++-type objects
- and null
- aka, a value defined as having “no value”
The entirety of a single JSON response can only be structured in one of two ways: as an array of values (referred to as an ordered set), or an object value (referred to as an unordered set). You will never see a valid JSON response that doesn’t begin with one of these two structures.
- In the case of the array (ordered set), the JSON response starts and ends with square brackets (“[ … ]”).
- In the case of an object value (unordered set), the JSON response starts and ends with curly braces (“{ … }”).
JSON has no concept of indentation, or other textual formatting attributes. However, it is often helpful to “pretty-print” your responses; paste your JSON text into JSONLint to see it human readable.
Now, for an example: let’s take a look at the /files endpoint.
This service returns an unordered set of other objects. When we pluck out the first object in the set, we see:
"map_complete": {
"file_id": 528724,
"signature": "5A4E663071250EC72668C09E3C082E595A380BF7"
},
Turns out, this first object was, itself, an unordered set of other objects.
If we read the documentation for the /files endpoint, we find out that the data returned is meant to be used in conjunction with the render service endpoint. A lot of GW2 services work like this; it’s too much of burden to return every single detail about something, so instead, you’ll get a lot of reference IDs to use as input to other services.
In all, once you’ve comprehended the extent of what information is available from GW2’s APIs, understand the format the data is being transmitted in, and grasp the manner in which services work in tandem, you’re finally ready to write code that does the actual work.
Like XML in it’s heyday, there is no shortage of languages with frameworks which help you work with JSON. I suggest Python, Ruby, or JavaScript (obviously) to start; these languages enable you to query GW2’s APIs in just few lines of code.
To see examples of community-built GW2 frameworks (in various language), check out the list of API wrappers on the wiki.
(edited by Killer Rhino.6794)
I like this. At the very least, the response should include the “Hue” which the color is organized by in the game’s own dye picker UI, no?
I was just expressing a desire to see the data retrievable in an XML tree, as I’m more adapted at XML data manipulation.
Is there a particular language you’re using? The list of API wrappers has numerous projects in various languages that might be able to help you jump start past any unfamiliarity you have with JSON.