Presentation for the Silicon Valley Code Camp on October 9, 2011.
Walks through tutorial on how to create a search application using LinkedIn's Javascript API, and explains a more complicated faceted application made using this API.
2. LinkedIn Platform
• Leading platform for building the professional
web
• Professional profile of record
• Committed to building a healthy developer
ecosystem
http://developer.linkedin.com
4. What are we building?
http://developer.linkedin.com
5. How will we get there?
• Get an API key
• Basic setup
• Build a basic search
• Build a faceted search
• Hand wave through UI stuff
http://developer.linkedin.com
22. Search Facets
• Request facets
for a member’s
network
• Use facets to
hone search
requests
http://developer.linkedin.com
23. Is there a Javascript
Convenience Method for
this?
http://developer.linkedin.com
24. Is there a Javascript
Convenience Method for
this?
http://developer.linkedin.com
25. Kick it up
a Notch!
http://developer.linkedin.com
26. Raw REST Calls
• Reach through to our powerful REST
API
• Leverage authentication
• Deep integration
• IN.API.Raw(REST_Url)
http://developer.linkedin.com
27. REST People Search
Javascript version
IN.API.PeopleSearch()
.fields("firstName", "lastName", "pictureUrl")
.params({"keywords": "princess", "count": 10, "sort": "distance"})
.result(function(result) {
alert(JSON.stringify(result));
});
REST version
http://api.linkedin.com/v1/people‐search:(people:(first‐name,last‐
name,picture‐url))?keywords=princess&count=10&sort=distance
http://developer.linkedin.com
28. Get the Facets for the
Member’s Network
http://api.linkedin.com/v1/people‐search?facets=school
{
"facets": {
"_total": 1,
"values": [{
"buckets": {
"_total": 11,
"values": [
{
"code": "17939",
"count": 4196,
"name": "University of California, Berkeley",
"selected": false
},
...
]
},
"code": "school",
"name": "School"
}]
},
http://developer.linkedin.com
30. Field Selectors
• Default values for profiles can change
• Use explicit fields
• “Reach inside” to get more details
about requested items
http://developer.linkedin.com
31. Building the
Search Request
Profile Information
people:(
first‐name,
last‐name,
picture‐url
)
Parameters
facet=school,17939
count=1
Request
http://api.linkedin.com/v1/people‐search:(people:(first‐name,last‐
name,picture‐url))?facet=school,17939&count=1
http://developer.linkedin.com
* LinkedIn APIs, REST, Javascript, Plugins\n* Love love love the developers\n* Powerful REST APIs with libraries in most programming languages\n* Focusing on the Javascript API for this example\n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
Javascript API\n* Fast and easy to get started\n* Handles the authentication for you \n* Just a few lines in your web page to get started\n* Lots of tutorials on our developer portal\n\n* 3 easy steps - cover quickly, then break out\n* Load the framework\n** The only variable here is your API key\n** Get an API key quickly from the developer portal\n** ... where there's also great tutorials and documentation\n* Add a login button\n** Need to give the user a way to authenticate with LinkedIn so your application can access the system\n** This tag allows you to decide where on your page to place the button\n** When the user clicks on the link, they will go through the standard LinkedIn authentication flow and the framework will be updated with the user's tokens and be ready to access the system\n* Make API Calls\nWe'll use PeopleSearch as an example. As you can see the framework is called using IN.API.function(), in this example PeopleSearch. Our framework uses the method chaining which is common in Javascript frameworks, and in this case we're using methods to tell the search what keywords we're looking for and what to do with the result.\n\n