function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
yayayaya 

how to view profile image with access_token

Hi all, 

 

How can I view my profile image (and any other UI resources) with my access_token ?

 

I only managed to view the image with a sid like:

https://c.na9.content.force.com/profilephoto/729E0000000D1Kg/T?sid=blabla

 

10'x.

Scott_VSScott_VS

Going to need a little more information about your circumstances to give you a better answer.

 

You can find your profile pic from running a SOQL query on the User.FullPhotoUrl using the userID from UserInfo.getUserId().

 

If all you have is a session id, then maybe the Chatter REST API will have a way to get you the picture.

yayayaya

Thanks. I already came up with a solution:

 

The REST API can give you the image stream with an ajax call only if you pass the access_token in the headers.

Then you can convert the stream to base64 and give the result to the image src attribute using 'Data URI schema'.