Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: username history #227

Open
omkelderman opened this issue Oct 26, 2018 · 7 comments
Open

feature request: username history #227

omkelderman opened this issue Oct 26, 2018 · 7 comments

Comments

@omkelderman
Copy link

with the new website, there's a "formerly known as" thing next to a players username on user profiles. I'd like to get that username history with the API.

I suppose an array of previous usernames (like the previous_usernames in the <script id="json-user" type="application/json"> script block on the website) in /get_user response would work well

@peppy
Copy link
Member

peppy commented Oct 30, 2018

What is the use case for this?

@omkelderman
Copy link
Author

we're currently in the process of rewriting circle-people.com. On the skins page (https://circle-people.com/skins/) theres a bunch of people listed. Right now this is all manual work. If someone renames themselves they gotta be manually updated on that page as well.

The plan for the rewrite is when implementing that page again to have usernames be fetched from the api (so I only store user-ids). But one feature of the current page is that if a user has renamed we show the old name in parentheses behind it so that people who didn't notice the rename can still find said player.

So as a side-note, I would be happy enough with just one old username (like old osu-web does). But hey, if I can show all old ones (like on hover or something), why not?

@peppy
Copy link
Member

peppy commented Nov 12, 2018

Have you tried using the osu-web api out of curiosity? I think this is one feature we’re best waiting for the new API to come into play rather than adding to this v1 api.

@omkelderman
Copy link
Author

I actually have not. I havent really looked into how to use that if im honest. I'm assuming with the osu-web api you mean the /api/v2/* endpoints, the one used by https://github.com/ppy/osu/blob/master/osu.Game/Online/API/APIRequest.cs?

I did play around a bit with the oauth stuff (I have a client on my name, id 11) but I havent used the v2 api. I looked into lazer code so I have a pretty good idea on how it is suppose to be used, just never got around trying it.

If this is a thing to be added to v2 api, at least I did not see it present there currently (I suppose I could even PR it myself xD), how "stable" should I assume those endpoints are gonna be? And with stable I mean feature-stable, not performance or anything.

@omkelderman
Copy link
Author

ok, little update: I just now actually tried the v2 api and saw api/v2/users/:user_id indeed does return an array of prev usernames. So I guess I can use that.

Except I created an access token through my own client (id 11), and I guess for things like this I need a long lived personal access token? (https://laravel.com/docs/5.7/passport#personal-access-tokens) which I could not figure out how to create (POST to /oauth/personal-access-tokens resulted in denied error).

Maybe im doing things completely the wrong way, if so please correct me xD

@Ai-Himmel
Copy link

Ai-Himmel commented Dec 23, 2018

I created a client follow the documentation of laravel. And got a access_token .But with this token ,I can only access api/v2/me. All other API mentioned in web.php return 403.
Did I do something in a wrong way or the api is supposed to be like this.

@peppy
Copy link
Member

peppy commented Jan 15, 2019

To access the other methods you will need to specify a different scope. Currently there are only limited scopes (we restricted it as a security measure) but keep a watch for proper documentation in the near future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants