Mauchkiv.8074 Posted October 26, 2017 Share Posted October 26, 2017 Hello guild devs! I have plans to make some app for personal use and just explored the [gw2wiki](https://wiki.guildwars2.com/wiki/API:Main "gw2wiki Wiki") to check out the endpoints. I'm especially interested in _/v2/characters_. What I wan to know is how can I get a list of my characters ids? This endpoint only list the character names. But according to wiki I have to use _id_ if I want to get data for one character, like so _v2/characters/:id/core_. But how do I get it? After playing around more I found I can get data for one character by URL encoding its _name_ and use it as _id_. That's a bit surprising. • How do I get character _id_? Am I doing something wrong? • Is using _name_ as _id_ intentional? Why? Best regards! Link to comment Share on other sites More sharing options...
akenoyuki.8210 Posted October 27, 2017 Share Posted October 27, 2017 To get your list of character you need an API keys, you can create it [here](https://account.arena.net/applications "here") To get list of character inside an account: `https://api.guildwars2.com/v2/characters?access_token=` To get basic info about an specific character `https://api.guildwars2.com/v2/characters//core?access_token=` For more info about character you can change the "core" text to "equipment" / "inventory" / etc. Example: `https://api.guildwars2.com/v2/characters//inventory?access_token=` Hope it helps ;) Link to comment Share on other sites More sharing options...
Zok.4956 Posted October 29, 2017 Share Posted October 29, 2017 > I'm especially interested in _/v2/characters_. What I wan to know is how can I get a list of my characters ids? This endpoint only list the character names. > But according to wiki I have to use _id_ if I want to get data for one character, like so _v2/characters/:id/core_. But how do I get it? > > After playing around more I found I can get data for one character by URL encoding its _name_ and use it as _id_. That's a bit surprising. > > • How do I get character _id_? Am I doing something wrong? I also have never found out how to get a list of character-ids, so I use the characters names (encoded) as the ":id"-part of the api-endpoints. It feels a little strange to use the character-name (that can have special characters) as an index/id. Maybe it was planned to return real IDs (e.g. numbers) but it was not finished and then it stayed that way. Link to comment Share on other sites More sharing options...
WeAreTwO.9780 Posted October 30, 2017 Share Posted October 30, 2017 > It feels a little strange to use the character-name (that can have special characters) as an index/id. Maybe it was planned to return real IDs (e.g. numbers) but it was not finished and then it stayed that way. > > You are doing the right thing. There isn't something like an id for a character. I totally agree, that using that character name as 'id' is a bad idea, because of special characters. I think the whole game servers are not designed to have an API and therefore people have to do hacky things to get the information into a database. Link to comment Share on other sites More sharing options...
SkyShroud.2865 Posted October 30, 2017 Share Posted October 30, 2017 If you are doing it on script or code, you can put your auth code via the http headers with "Authorization:[key]" Link to comment Share on other sites More sharing options...
Mauchkiv.8074 Posted October 31, 2017 Author Share Posted October 31, 2017 Thank you all for your replies! I got what I wanted to learn. :smiley: Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now