Skip to content

Latest commit

 

History

History
31 lines (28 loc) · 697 Bytes

README.md

File metadata and controls

31 lines (28 loc) · 697 Bytes

gw2-api-wrapper

Initialize

var options = {
	key: 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'
};
var api = new Api(options);

Retrieve data from the api

View full list of supported endpoint on the wiki : API:Main

var endpoint = 'account/banck';
api.get(endpoint).then(function(data) {
	// do something with the data 
})

Error handling

api.get(endpoint).catch(function(error) {
	// do something with the error 
})
api.get(endpoint).then(function(data) {
	// do something with the data
}, function(error) {
	// do something with the error 
})