Search Linked In People In your web application using linked in Javascript API

Search Linked In People In your web application using linked in Javascript API

Step 1

Go to this below URL 

Step 2
Add your apps for generate API key .See Figure 1
Figure 1



Step 3

Fill up all required information as per your requirement .See Figure 2
Figure 2

Then click on Add Application Button for generate API Key .See Figure 3
Figure 3
Step 4

Copy the Below Code and paste in your application page .


<script type="text/javascript" src="http://platform.linkedin.com/in.js">
  api_key: YOUR_API_KEY

</script>


<script type="text/javascript">
function searchClick() {
  if (!IN.ENV.auth.oauth_token) {
    alert("You must login w/ LinkedIn to use the Search functionality!");
    return;
  }

  IN.API.PeopleSearch()
    .fields("id", "firstName", "lastName")
    .params({
      "first-name": document.searchform.firstName.value,
      "last-name": document.searchform.lastName.value,
      "company": document.searchform.company.value
    })
    .result(function(result, metadata) {
      setSearchResults(result, metadata);
    });
}

function setSearchResults(result, metadata) {
  searchHTML = "Search Results (" + result.numResults + "):<ul>";
  console.log(result.people.values);
  for (i in result.people.values) {
    searchHTML = searchHTML + "<li>";
    searchHTML = searchHTML + result.people.values[i].firstName + " ";
    searchHTML = searchHTML + result.people.values[i].lastName + " ";
    searchHTML = searchHTML + " (memberToken: " + result.people.values[i].id + ")</li>";
  }
  searchHTML = searchHTML + "</ul>";
  
  document.getElementById("searchresults").innerHTML = searchHTML;
}
</script>

<!-- need to be logged in to use Search; if not, offer a login button -->
<script type="IN/Login"></script>
<p>Basic test of the People Search API via Connect. <br />
You must click the button (pressing Enter doesn't work).</p>
<form name="searchform" onsubmit="return false;">
  First Name:&nbsp;<input type="text" name="firstName"><br/>
  Last Name:&nbsp;<input type="text" name="lastName"><br/>
  Company:&nbsp;<input type="text" name="company"><br/>
  <input type="button" name="search1" value="Search LinkedIn!" onclick="searchClick()">
</form>
<div id="searchresults"></div>


Step 5

Copy the API Key and Paste in code where it required .

Step 6

Run your application and enjoy it.....


Note :Project should run in your website url which url you have given in Application add time.

If you have any problem please ask me through the comment .



Comments

Popular posts from this blog

Convert HtmlToPDF in ASP.net & iTextshrap

Create Pivot Table In C#

How to Display Page Wise Total Amount & Grand Total Amount in Last page SSRS & RDLC Report