Skip to content

Instantly share code, notes, and snippets.

@jsjohnst
Created May 13, 2011 17:10
Show Gist options
  • Save jsjohnst/970913 to your computer and use it in GitHub Desktop.
Save jsjohnst/970913 to your computer and use it in GitHub Desktop.
Example of getting recommendations from LinkedIn JSAPI
<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>&nbsp;&nbsp;&nbsp;' + reco.recommendationText + '</p>'));
}
});
}
</script>
<h1>Your Recommendations</h1>
<ul id="recos"></ul>
</body>
</html>
@jahdakine
Copy link

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.

@ankitjaiswal25
Copy link

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!!!!!

@agnihotriketan
Copy link

{
"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

@thecherrytree
Copy link

@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