How to get Contact PhotoUrl in Salesforce? - salesforce

In Salesforce I have created a few Contacts. And linked some of the contacts with LinkedIn profile. As soon as I link the contacts, the image display in Salesforce changes the profile image to that provided by LinkedIn. Basically I think it would work the same way if I linked it to Facebook or other social sites.
Now my requirement is to get the the PhotoUrl of the Contact. I went through this documentation Contacts Standard Object. It shows there is a field "PhotoUrl", but when I make a query in SOQL using SOAP API, like "Select Name, PhotoUrl From Contact", this query fails and the response message tells that there is no such field as "PhotoUrl".
What am I missing? Is there any way I cant get the Photo?
Thanks
SOLUTION:
THE PROBLEM WAS WITH THE API VERSION 29. I HAD TO CHANGE IT TO 30. HOWEVER IT WAS TRICKY WITH SOAP API. I HAD TO CHANGE THE AUTHENTICATION ENDPOINT VERSION TO 30.

Change the version of salesforce API. It works for me in 30.0 and not in 29.0..

If it is in a visualforce page, set your standard controller to Contact and then {!contact.PhotoUrl} will return the url.

Related

server side account check - is user registered (backand.com)

i currently stuck on building an account check like whatsapp.
When a user clicks on his smartphone on his/her contacts, it should display, which user has an existing account.
So in theory it should post all user contacts to server, server checks if there is an account with this email adresse and sends the "updated list" back to the client.
Sounds easy, but how do i do something like that :)
Getting the contacts is working, also posting contacts to server.
I had my backend on backand.com and building an app with Ionic/Angular.
This should be very simple.
The core functionality here is based on Backand built in 'users' object, it holds all users you've added to your app, a simple GET to this object will return all your users details including emails.
Now you can add a serverside js action that
gets the contacts details from the client-side app in the request body (as JSON)
does an $http call to the users object ro fetch exiting users.
loops the contacts and search for them in the users array

open SalesForce Lead Url from website

I have a external website. When the User clicks on a button from external website it should open an new window showing salesforce lead detail from Salesforce website. How can I do it?
I should be able to pass the LeadId as argument to the salesforce url.
If you want generate URL to lead page (for example, like this "https://cs11.salesforce.com/00QJ000000B5Npj"), you need to know two things:
Salesforce Lead ID
Salesforce Base URL to your instance (like "https://xxxx.salesforce.com")
Both things you can get from Salesforce API. Possible your website store Leads ID, so you can add configurable parameter for Base URL, which admins should to populate, and you will be able generate Leads URL without using of Salesforce API.

Facebook Taggable Friends

I am trying to get all the friends of the user currently signed in. I tried /me/friends but that didn't work as it returns only the users using my app already. I then tried https://graph.facebook.com/me/taggable_friends?access_token=somecodehere
In the browser it says
"To use taggable_friends on behalf of people who are not admins,
developers and testers of your app, your use of this endpoint must be
reviewed and approved by Facebook. To submit this feature for review
please read our documentation on reviewable features:
https://developers.facebook.com/docs/apps/review"
But when I do a GET (using Angular.js) on this URL with a valid access token using my application, it returns me a list of my friends, with their id, name, picture. Why is this happening? How can my app get the data if my browser cannot?
Also, the picture currently returned is too small. How can I get the email and larger picture of all my friends in this response?
Any help is highly appreciated.
PS: I am building a cordova app and getting access_token via CordovaOAuth.
taggable_friends works for you because it works without review for everyone with a role in the App (Admin/Developer/Tester). You only need to go through the review process if you want to go public with your App.
That beind said, taggable_friends is for tagging only, a larger picture is not neccessary for that and you definitely canĀ“t get their email. What would you do with the email of friends who did not even authorized your App? You would not be allowed to use those emails anyway. You can ONLY get the email of a Facebook user by authorizing that user with the email permission.
More information about getting access to friends: Facebook Graph Api v2.0+ - /me/friends returns empty, or only friends who also use my app

Lack of security for force.com sites?

I am exposing a page with a standardcontroller="account" to a force.com site facing the public. This page displays account specific data to the clients. Now when a customer logs in to my website I want him to have access to his account's data and only his account data. Here is the problem; the url for a page with a standardcontroller has a Id field, such as "https//www.myforcesite.force.com/AccountViewPage?Id=a82347dod". If a user changes a few keys on the Id, it is very easy for him to access other people's account page and bypass the login process. How can I prevent that.
I opened a ticket with salesforce but they told me its working as intended. I don't think a vulnerability to a trivial brute force attack should be intended so I want to know if there are any fixes?
Create one StandardController extension and check if the logged user in your website has the permission to view that account.
http://www.salesforce.com/us/developer/docs/pages/Content/apex_pages_standardcontroller.htm
What you are looking for is URL rewriting for force.com site.
For example, let's say that you have a blog site. Without URL rewriting, a blog entry's URL might look like this: http://myblog.force.com/posts?id=003D000000Q0PcN
With URL rewriting, your users can access blog posts by date and
title, say, instead of by record ID. The URL for one of your New
Year's Eve posts might be:
http://myblog.force.com/posts/2009/12/31/auld-lang-syne

Get user name and basic detail without using facebook graph api

I am working on a website, I have one problem ..
I have facebook users id in my database, now I want to get their names using their ids but without using graph api..
Is there any way to do so..
I assume you want to do this programaticaly... Short answer is - you can't.
If you want to do it manually you can simply navigate to this url: https://facebook.com/profile.php?id={USERS_ID}It will give you the users profile page where you can see their name IF their profile is publicly available.
Essentially you should request the users names and store them in your database when the users authenticate your application.

Resources