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 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 hereTo get list of character inside an account:https://api.guildwars2.com/v2/characters?access_token=<API Keys>To get basic info about an specific characterhttps://api.guildwars2.com/v2/characters/<Character Name>/core?access_token=<API Keys>For more info about character you can change the "core" text to "equipment" / "inventory" / etc. Example:https://api.guildwars2.com/v2/characters/<Character Name>/inventory?access_token=<API Keys>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
Archived
This topic is now archived and is closed to further replies.