Alternative to GET users/profile_image in API v1.1?

nivs
@nivs Niv Singer

API v1 included a GET users/profile_image method for retrieving a link to a user's profile image.
Is there an alternative in API v1.1?

Thanks,
Niv

1 year 2 weeks ago

Replies

mattrogowski
@mattrogowski Matt Rogowski

users/show will contain this, as will account/verify_credentials if you'll just be doing it for the current authenticated user.

1 year 2 weeks ago
nivs
@nivs Niv Singer

I was hoping for something that can be used as a SRC attribute, but they seem to have removed this functionality on purpose. Found this reply at the "Discussion around Planning API v1's Retirement" discussion:

@episod
There is no direct way to use API v1.1 for just profile images -- API v1's feature that provided this was often used in unintended ways counter to the documentation, as the SRC attribute in IMG tags. You'll need to make authenticated requests to canonical sources of user information (users/show or users/lookup) to retrieve the most recent profile image URL, then use the instructions in User Profile Images and Banners to derive the version you're looking for.

1 year 2 weeks ago
mattrogowski
@mattrogowski Matt Rogowski

Yeah it would never have been a good idea to use it like that really anyway, especially considering it's rate limited. Using the URL from the user object or even storing the image on your server and serving it yourself would always have been a better solution.

1 year 2 weeks ago