Friday, May 25, 2012

User Photo Not Visible On Force.com Site From Rest API In Apex Salesforce


Hi All ,
I was accessing the photourl through force.com site !

"photo": {
        "largePhotoUrl": "https://instance_name/profilephoto/729D00000000BDV/F",
        "photoVersionId": "729D00000000BDV",
        "smallPhotoUrl": "https://instance_name/profilephoto/729D00000000BDV/T"
},

Now if we expose these photo url on visualforce page would render properly but if we try to get the same of public force.com site these photo url does not exist because session does not maintain .Images look like burst and does not show properly.

So what we can do , we can append either oauth_token or sessionid at the last of the photourl as a parameter. 
Let say our photo url is "largePhotoUrl": 

"https://instance_name/profilephoto/729D00000000BDV/F",

so we need to append the oauth_token like :



largePhotoUrl": "https://instance_name/profilephoto/729D00000000BDV/F'?oauth_token=00DV0000004RJpB!ARMAQFwrXxu7t6DAjWcseeWxXTo9UtSh4xZbrWJqHRnCulQ16yKqq97wIWIREdPtKfQ7BcFffyD9Y43MVBfa4hmHaPLfkT6C';
Now you can access the image as public with the help of oauth_token . Thanks





97 comments:

  1. 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:
    http://sforcenotes.blogspot.com/2015/10/solution-to-display-salesforce-user.html

    ReplyDelete
  2. Salesforce is the cloud based tool which is used by most of the professional who do CRM. Salesforce is the cost effective tool.
    salesforce training institute in chennai|salesforce training institutes in chennai|salesforce course in chennai

    ReplyDelete
  3. Nowadays, most of the businesses rely on cloud based CRM tool to power their business process. They want to access the business from anywhere and anytime. In such scenarios, salesforce CRM will ensure massive advantage to the business owners. Salesforce Training | Salesforce Training in Chennai

    ReplyDelete
  4. This blog having the details of Processes running. The way of runing is explained clearly. The content quality is really great. The full document is entirely amazing. Thank you very much for this blog.
    Hadoop Training in Chennai

    ReplyDelete
  5. This is Great and very useful advice with in this post. Thank you.
    mvc training in chennai

    ReplyDelete
  6. Wonderful blog.. Thanks for sharing informative blog.. its very useful to me..

    iOS Training in Chennai

    ReplyDelete
  7. Learned a lot of new things from your post! Good creation and HATS OFF to the creativity of your mind.
    Very interesting and useful about salesforce apex
    Best Salesforce training in Gurgaon



    ReplyDelete
  8. DIAC is offering Salesforce.com Training with on admin, developer, salesforce lightening, crm. Call @ +919310096831 for details on course fees, syllabus, placement facilities, batch timings, course duration.

    ReplyDelete
  9. The information which you have provided is very good. It is very useful who is looking for salesforce Online Training

    ReplyDelete
  10. Great Article… I love to read your articles because your writing style is too good, its is very very helpful for all of us and I never get bored while reading your article because, they are becomes a more and more interesting from the starting lines until the end.

    salesforce crm online training

    ReplyDelete
  11. Thanks for sharing valuable information and it is useful for onlineitguru provides the best salesforce Online course Hyderabad

    ReplyDelete
  12. Its really an Excellent post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog. Thanks for sharing....


    Best Tableau online training in Hyderabad


    Tableau online training in Hyderabad


    Tableau training in Hyderabad

    ReplyDelete
  13. After seeing your article I want to say that the presentation is very good and also a well-written article with some very good information which is very useful for the readers....thanks for sharing it and do share more posts like this.

    MEAN stack training in Chennai
    MEAN stack training in bangalore
    MEAN stack training in tambaram
    MEAN stack training in annanagar

    ReplyDelete
  14. I read this post two times, I like it so much, please try to keep posting & Let me introduce other material that may be good for our community.
    python interview questions and answers
    python tutorials
    python course institute in electronic city

    ReplyDelete
  15. Needed to compose you a very little word to thank you yet again regarding the nice suggestions you’ve contributed here.
    Best Devops training in sholinganallur
    Devops training in velachery
    Devops training in annanagar
    Devops training in tambaram

    ReplyDelete
  16. Whoa! I’m enjoying the template/theme of this website. It’s simple, yet effective. A lot of times it’s very hard to get that “perfect balance” between superb usability and visual appeal. I must say you’ve done a very good job with this.
    Best Selenium Training in Chennai | Selenium Training Institute in Chennai | Besant Technologies
    Selenium Training in Bangalore | Best Selenium Training in Bangalore

    ReplyDelete
  17. I found this informative and interesting blog so i think so its very useful and knowledge able.I would like to thank you for the efforts you have made in writing this article.
    angularjs Training in bangalore

    angularjs Training in bangalore

    angularjs interview questions and answers

    angularjs Training in marathahalli

    angularjs interview questions and answers

    angularjs-Training in pune

    ReplyDelete
  18. Its really an Excellent post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog. Thanks for sharing....
    Best Devops Training in pune
    Devops interview questions and answers

    ReplyDelete
  19. This is most informative and also this post most user friendly and super navigation to all posts... Thank you so much for giving this information to me.. 
    python course in pune
    python course in chennai
    python Training in Bangalore

    ReplyDelete
  20. Great Article… I love to read your articles because your writing style is too good, its is very very helpful for all of us and I never get bored while reading your article because, they are becomes a more and more interesting from the starting lines until the end.

    rpa training in chennai |best rpa training in chennai|
    rpa training in bangalore | best rpa training in bangalore

    ReplyDelete
  21. Very nice post here and thanks for it .I always like and such a super contents of these post.
    Excellent and very cool idea and great content of different kinds of the valuable information's.
    Java training in Chennai
    Java training in Bangalore
    Java online training
    Java training in Pune

    ReplyDelete
  22. After reading this web site I am very satisfied simply because this site is providing comprehensive knowledge for you to audience.
    Thank you to the perform as well as discuss anything incredibly important in my opinion. We loose time waiting for your next article writing in addition to I beg one to get back to pay a visit to our website in



    selenium training in Bangalore
    selenium training in Marathahalli
    selenium training in Btm layout
    selenium training in Jaya nagar
    selenium training in Electronic city
    selenium training in Kalyan nagar



    ReplyDelete
  23. Your good knowledge and kindness in playing with all the pieces were very useful. I don’t know what I would have done if I had not encountered such a step like this.
    microsoft azure training in bangalore
    rpa training in bangalore
    best rpa training in bangalore
    rpa online training

    ReplyDelete
  24. nice course. thanks for sharing this post this post harried me a lot.
    Summer Training in Noida

    ReplyDelete
  25. Good Post. I like your blog. Thanks for Sharing
    Salesforce Course in Delhi

    ReplyDelete
  26. Thank You For Sharing
    Yaaron Studios is one of the rapidly growing editing studios in Hyderabad. We are the best Video Editing services in Hyderabad. We provides best graphic works like logo reveals, corporate presentation Etc. And also we gives the best Outdoor/Indoor shoots and Ad Making services.
    video editors studio in hyderabad
    short film editors in hyderabad
    corporate video editing studio in hyderabad
    ad making company in hyderabad

    ReplyDelete
  27. Your articles really impressed for me,because of all information so nice.informatica training in bangalore

    ReplyDelete
  28. These provided information was really so nice,thanks for giving that post and the more skills to develop after refer that post.dotnet training in bangalore

    ReplyDelete
  29. Very useful and information content has been shared out here, Thanks for sharing it.Microsoft azure training in bangalore

    ReplyDelete
  30. This is really an awesome post, thanks for it. Keep adding more information to this.tableau training in bangalore

    ReplyDelete
  31. Excellent information with unique content and it is very useful to know about the information.angular 7 training in bangalore

    ReplyDelete
  32. This Information which you provided is very much useful for Agile Training Learners. Thank You for Sharing Valuable Information.sap s4 hana simple finance training in bangalore

    ReplyDelete
  33. Awesome post with lots of data and I have bookmarked this page for my reference. Share more ideas frequently.javascript training in bangalore

    ReplyDelete
  34. Awesome post with lots of data and I have bookmarked this page for my reference. Share more ideas frequently.sap hr training in bangalore

    ReplyDelete
  35. Wow it is really wonderful and awesome thus it is veWow, it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot.html training in bangalore

    ReplyDelete
  36. Great post!I am actually getting ready to across this information,i am very happy to this commands.Also great blog here with all of the valuable information you have.Well done,its a great knowledge. Amazon web services Training in Bangalore

    ReplyDelete
  37. Thanks for one marvelous posting! I enjoyed reading it; you are a great author. I will make sure to bookmark your blog and may come back someday. I want to encourage that you continue your great posts.devops training

    ReplyDelete
  38. Thank you for your post. This is excellent information. It is amazing and wonderful to visit your site. sap s4 hana training in bangalore

    ReplyDelete
  39. Thanks for sharing this blog. This very important and informative blog. Python Training in Bangalore

    ReplyDelete
  40. keep up the good work. this is an Assam post. this to helpful, i have reading here all post. i am impressed. thank you. this is our digital marketing training center. This is an online certificate course
    digital marketing training in bangalore / https://www.excelr.com/digital-marketing-training-in-bangalore

    ReplyDelete
  41. Thanks for sharing such an useful and informative stuff...

    Salesforce Developer Training

    ReplyDelete
  42. Thanks for Sharing This Article.It is very so much valuable content. I hope these Commenting lists will help to my website
    microservices online training
    best microservices online training
    top microservices online training

    ReplyDelete
  43. Really it was an awesome article about JAVA, very interesting to read.You have provided an nice article,Thanks for sharing.
    Java training in chennai | Java training in annanagar | Java training in omr | Java training in porur | Java training in tambaram | Java training in velachery

    ReplyDelete
  44. Resources like the one you mentioned here will be very useful to me ! I will post a link to this page on my blog. I am sure my visitors will find that very useful
    AWS training in chennai | AWS training in annanagar | AWS training in omr | AWS training in porur | AWS training in tambaram | AWS training in velachery


    ReplyDelete
  45. Great Article
    Cloud Computing Projects


    Networking Projects

    Final Year Projects for CSE


    JavaScript Training in Chennai

    JavaScript Training in Chennai

    The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training

    ReplyDelete
  46. Thanks for sharing an informative blog keep rocking bring more details.I like the helpful info you provide in your articles. I’ll bookmark your weblog and check again here regularly. I am quite sure I will learn much new stuff right here! Good luck for the next!
    Artificial Intelligence Training in Chennai

    Ai Training in Chennai

    Artificial Intelligence training in Bangalore

    Ai Training in Bangalore

    Artificial Intelligence Training in Hyderabad | Certification | ai training in hyderabad

    Artificial Intelligence Online Training

    Ai Online Training

    Blue Prism Training in Chennai

    ReplyDelete
  47. Thanks for sharing an informative blog keep rocking bring more details.I like the helpful info you provide in your articles. I’ll bookmark your weblog and check again here regularly. I am quite sure I will learn much new stuff right here! Good luck for the next
    python training in bangalore

    python training in hyderabad

    python online training

    python training

    python flask training

    python flask online training

    python training in coimbatore
    python training in chennai

    python course in chennai

    python online training in chennai


    ReplyDelete
  48. I am really searching for this kind of information, as well as I came to know many things. so please update the latest information, it may be useful for me like beginners.

    Full Stack Course in Bangalore

    Full Stack Training in Hyderabad

    Full Stack Course in Hyderabad

    Full Stack Training

    Full Stack Course

    Full Stack Online Training

    Full Stack Online Course


    ReplyDelete
  49. Very nice post here and thanks for it .I always like and such a super contents of these post.
    Excellent and very cool idea and great content of different kinds of the valuable information.
    Salesforce Training in Chennai

    Salesforce Online Training in Chennai

    Salesforce Training in Bangalore

    Salesforce Training in Hyderabad

    Salesforce training in ameerpet

    Salesforce Training in Pune

    Salesforce Online Training

    Salesforce Training


    ReplyDelete
  50. This article is well formulated. I particularly like the way how you have delivered all the major points about the topic of the content in petite and crisp points. Data Science training in Mumbai
    Data Science course in Mumbai
    SAP training in Mumbai


    ReplyDelete
  51. Nice & Informative Blog !
    you may encounter various issues in QuickBooks that can create an unwanted interruption in your work. To alter such problems, call us at Quickbooks Error Support Phone Number 1-855-977-7463 and get immediate technical services for QuickBooks in less time.

    ReplyDelete
  52. Usually I never comment on blogs but your article is so convincing that I never stop myself to say something about it. You’re doing a great job Man learn
    Pega Online Training
    Pega Online Course

    ReplyDelete
  53. I think this the best blog with the most important information filled in this website
    I Got the more and more ideas from this blog Thank You for letting us to know.
    pythonTraining in chennai

    python Course in chennai

    ReplyDelete
  54. wonderful article contains lot of valuable information. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article.
    This article resolved my all queries.good luck an best wishes to the team members.continue posting.learn digital marketing use these following link
    Digital Marketing Course in Chennai

    ReplyDelete
  55. Nice & Informative Blog !
    Are you looking for the best ways to solve QuickBooks Error 429,Our team will quickly assist you with the best solutions to solve QuickBooks Error.

    ReplyDelete
  56. I'm very much inspired when I've visited your blog. Your blog is really informative. Hope you will continue with new article.
    aws training in chennai
    aws course in chennai

    ReplyDelete
  57. Hey! Fabulous post. It is the best thing that I have read on the internet today. Moreover, if you need instant support for QuickBooks Error, visit at QuickBooks Customer Service Phone Number Our team is always ready to help and support their clients.

    ReplyDelete
  58. This post is so interactive and informative.keep update more information...
    RPA Training in Tambaram
    RPA Training in Chennai

    ReplyDelete