Making API Requests using IN.API
Mon, 04/04/2011 - 12:37 — LIDeveloperAdmin
IN.API
The IN.API classes are intended to be a thin wrapper over the normal LinkedIn REST APIs. We currently offer the following LinkedIn API Resources directly in the JavaScript API:
-
Profile
Retrieve profile data for a LinkedIn member -
Connections
Retrieve the current user's list of connections -
PeopleSearch
Search LinkedIn's database of over 150 million professionals -
MemberUpdates
Retrieve a chronological view of a single user's updates -
NetworkUpdates
Retrieve updates from across the current user's entire network. This is similar to the timeline view seen on the LinkedIn home page. -
Raw
Perform a raw API query. This is needed when you want to access a resource we don't provide a native JS function. This includes whenever you need a method other than GET: POST, PUT, and DELETE.
Eventually, any resource you can access using our traditional REST interface should be possible directly from client-side JavaScript with a native JS interface (and JSON results). In the meantime, you can use IN.API.Raw().
Methods
Though they return different types of data, all the APIs above support a common interface of the following chained methods:
-
result(resultCallback, resultScope)
Fires the API call. Invokes the function specified as resultCallback (optionally in the scope of resultScope). If resultScope isn't specified, the window scope is used. If called with no arguments, the call will fire but the result will not be available. -
error(errorCallback, errorScope)
Fires the API call. If an error occurs, errorCallback is invoked with a payload describing the error (optionally in the scope of errorScope). If called with no arguments, the call will fire but the result will not be available. -
method(methodType)
Override the method's default action of GET. When an API makes use of the
methodmethod, it will be listed in the standard supported methods.
methodTypeis a string for the HTTP action to take. For example:
GET,
POST,
PUT, or
DELETE. -
body(bodyContent)
Override the method's posted body content. When an API makes use of the
bodymethod, it will be listed in the standard supported methods.
bodyContentis a URL encoded post string. -
params(paramObject)
Some APIs allow parameters to be passed as part of a query string, such as "
count" or "
start". When an API makes use of the
paramsmethod, it will be listed with the standard supported methods.
paramObjectis a set of key/value pairs to transmit with the API call. To pass multiple values for the same parameter name, make your value an array instead of a string. (For example:
"type": ["SHAR", "APPS"].)
Documentation
- Tutorials
- Javascript API Reference
- Overview
- Configuration and Compatibility
- IN.API.Profile()
- Making API Requests using IN.API
- IN.API.Connections()
- IN.API.PeopleSearch()
- IN.API.MemberUpdates() and IN.API.NetworkUpdates()
- IN.API.Raw()
- Tags and Templates
- IN.Auth, IN.Event, and IN.UI
- General Methods
- Exchange JSAPI Tokens for REST API OAuth Tokens
- Plugins
- Publisher Guidelines