Showing Posts Upvoted By Glyph.7805:

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' => '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)

[Proposal] Structured PvP API

in API Development

Posted by: Lawton Campbell

Lawton Campbell

Web Programmer

This is definitely something I’d like to see — there’s a huge amount of things that could be done with this. I’m thinking something along the lines of automated duel ladders via a password-protected/guild-only custom arena with an external web interface for match-making and gloating.

For ranked matches, I’m pretty sure we can’t provide data during the match — since you’d be able to inspect your opponent’s builds pre-match-start and other shenanigans. There may be other issues w.r.t. privacy/build secrecy. For hotjoins it’s no big deal since you can see everything in spectate mode; however, it’d be providing an advantage for ranked matches, which is probably something we don’t want. I’m not really sure.

Finally, there’s an issue of data retention — I’m not sure how much historical data we can feasibly store, but there’s a limit somewhere. It’d be on the application developer’s end to archive data, that’s just not something we can do.

Anyway, I don’t know if/when we’ll be able to implement it (or even which parts will come to light), but it’s an endpoint I really want, at least.

[Proposal] Structured PvP API

in API Development

Posted by: Lumiere.4609

Lumiere.4609

Having spent a bit of time watching how most streams for pvp events in GW2 look, I think there is room for ArenaNet to provide some data that would simplify greatly the streams, as well as provide them with real data to generate stats on and work with.

API layout.

It makes sense to layout the API under /v2/ with the rest of the new APIs (and get use of their oauth/new codebase.)

This Document attempts to describe both how it might work specifically and why to do it.

/v2/spvp # open rooms/matches
/v2/spvp/room/{$room_id} # Room information and link to the match in progress
/v2/spvp/match/{$match_id} # Match information
/v2/spvp/stats/{$character/account?} # Stats for an account/character

GET /v2/spvp

Attributes:

  • search – Search for a room name
  • limit – limit count to a number of results
  • offset – start showing with the Nth result (use with limit to paginate)

No Request Body.

Response Example:


{
    "rooms": [
        { 
     	    "name": "Server 023",
            "room_uri": "http://api.guildwars2.com/v2/spvp/room/42",
            "match_uri": http://api.guildwars2.com/v2/spvp/match/47947"
        },
        { 
	    "name": "The Plunderdome",
            "room_uri": "http://api.guildwars2.com/v2/spvp/room/1004882",
            "match_uri": "http://api.guildwars2.com/v2/spvp/match/47948"
        }
    ]
}

(Continues Next Post… 5000 characters… lol)

This is a Cross-Post of https://forum-en.gw2archive.eu/forum/game/pvp/Proposal-Structured-PvP-API to hopefully hit the right set of eyes (after talking to Colin last night )

Yagami Yukari- 80 Sylvari Guardian | Yagami Vita – 80 Human Ele
Strike Force – Jade Quarry