StunlockStudios / battlerite-docs

Documentation and Guides
11 stars 1 forks source link

Making requests for player, based on name rather than id #23

Open aarhusgregersen opened 6 years ago

aarhusgregersen commented 6 years ago

Just comparing this feature visually to another application such as porofessor.gg, it may seem odd to many users of the api to have to use their player ID rather than their player name. I don't even remember how I found my playerID, but I do remember something about grabbing my steam ID first.

Is it possible, to implement the feature of making a lookup based on playername?

Does the api not currently support it? If so, are Stunlock maintaining and developing it?

jsmienk commented 6 years ago

IDs are unique and will always refer to the same user. Also when they change their names. Finding a user and its ID by providing a name is already possible by using the ~playerIds~ playerNames tag in the players API call.

aarhusgregersen commented 6 years ago

Makes sense! Thanks for clearing that up. Couldn't find it anywhere in documentation. so [playerId]=NAME should work to that end?

jsmienk commented 6 years ago

so [playerId]=NAME should work to that end?

Sorry, my mistake. If you want to search by name, use filter[playerNames] as described here: https://battlerite-docs.readthedocs.io/en/master/players/players.html