Find your content:

Search form

You are here

Accessing chatter user profile picture from sites


I have to access a chatter photo in Sites VF page using partner portal. I know that chatter photo cant be accessed by partner portal users. Is there any work around?

I saw this link which says that we can implement using oauth token.

Here is my photo url :-

How do I obtain the oauth token? I just created a remote access with call back url as :- and these two keys got generated automatically :-

Consumer Key :-


Consumer Secret :-


and here is my sites url (integrated with partner portal):-

Can You please tell me what I need to append in my url and which url (c.cs11.content or my site url?) and what token should i append to see my photo in my site?

Attribution to: Priyanka

Possible Suggestion/Solution #1

Finally I found the solution. Instead of using Oauth, I did the same in a different way.

  1. Created one custom object with a lookup to user.
  2. Created a field to save the 'FullPhotoURL' of that user
  3. Got the image as blob and saved as an attachment to this custom object.

From my sites page, I queried this Custom object and showed the image from the attachment

Attribution to: Priyanka

Possible Suggestion/Solution #2

There is better solution using chatter connect API.

public String getUserPhotoURL(String UserId) {
        ConnectApi.Photo ph =  ConnectApi.ChatterUsers.getPhoto(null, UserId);
        return ph.fullEmailPhotoUrl;

Read more in my blog:

Attribution to: nikitakarpenkov

Possible Suggestion/Solution #3

This will give you how to obtain access token or Oauth token from SFDC .Then you can proceed as sandeep pointed in previous blog.

Also since sandeep mentions even session id can do, you may use userinfo.getSessionId() method .Refer Userinfo class of apex.follow the below link

Adding further here is another post that may help you

Attribution to: Mohith Shrivastava
This content is remixed from stackoverflow or stackexchange. Please visit

My Block Status

My Block Content