Showing Posts For smiley.1438:

Can the wiki get access to the API?

in API Development

Posted by: smiley.1438

smiley.1438

I already did so over here: https://github.com/codemasher/gw2-database/commit/44dffaded5e543a997db9e9185631eb157acb206#diff-39b57f3d58b93c50a34158b6d2d24065L1
(but only for the german and a little of the french wikis)
Since the wikicode is a mess and the templates are different in each wiki, i resigned…

(edited by smiley.1438)

Launching /v2/characters

in API Development

Posted by: smiley.1438

smiley.1438

Thanks for the heads-up, Lawton!

https://twitter.com/iamdevloper/status/450905958139834368
https://twitter.com/iamdevloper/status/438408934458941440

:D

git commit -am “DEAL WITH IT” && git push -f origin master

(edited by smiley.1438)

Launching /v2/characters

in API Development

Posted by: smiley.1438

smiley.1438

This is a known bug for ages. Can’t you just switch to… say Invision Power Board?

No, for reasons. Stay on-topic please.

Attachments:

Launching /v2/characters

in API Development

Posted by: smiley.1438

smiley.1438

(EDIT: noting that there’s a bug in the forum redirection thing that converts & to & which isn’t very helpful).

This is a known bug for ages. Can’t you just switch to… say Invision Power Board?

Launching /v2/characters

in API Development

Posted by: smiley.1438

smiley.1438

Neat ^.^

Edit:

https://api.guildwars2.com/v2/characters?page=0&page_size=50&access_token=API_KEY doesn’t seem to work, i get a {text: "ErrPermission"}

same for https://api.guildwars2.com/v2/characters/<NAME>?access_token=API_KEY

https://api.guildwars2.com/v2/characters?access_token=API_KEY works fine

&ids=all also doesn’t work… would be fine though.

(edited by smiley.1438)

Cross-Origin: v2/transactions

in API Development

Posted by: smiley.1438

smiley.1438

@mav: you have to include the token into the URL using the “access_token” parameter. A cross origin request won’t work with extra headers. (see: https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS#Simple_requests )

(also “Access-Control-Allow-Origin” is a header a server has to respond with)

(edited by smiley.1438)

Floor Coordinates to In Game coordinates?

in API Development

Posted by: smiley.1438

smiley.1438

See this thread: https://forum-en.gw2archive.eu/forum/community/api/Plotting-events-on-a-map/2916120 (you might want to reverse the calculation then )

HEADS UP: OAuth2 being replaced next week

in API Development

Posted by: smiley.1438

smiley.1438

And to all the “API-Key-Hater” (for a lack of better wording), you really should look how EVE and CCP do it. It is an awesome system and they have ran with it for years and never had any big problems.

XML API

…well, nobody’s perfect (glad they also offer JSON). However, as already pointed out, it also uses OAuth – for some good reasons, i guess. Hey, they even offer “Login with EVE Online” buttons on the bottom of that page!

Web registration using keys?

in API Development

Posted by: smiley.1438

smiley.1438

How would you know that the API key belongs to the user who is about to register with your site? I already pointed out that the API key system makes User authentication (e.g. like login with google, twitter, github etc.) for 3rd party websites pretty impossible.
https://forum-en.gw2archive.eu/forum/community/api/HEADS-UP-OAuth2-being-replaced-next-week/5049146

Launching /v2/commerce/transactions

in API Development

Posted by: smiley.1438

smiley.1438

I’ve got some problems accessing some endpoints…
[…]

You need to pass along a few more options to curl to make it work with SSL:


curl_setopt_array($ch, [
	CURLOPT_URL            => $url,
	CURLOPT_SSL_VERIFYPEER => true,
	CURLOPT_SSL_VERIFYHOST => 2,
	CURLOPT_CAINFO         => '/path/to/cacert.pem', // download from: http://curl.haxx.se/ca/cacert.pem
	CURLOPT_RETURNTRANSFER => true,
]);

Api fair use question

in API Development

Posted by: smiley.1438

smiley.1438

HEADS UP: OAuth2 being replaced next week

in API Development

Posted by: smiley.1438

smiley.1438

If your intention is to not have 3rd party sites link to login pages, i don’t expect 3rd party sites that are safe will not just link to https://account.guildwars2.com/account/api-keys/create

The sites that do want to steal you account info wont even care and just still link to their login page instead (you expect the user to know how the authentication process work?)

Anyway it seems you are set on the change so i better just get on with the annoying process of writing/recording tutorials

Fun fact: this was a point i made in the #gww IRC yesterday, transscript below:

[20:30] <Smiley_> the problem with the oauth redirect actually isn’t that a 3rd-party redirects to a login-page but that the owner of the login page has to make sure that the users can easily identify phishing attempts (ssl server certificate)
[20:31] <Smiley_> (by owner of the login page i mean anet)
[20:32] <Smiley_> so when you see a green “Arenanet, Inc.” on the left side of your address bar, you can be pretty sure, you’re not getting phished
[20:33] <relic> I would not rely on users paying attention to the certificate
[20:34] <Smiley_> thats what i meant with “you cannot mitigate PEBCAK” – there are still people who click links on spam emails
[20:34] <Smiley_> natural selection
[20:37] <relic> API keys means that never happens in the first place though
[20:38] <Smiley_> i could easily make up a site which looks exactly like the gw2 account management
[20:38] <Smiley_> in fact, it’s even worse this way
[20:39] <relic> what, so the application links to a faux official site to login to for an api key?
[20:40] <Smiley_> the same which would redirect to a faux official site to login for oauth2 authorization
[20:40] <Smiley_> now tell me whats worse?
[20:43] <relic> both seem equally bad to me
[20:43] <Smiley_> right
[20:43] <Smiley_> so now what’s the advantage of api keys over oauth2?
[20:46] <relic> the user is only vulnerable at the one point they go in to generate an api key right? rather than every app authorization?
[20:47] <Smiley_> ideally you’d have to create a different key for each application, so the risk is potentially the same
[20:49] <relic> sec, I should check the management page lol
[20:51] <relic> but you are doing it from the official website
[20:52] <relic> A faux website couldn’t replicate the keys you manage as well even if they got everything else right
[20:52] <Smiley_> you still have to get there first – how many users do have it open in a tab all the time and how many would just click the lazy link on the 3rd party site “go here to create an api key”
[20:52] <Smiley_> you don’t need to create the key
[20:53] <Smiley_> as a phisher you want the login data
[20:53] <Smiley_> the damage is done in the moment you click “log in” on a faux login site
[20:57] <relic> with oauth, if you are already logged in with a session key, you can authorize immediately
[20:57] <relic> having the person login to a fauz official website seems much harder to phish with
[20:59] <relic> I think that method would happen just as much whether you use oauth or api key :/
[21:00] <Smiley_> right, thats why verified ssl certificates matter
[21:02] <relic> how does that make a difference?
[21:02] <Smiley_> that green thing in the address bar jumps at you
[21:03] <Smiley_> see: https://github.com/
[21:03] <relic> no kitten, what is the difference in regards to oauth and api key methods?
[21:04] <Smiley_> oauth is user friendly, also the token exchange happens between the servers
[21:05] <Smiley_> you have to keep in mind that the api key is basically the access token in oauth2 which noone would see (except the database owner maybe)

Plus: API keys are useless for user authorization, which may be pretty handy for e.g. character websites

(edited by smiley.1438)

Proposal: Enemy API

in API Development

Posted by: smiley.1438

smiley.1438

A creature API. I like that idea. There you go: https://github.com/arenanet/api-cdi

HEADS UP: OAuth2 being replaced next week

in API Development

Posted by: smiley.1438

smiley.1438

instead of registering an app and going through the OAuth2 code flow, users simply create and copy-paste an API key into your client.

I doubt that this would make anything better for the users. There are a lot of people out there who hardly know to start a pc and run their game – imagine these to create and use an API key. Despite of it’s flaws, OAuth2 is being used all over the web for way more sensitive applications and most users are used to it. I mean, we’re talking about an API account which reveals little sensitive data, not actual user account info (e.g. real names, address, billing info).
So the only thing you might mitigate is that a user gets their login data scammed (which also happens in so many different ways) at the cost of making the login flow less user friendly. You cannot mitigate PEBCAK.

Rata Sum (Map Tiles)

in API Development

Posted by: smiley.1438

smiley.1438

Ohhh, i see. Well, thats in fact weird. I checked back with my own map and it’s the same there, so no error on your end

Rata Sum (Map Tiles)

in API Development

Posted by: smiley.1438

smiley.1438

Seems fine to me: http://gw2.chillerlan.net/examples/gw2staticmaps.php

continent_rect: [[4608,19710],[7168,22270]]

Online Character Viewer

in API Development

Posted by: smiley.1438

smiley.1438

so, if i understand this right… i would have to be using the app, and then log in to my account on guildwars2.com… and then grant permission. so if i never use any apps, then they’ll never gain access to any of my information.

Exactly this.

Online Character Viewer

in API Development

Posted by: smiley.1438

smiley.1438

You will know, however, if an app is requesting access to your credentials before you even allow it since you’ll get a page like this: http://i.imgur.com/E9XKVy3.png which actually sits on ANet’s servers.

After the login screen you’ll get a screen which will be similar like the following (similar as in: the wording will be clarified). Note the URL, the login and the authorization will always happen on Anet’s servers.

€: If you’re interested in how OAuth2 actually works, you might want to read this: https://aaronparecki.com/articles/2012/07/29/1/oauth2-simplified (or just google for OAuth2)

Attachments:

(edited by smiley.1438)

Online Character Viewer

in API Development

Posted by: smiley.1438

smiley.1438

The idea has already been mentioned in another thread, but i forgot where it was.

https://gateway.playneverwinter.com/ (hint, hint!)

[Solved] API Rate Limits

in API Development

Posted by: smiley.1438

smiley.1438

Item-ID by name?

in API Development

Posted by: smiley.1438

smiley.1438

HANDY…. I see it is limited to API items (tested it against some old pvp skins). Since this is http, do you have a way to do a search for something that includes a space?

urlencode.

http://gw2tno.com/api/finditemidbyname/Gift%20of%20Twilight (a simple + as space doesn’t seem to work)

API CDI 2015

in API Development

Posted by: smiley.1438

smiley.1438

This may be a little off topic, but https://hom.guildwars2.com/character/Lady%20Mimikry please?

Player position

in API Development

Posted by: smiley.1438

smiley.1438

Enable keep-alive and pipelining?

in API Development

Posted by: smiley.1438

smiley.1438

So where’s the problem then? (We’re talking about ~38k items and ~150MB DB size)

I’ve a very slow connection, so i can only estimate – there have been reports from like a couple seconds to a few minutes. However, it also depends on the amount of languages you pull from the DB.

Enable keep-alive and pipelining?

in API Development

Posted by: smiley.1438

smiley.1438

On a sidenote: an even better solution would be, if you could enable ?ids=all for that endpoint.

I guess the servers would then explode…

I’d recommend you something like RollingCurl which speeds up the whole process (a few minutes on a fast connection).

https://github.com/codemasher/gw2-database/blob/master/classes/rollingcurl.class.php
https://github.com/codemasher/gw2-database/blob/master/classes/gw2items.class.php#L186

What font does the UI use?

in API Development

Posted by: smiley.1438

smiley.1438

*casts bubble*

[Request] GW2Link as Overwolf App

in API Development

Posted by: smiley.1438

smiley.1438

(edited by smiley.1438)

Launching /v2/account (w/ Authentication)

in API Development

Posted by: smiley.1438

smiley.1438

We’ll work on making those strings a little more specific, if anyone has any examples of sites that do a really good job of describing OAuth scopes in consumer-friendly language I’d love a link. Most in my experience has been similarly-generic text.

GitHub.

https://help.github.com/articles/connecting-with-third-party-applications/

Attachments:

[API Suggestion] Skills and Traits

in API Development

Posted by: smiley.1438

smiley.1438

copy-paste all trait names and descriptions (1280 separate strings if I didn’t miscount) manually from the wiki…

WAT? You know there’s a Mediawiki-API which allows you to automate such things?
http://www.mediawiki.org/wiki/API:Query

You can also use the powers of SMW: https://semantic-mediawiki.org/wiki/Help:Semantic_search

Launching /v2/account (w/ Authentication)

in API Development

Posted by: smiley.1438

smiley.1438

So here’s a working PHP example: https://gist.github.com/codemasher/89a909626724d929fd04

Launching /v2/account (w/ Authentication)

in API Development

Posted by: smiley.1438

smiley.1438

but at the end of the callback method I now know that the browser I’m talking to is that person, and I could (kind of) use it authenticate users into my website without having to have my own user/pass system.

That’s basically what the “Login with Google/Facebook/Twitter” button on many websites does.

Btw. for PHP users: https://code.google.com/p/simple-php-oauth/

class GuildWars2 extends SimpleOauth{
	protected $_prefix = 'guildwars2';
	protected $_authorize_url = 'https://account.guildwars2.com/oauth2/authorization';
	protected $_access_token_url = 'https://account.guildwars2.com/oauth2/token';
	protected $_scope = ['account', 'offline'];

	protected function authorize(array $scope = [], $scope_separator = '+', $attach = null){
		parent::authorize($scope, $scope_separator, '&response_type=code');
	}

	protected function requestAccessToken(
		$method = 'GET', 
		array $params = ['grant_type' =&gt; 'authorization_code'], 
		$returnType = 'json', 
		array $values = ['access_token', 'token_type', 'scope', 'refresh_token']
	){
		parent::requestAccessToken($method, $params, $returnType, $values);
	}

}

€: https://gist.github.com/codemasher/89a909626724d929fd04

(edited by smiley.1438)

API CDI 2015

in API Development

Posted by: smiley.1438

smiley.1438

This would allow to get more than one language with one request and would make these almost redundant requests required at the moment obsolete.

This is what i’ve requested more than once, see also:

https://github.com/codemasher/api-cdi/commit/02fd35622ef844e3d8c2d7974e462c8478f6def2
https://github.com/codemasher/api-cdi/commit/c105219b42413e047ce0e985dca93a13910c5817

Corsair K70 Question

in API Development

Posted by: smiley.1438

smiley.1438

Oh i see, you meant espeacially for your keyboard (realtime tracking was the buzzword). Well, lets see what the future brings.

Corsair K70 Question

in API Development

Posted by: smiley.1438

smiley.1438

Great to hear that it’s a desktop API (sorry, I’m a web developer by trade so I am hardwired to think APIs are for remote locations, so I wanted to clarify).

Aw, now that is a shame. Maybe a new API for more “realtime tracking”? I would really like to get my hands on something like that; the possibilities are grand. Not only would I be able to do this thing with my keyboard, but I’m sure there could be some widgets made that do some very nice things, like enhanced alerts (for low hp or low stamina), or some neat conditional display based on race / profession.

Maybe if the map location were also put in this theoretical API, you could do a heatmap of the world too, to see where the players using this widget are, currently.

Of course, I’m not familiar with a codebase as complex as GW2 (probably) is, so I don’t really understand the level of effort something like this would take. Surely there isn’t a whole lot of data that people would want, though.

This is probably what you’re looking for:
https://forum-en.gw2archive.eu/forum/community/api/Gw2-Location-Tracker/first#post2379754
https://forum-en.gw2archive.eu/forum/community/api/Map-API-Mumble-Mashup

(edited by smiley.1438)

API CDI 2015

in API Development

Posted by: smiley.1438

smiley.1438

Actual search endpoints is definitely something I’ve been looking into. The way we pull content data right now is to basically load stuff from the dat file — which is designed for semi-random access and doesn’t really yield itself to indexing. So I’m trying to pull all the data into a more normalized format so we can load it into search indexes and index all the things (not just items/recipes, but also future endpoints like skills and maps and whatnot). Still a ways from being production ready though ;_;

Pretty please with sugar on top! Especially a search endpoint for the maps API (POIs and stuff) would be extremely helpful to create maps for the Wikis.

So please: (couldn’t resist)

Attachments:

API CDI 2015

in API Development

Posted by: smiley.1438

smiley.1438

I’ve already proposed some json structure changes for the WvW APIs, so i’m gonna link these here for now – i’ll create some PR tomorrow.

matches.json https://gist.github.com/codemasher/8876102#file-matches3-json
match_details.json https://gist.github.com/codemasher/8894954
objectives.json https://gist.github.com/codemasher/bac2b4f87e7af128087e#file-gw2_objectives-json
(more to follow)

Thanks for the new floors.json, thats basically what i’ve proposed earlier

API Maintenance 2/13

in API Development

Posted by: smiley.1438

smiley.1438

I noticed some odd behaviour with the v1/skin_details.json end point. It seems to have some encoding issues, but i am not sure if that is related to the maintenance or not, so i am posting it here just incase.
namely, the “Einhänder” and “Zweihänder” got their names all messed up in the v1 endpoint as can be seen here:
https://api.guildwars2.com/v1/skin_details.json?skin_id=5231
https://api.guildwars2.com/v1/skin_details.json?skin_id=5193

the same thing doesnt seem to happen in the new v2 api though :
https://api.guildwars2.com/v2/skins/5231
https://api.guildwars2.com/v2/skins/5193

See: https://forum-en.gw2archive.eu/forum/community/api/Guild-API-strings-are-UTF-8-encoded-twice

Guild API strings are UTF-8 encoded twice?

in API Development

Posted by: smiley.1438

smiley.1438

Yeah, seems like there’s something wrong with the encoding on API side, probably happened during the backend change a couple days ago. API v1 only.

See also: http://wiki-de.guildwars2.com/wiki/Widget:Karte#Beispiel (floor data)

(edited by smiley.1438)

API Maintenance 2/13

in API Development

Posted by: smiley.1438

smiley.1438

Well, having the item database makes this a simple task. Speaking of the colors API:
https://forum-en.gw2archive.eu/forum/community/api/API-Suggestion-Colors-API/2910450

(dang, why has the master sticky thread been unstickied?)

API Maintenance 2/13

in API Development

Posted by: smiley.1438

smiley.1438

After some deep thoughts and a quick huddle over here we’re disabling /v2/floors, we’re not happy with how it looks and want to revisit it before anyone writes code to depend on it.

What can i say? Yay, go for it! Help us to create shiny maps, especially on the Wikis! Everyone wants them but the floors API isn’t handy at all.

API Maintenance 2/13

in API Development

Posted by: smiley.1438

smiley.1438

Thanks Pat!

I wish the floors API would have been changed to be more useful. Seems like we still need to loop through the whole thing to find a single POI.

Also:
https://forum-en.gw2archive.eu/forum/community/api/API-Suggestion-Maps-API/first#post2261295
https://forum-en.gw2archive.eu/forum/community/api/It-has-become-silent-in-here/2501399

[How to] Get chat code with item ID

in API Development

Posted by: smiley.1438

smiley.1438

So here’s a snippet for PHP which works with IDs > 16 bit:

https://gist.github.com/codemasher/47dea40f70f990480c5b

Mystic Forge Recipes?

in API Development

Posted by: smiley.1438

smiley.1438

I stand with the people who want the discovered MF recipes in the API. There’s actually no reason to disclose them, since these are (mostly) documented in the Wiki anyway.

Mystic Forge Recipes?

in API Development

Posted by: smiley.1438

smiley.1438

Are these available on the render service?

in API Development

Posted by: smiley.1438

smiley.1438

Wow, thats great! Thank you!

Are these available on the render service?

in API Development

Posted by: smiley.1438

smiley.1438

aswell as the WvW icons for forts, towers and camps

Especially these. We’ve been asking for those icons at least since the ruins icons have been added to the render service.

https://forum-en.gw2archive.eu/forum/community/api/API-Suggestion-World-vs-World/4345366

(edited by smiley.1438)

[API Suggestion] Server Time

in API Development

Posted by: smiley.1438

smiley.1438

If people from different time zones have access to the same schedule, they have to do some calculation to work out the time on the schedule to there time.

In this case, those people should rather try tools like this one: http://everytimezone.com/

Game pad support, w/ other programs

in API Development

Posted by: smiley.1438

smiley.1438

It is most likely the wrong place to ask. This subforum discusses the API for external uses. I think your question is more appropirate in the main GW2 discussion forum.

[Suggestion] Mystic Forge Recipe API

in API Development

Posted by: smiley.1438

smiley.1438

GitHub is your friend :P

Quick Q: Midnight Ice dye more blue-ish?

in API Development

Posted by: smiley.1438

smiley.1438

According to the colors API it doesn’t seem to have changed. The base color values are:

rgb(0, 0, 8) on cloth
rgb(15, 21, 24) on leather
rgb(1, 17, 23) on metal

Note that the color’s outcome also depends on the base color value of the armor piece to be dyed, so mileage may vary. Maybe they’ve changed the base color of that armor piece when the vault was introduced?
But on the other hand, it also looks “brighter” in the color list, maybe confused it with Midnight Blue dye?

You may also have a look at this: http://gw2.chillerlan.net/examples/gw2color.php

(edited by smiley.1438)