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
An API endpoint to fetch the profile pic of a user OR organization based on the username alone #10132
Comments
Thanks for the issue! We'll take your request into consideration and follow up if we decide to tackle this issue. To our amazing contributors: issues labeled To claim an issue to work on, please leave a comment. If you've claimed the issue and need help, please ping @forem/oss and we will follow up within 3 business days. For full info on how to contribute, please check out our contributors guide. |
I think we should add a |
Seems simple enough, I can pick this one up! 👍 |
Thank you @diogoosorio I just assigned the issue to you |
Hello, I'm new here, this seems an easy task for me to get started. Let me know if I can work on it! 😃 |
@ankiiitraj, thanks for offering, @diogoosorio already claimed this PR but you're welcome to choose any other issue :) You can take a lok at the rest of the hacktoberfest pool or those tagged with difficulty: easy as well Thank you! |
Is your feature request related to a problem? Please describe.
I want to get an avatar URL based on a dev.to username. Since a username can be either for an organization or a user, there is currently no way to do this.
For user profile pics, I can get the profile pic by requesting
https://dev.to/api/users/by_username?url=<username>
. However, there is no corresponding endpoint for organizations at the moment (see #9212).But even if this endpoint did exist, there would still be no way to get the profile pic from username alone, unless you made two requests, one to the organization endpoint and one to the the user endpoint, and then checked which returned a response.
Describe the solution you'd like
Some endpoint along the lines of
/api/profile_pic/by_username?url=<username>
that works with both organization and user usernames.It could also be an endpoint like
/api/profile_info/by_username?url=<username>
which returns basic profile info fields shared across users and organizations such as name, profile pic and location (this would be the preferred functionality).Describe alternatives you've considered
At the moment, I'm just fetching
/api/users/by_username?url=<username>
and if a 404 is returned, I just display a fallback image.Note that you can get organization profile pics at the moment if you have the URL of a post, since the articles endpoint returns the organization info as well as user info, but that only works if you know one of the organization's article URLs.
Additional context
N/A
The text was updated successfully, but these errors were encountered: