[API Suggestion] Few generic API Suggestions

[API Suggestion] Few generic API Suggestions

in API Development

Posted by: Chik En.8973

Chik En.8973

#1

It would be nice that with every request a index in time was returned, in the form of a typical unix timestamp 1380310841 (see here)

So that when calling any API a optional parameter would be passed such as
https://api.guildwars2.com/v1/event_details.json?since=1380310841

Would only provide event details of what has changed since this time stamp.

This might lighten the load for processing and updates as well.

#2

I see some basic information about the data type’s such as Numeric or Int or String

But it would be good if precision was provided as well and a simpler way to take note of the data such as (for the wiki)

String(42)
Numeric(16,2) or Numeric(4,0) etc..
Date(YYYY-MM-DD)
Datetime(YYYY-MM-DD HH:MM:SS)
unixtimestamp()
LIST[String(32),Numeric(3,1)]

Just some suggestion, does not cover all data types such as signed or unsigned numeric.

Also it would be good if the Json api would take a API parameter to output this information with the build number such as

https://api.guildwars2.com/v1/event_details.json?datatypes=true

To display that information in json format of
field_id, fieldname, type, precision, parent_id

where parent id is used for lists (nesting)

This is just a quick suggestion, I have not hashed out everything and the forum search feature would not work at all in any browser to determine if anyone suggested this or similar.

(edited by Chik En.8973)

[API Suggestion] Few generic API Suggestions

in API Development

Posted by: smiley.1438

smiley.1438

Regarding #2: Javascript is a typeless language and since JSON is a subset of Javascript it’s typeless aswell. I don’t think there’s much need for extra information about the datatypes since most of them are obvious. The wiki already covers this information if you really need it (e.g. http://wiki.guildwars2.com/wiki/API/item_details).

[API Suggestion] Few generic API Suggestions

in API Development

Posted by: Chik En.8973

Chik En.8973

Regarding #2: Javascript is a typeless language and since JSON is a subset of Javascript it’s typeless aswell. I don’t think there’s much need for extra information about the datatypes since most of them are obvious. The wiki already covers this information if you really need it.

If you intend to do data persistence to a database such as MySQL or any other, knowing data lengths without guessing and hoping to avoid truncation is a needed factor. Not everything will be created in javascript. A efficient programmer does not just put String(1000) just in case, if you only need a varchar of 3, it would be nice to know.

And the wiki only covers some basic info as I said.

My objective for these two suggestions is to persist the data and hit the api with less load, hopefully avoiding unneeded pulls, example.

1) If the build number has not changed, there is no need to update the map locations.
2) only pulling data that has changed since XXXXX

The Schema built in is typical of other API’s such a webservice

Example of a webservice http://wsf.cdyne.com/WeatherWS/Weather.asmx
Example of a webservice exposing its Schema through a parameter http://wsf.cdyne.com/WeatherWS/Weather.asmx?wsdl

Just saying this would be nice for those who might want to persist the data and lighten the load to the API server

[API Suggestion] Few generic API Suggestions

in API Development

Posted by: smiley.1438

smiley.1438

I can still see no reason to include this info in an API response – like i said, most of it is obvious and if not, it is (or should be) covered in the wiki since it’s the official API documentation. Feel free to apply as API editor to help and add info which you think is missing.

Btw. in the MySQL example you mentioned, of course you wouldn’t create a varchar(x) field if you don’t exactly know the data length – you’d just use a tinytext/text/mediumtext/longtext http://dev.mysql.com/doc/refman/5.1/en/storage-requirements.html

(also: keep in mind the overhead a response would have, especially XML)

(edited by smiley.1438)

[API Suggestion] Few generic API Suggestions

in API Development

Posted by: athanor.7410

athanor.7410

Websockets for the event would be good so we can retrieve only event status changes

[API Suggestion] Few generic API Suggestions

in API Development

Posted by: Mechamilk.7809

Mechamilk.7809

We really need an XML version, please implement it. I need a easy way to elaborate data on excel. It will open a world of statistics.
I play only WvW and i love to work with data, statistics and predictions. I think WvW need an easy way to elaborate all the data between this type of game. With a simple tutorial much more people will use it. Best regards.

Charr Ögne [OWTL] VS Commander

(edited by Mechamilk.7809)

[API Suggestion] Few generic API Suggestions

in API Development

Posted by: smiley.1438

smiley.1438

I still wonder why (a very few) people still demand XML as data format. Ok, i can understand that it might be easier to parse in certain languages but i can’t see an advantage over JSON in the case of the GW2 API (and many more…). Don’t get me wrong, but personally i’d kill XML with fire – along with excel. Any decent language has possibilities to parse JSON easily (either native or as library) and also i heard that SQL databases are pretty handy when it comes to statistics. So when you’re working with MS-Office, you should at least favor Access over Excel.

Also for the notes – just for example:

https://twitter.com/thomasfuchs/status/379675885647192065 / https://gist.github.com/madrobby/6584720

[API Suggestion] Few generic API Suggestions

in API Development

Posted by: Stefan Larimore.6872

Stefan Larimore.6872

Programmer

Offering alternative data representations (such as XML) is planned, but not anytime soon. In the meantime I’d recommend using a simple JSON to XML translation library, of which there are several. There are even web-based translators you can play around with.

[API Suggestion] Few generic API Suggestions

in API Development

Posted by: The Ice Mage.4879

The Ice Mage.4879

Apologies if this is not the best place to post this but here goes anyhoo.

I was wondering, is there a way currently to retrieve player Achievement Point scores from the leaderboard? I was just thinking it’d be cool to be able to retrieve player’s scores. I had been playing around trying to make a little Java GUI that would take in data of some kind about, for example, my score and generate a graph but I had problems trying to get stuff for drawing functions working and I’ve been a bit busy with other things so haven’t dedicated more time to resolving the issue yet…
But either way getting back on topic, having a way to retrieve achievement point totals would be nice IMO.

[API Suggestion] Few generic API Suggestions

in API Development

Posted by: Killer Rhino.6794

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.

Creator of GW2Kit

[API Suggestion] Few generic API Suggestions

in API Development

Posted by: smiley.1438

smiley.1438

Also:

Not to speak of the overhead XML has compared to JSON.

[API Suggestion] Few generic API Suggestions

in API Development

Posted by: HaydenTheGreat.8362

HaydenTheGreat.8362

The near fact that most replies and posts on the forum site are all over four months to a year is a disappointing site to see. Being an long time Guild wars 2 player and also one of Dragonbrand’s Public Relation Administrator, I see the struggle of replenishing numbers with in the game, the effects or long term players who get bored, and leave, and the over all satisfaction/dissatisfaction of changes to the game so far. The upgrades, changes, and updates have all been correct actions in the end. The Living-story content in some opinion is to easy or boring, but the pace is picking up, which is inspiring some to return to the game. But in my honest opinion the one and nearly the only thing that ANET does in correctly is the advertising. Advertise the game, truly invest in getting the game out there. the game has been one of the biggest marketed MMOs in the West and has a huge Eastern population as well, but the game needs to keep advertising. Not on Facebook and other social media, but an honest to god commercial. WoW has the luxury of being able to create a commercial yearly, I know with funding being different since the game isn’t subscription, but if you truthfully want more active users then you must advertise your changes and game more sufficiently. Also make it worth new players joining the lower Tier Servers. For example “All new players will receive Karma Boosts, Experience Boosts, a Black Lion Key, 5 gold to make their home on Anvil Rock, or SoR” We need to push for players to pick up the game in the lower tier Servers so they wont instantly want to transfer due to the fact the population may be lacking. If players start their they will tend to stay if they see other players of he some par. Leading to cultivation. I hope some one in ANET reads this and considers this. -Sir Hayden