How to use api to get profile image?

It seems that you can get the user profile using “…/api/v4/users/USER_ID/image”.

But the returned value looks like an encoded value, how do I convert it? I am a novice developer, so I am not sure what to do.

Any advice would be greatly appreciated.

Hi, @Karmantez

Can I please confirm if you are getting something like this on your end?

Ahmad-Danials-MacBook-Pro:~ ahmaddanialmohammad$ curl --location --request GET "" --header "Authorization: Bearer XXXXXXXX" --header "Content-Type: application/json"
Warning: Binary output can mess up your terminal. Use "--output -" to tell
Warning: curl to output it to your terminal anyway, or consider "--output
Warning: <FILE>" to save to a file.

Additionally, when you output it to a file, it just shows random characters?

Ahmad-Danials-MacBook-Pro:~ ahmaddanialmohammad$ curl --location --request GET "" --header "Authorization: Bearer XXXXXXXXX" --header "Content-Type: application/json" --output test.txt

Hi :wave: i’m getting an output like this, is there a way to convert it?
Make a request on SSR <img src={‘localhost:3000/api/mattermost-img?mattermostId=[XXXXXXX]’}/>

Hi @Losilyus , welcome to the Mattermost forums and sorry for the late reply!

I’m a bit lost on your request, sorry - what’s SSR? and where did you execute this request and what’s running on port 3000?
Can you please post the full request and repsonse here?