How to get the URL of letter avatars via SQL

(Christopher Heald) #1

I have been testing search by querying the database to re-create the results-as-you-type in a WordPress wrapper site, but I can’t find a way to determine the filename of users’ letter avatars from the database.

These filenames look like 3_90a587a04512ff220ac26ec1465844c5.png (full path returned by the API search .json is /letter_avatar/username/{size}/3_90a587a04512ff220ac26ec1465844c5.png), and seem to change from time to time (on Discourse updates, on container rebuilds?).

Is the letter avatar filename stored somewhere in the database?

(Sam Saffron) #2

we need another api endpoint added / extended that shared the version of letter avatars.

(Christopher Heald) #3

As a workaround, I have been taking the results of my query, extracting usernames, and then doing an API user lookup. The returned JSON has the avatar information I need, which I combine with the SQL query results. A bit cumbersome.