2

I have the access_token after authentication from the user. At this point I don't know with which sites this user has registered. Is it possible to get user information like the display name or profile picture from here?

I'm aware of /me , but this requires a site to be specified. I suppose I can find the users associated sites with /me/associated and use that info, but... is there a simpler way?

1 Answer 1

2

The /me/associated routeDoc is the preferred way to turn an access_token into a list of users, it returns the collection of per-site user details that can be quickly fetched. It's basically the user's account tab.

If you need more details about a user on a give site, then turn around and hit /me (or /users/{ids}) on the sites you've discovered via /me/associated.

As for display names and profile images, you will have to make at least one call to a site specific method; I typically advise consumers to only query the user's top account (by rep) for that information, it's the same on all sites for > 90% of users with multiple accounts (and > 50% of users only have accounts on a single site). However, if you intend to display all of a user's accounts you will have to make multiple requests.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .