Created
May 13, 2011 17:10
-
-
Save jsjohnst/970913 to your computer and use it in GitHub Desktop.
Example of getting recommendations from LinkedIn JSAPI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head><title>Your Recommendations</title></head> | |
<body> | |
<script type="text/javascript" src="http://platform.linkedin.com/in.js"> | |
api_key: <your API key> | |
authorize: true | |
</script> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script> | |
<script type="IN/Login" data-onAuth="authSuccess"></script> | |
<script> | |
function authSuccess() { | |
var recos_element = $("#recos"); | |
IN.API.Raw("/people/~/recommendations-received").result(function(result) { | |
for(var key in result.values) { | |
var reco = result.values[key]; | |
recos_element.append($('<p><i><b>' + reco.recommender.firstName + ' ' + reco.recommender.lastName + '</b> says,</i><br> ' + reco.recommendationText + '</p>')); | |
} | |
}); | |
} | |
</script> | |
<h1>Your Recommendations</h1> | |
<ul id="recos"></ul> | |
</body> | |
</html> |
Thanks for this gist!
I found that it doesn't work unless you add this:
scope: r_fullprofile
between lines 4 and 7...
Hopefully that helps some of the rest of you asking questions about this.
Hi Jeremy,
I have tried this API code but not worked for me,I just want to extract all our website user's linkedin recommendation like you have shown in example & show it to their profile.
Please help me out..
Thanks!!!!!
{
"errorCode": 0,
"message": "Access to recommendations-received denied",
"requestId": "xxxxxxxxxxxxxx",
"status": 403,
"timestamp": xxxxxxxxxxxx
}
I am not able to access the recommendation. Anyone faced this ? any solution
@agnihotriketan, it looks like you need to be a member partner to do this now, or did you have any luck?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi Jeremy,
I have tried to use your solution, and it works well when I use my own credentials. It shows all the recommendations I had recieved.
But when some other user is trying to see my recommendations:
Error: t.recommendationsReceived.values is undefined
I am guessing the error is Because this user does not have any recommendations, and the API is trying to load the recommendation from the logged in users account.
Could you please share the solution you mentioned on https://gist.github.com/970913#gistcomment-31449
, that is to be able to show my own recommendations without anyone to login.
Thanks