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
orangemanorangeman 

Chatter web services API to get the smallphotourl

Folks,

 

I am using Chatter web services API to get the smallphotourl from the user table. But how can I actually download this photo? I want to use this photo in an ASP.net website. If I try a httpwebrequest to this smallphotourl, I get a html with JavaScript back, not the actual image! Can anyone help?

 

cfahertycfaherty
You have to load up a sid= cookie for the .salesforce.com domain, into the cookie jar you use for the photo request. Currently the only sessionid which is compatible is the one from login(). An OAuth access_token cannot be used.
cloudcodercloudcoder

You can use the access_token (<User.SmallPhotoURL>?oauth_token=<OAuth Token>) for an oauth flow. 

 

We had a discussion about this internally as well to determine the best practice strategy going forward. I will update this thread when there is a consensus. 

 

HTH