public class

LinkedInConnector

extends Object
java.lang.Object
   ↳ org.mule.module.linkedin.LinkedInConnector
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

LinkedIn is a business-related social networking site. Founded in December 2002 and launched in May 2003, it is mainly used for professional networking. This connector allows you to interact with LinkedIn API.

Summary

Fields
private String accessToken
private String accessTokenSecret
private String apiKey API Key
private String apiSecret API Secret
private LinkedInApiClient client
private String scope LinkedIn permissions
Public Constructors
LinkedInConnector()
Public Methods
String getAccessToken()
String getAccessTokenSecret()
String getApiKey()
String getApiSecret()
Connections getConnectionsById(String id, List<ProfileField> profileFields, Integer start, Integer count, Date modificationDate, ConnectionModificationType modificationType)
Gets the connections by id.
Connections getConnectionsByUrl(String url, List<ProfileField> profileFields, Integer start, Integer count, Date modificationDate, ConnectionModificationType modificationType)
Gets the connections by url.
Connections getConnectionsForCurrentUser(List<ProfileField> profileFields, Integer start, Integer count, Date modificationDate, ConnectionModificationType modificationType)
Gets the connections for current user.
UpdateComments getNetworkUpdateComments(String networkUpdateId)
Gets the network update comments.
Likes getNetworkUpdateLikes(String networkUpdateId)
Gets the network update likes.
Network getNetworkUpdates(List<NetworkUpdateType> updateTypes, Integer start, Integer count, Date startDate, Date endDate, Boolean showHiddenMembers)
Gets the network updates.
Person getProfileById(String id, List<ProfileField> profileFields)
Gets the profile by id.
Person getProfileByUrl(String url, ProfileType profileType, List<ProfileField> profileFields)
Gets the profile by url.
Person getProfileForCurrentUser(List<ProfileField> profileFields)
Gets the profile for current user.
String getScope()
Network getUserUpdates(List<NetworkUpdateType> updateTypes, Integer start, Integer count, Date startDate, Date endDate)
Gets the network updates.
Network getUserUpdatesById(String id, List<NetworkUpdateType> updateTypes, Integer start, Integer count, Date startDate, Date endDate)
Gets the network updates.
void likePost(String networkUpdateId)
Like post.
void postComment(String networkUpdateId, String commentText)
Post comment.
void postNetworkUpdate(String updateText)
Post network update.
void postShare(String commentText, String title, String url, String imageUrl, LinkedInVisibilityType visibility, Boolean postToTwitter)
Post share.
void reShare(String shareId, String commentText, LinkedInVisibilityType visibility)
Re-share.
People searchPeople(Map<SearchParameter, String> searchParameters, List<ProfileField> profileFields, Integer start, Integer count, SearchSortOrder sortOrder)
Search people.
PeopleSearch searchPeopleWithFacetFields(Map<SearchParameter, String> searchParameters, List<ProfileField> profileFields, List<FacetField> facetFields, Integer start, Integer count, SearchSortOrder sortOrder, Map<FacetType, String> facets)
Search people.
People searchPeopleWithFacets(Map<SearchParameter, String> searchParameters, List<ProfileField> profileFields, Integer start, Integer count, SearchSortOrder sortOrder, Map<FacetType, String> facets)
Search people.
void sendInviteByEmail(String email, String firstName, String lastName, String subject, String message)
Send invite.
void sendMessage(List<String> recepientIds, String subject, String message)
Send message.
void setAccessToken(String accessToken)
void setAccessTokenSecret(String accessTockenSecret)
void setApiKey(String apiKey)
void setApiSecret(String apiSecret)
void setScope(String scope)
void unlikePost(String networkUpdateId)
Unlike post.
void updateCurrentStatus(String status, Boolean postToTwitter)
Update current status.
[Expand]
Inherited Methods
From class java.lang.Object

Fields

private String accessToken

private String accessTokenSecret

private String apiKey

API Key

private String apiSecret

API Secret

private LinkedInApiClient client

private String scope

LinkedIn permissions

Public Constructors

public LinkedInConnector ()

Public Methods

public String getAccessToken ()

public String getAccessTokenSecret ()

public String getApiKey ()

public String getApiSecret ()

public Connections getConnectionsById (String id, List<ProfileField> profileFields, Integer start, Integer count, Date modificationDate, ConnectionModificationType modificationType)

Gets the connections by id. For details see http://developer.linkedin.com/docs/DOC-1004

Java Sample
String accessToken = ...
String accessTokenSecret = ...
String id = ...
List<ProfileField> profileFields = ...
Integer start = ...
Integer count = ...
Date modificationDate = ...
ConnectionModificationType modificationType = ...
LinkedInConnector linkedin = new LinkedInConnector();
Object response = linkedin.getConnectionsById(accessToken, accessTokenSecret, id, profileFields, start, count, modificationDate, modificationType);

Parameters
id The id to search
profileFields The profile fields to retrieve
start The start, if set count needs to be specified
count The count, if set start needs to be specified
modificationDate The modification date, if set modification type needs to be specified
modificationType The modification type, if set modification date needs to be specified
Returns
  • the connections by id

public Connections getConnectionsByUrl (String url, List<ProfileField> profileFields, Integer start, Integer count, Date modificationDate, ConnectionModificationType modificationType)

Gets the connections by url. For details see http://developer.linkedin.com/docs/DOC-1004

Java Sample
String accessToken = ...
String accessTokenSecret = ...
String url = ...
List<ProfileField> profileFields = ...
Integer start = ...
Integer count = ...
Date modificationDate = ...
ConnectionModificationType modificationType = ...
LinkedInConnector linkedin = new LinkedInConnector();
Object response = linkedin.getConnectionsByUrl(accessToken, accessTokenSecret, url, profileFields, start, count, modificationDate, modificationType);

Parameters
url The url to search
profileFields The profile fields to retrieve
start The start, if set count needs to be specified
count The count, if set start needs to be specified
modificationDate The modification date, if set modification type needs to be specified
modificationType The modification type, if set modification date needs to be specified
Returns
  • the connections by url

public Connections getConnectionsForCurrentUser (List<ProfileField> profileFields, Integer start, Integer count, Date modificationDate, ConnectionModificationType modificationType)

Gets the connections for current user. For details see http://developer.linkedin.com/docs/DOC-1004

Java Sample
String accessToken = ...
String accessTokenSecret = ...
List<ProfileField> profileFields = ...
Integer start = ...
Integer count = ...
Date modificationDate = ...
ConnectionModificationType modificationType = ...
LinkedInConnector linkedin = new LinkedInConnector();
Object response = linkedin.getConnectionsForCurrentUser(accessToken, accessTokenSecret, profileFields, start, count, modificationDate, modificationType);

Parameters
profileFields The profile fields to retrieve
start The start, if set count needs to be specified
count The count, if set start needs to be specified
modificationDate The modification date, if set modification type needs to be specified
modificationType The modification type, if set modification date needs to be specified
Returns
  • the connections for current user

public UpdateComments getNetworkUpdateComments (String networkUpdateId)

Gets the network update comments. For details see http://developer.linkedin.com/docs/DOC-1043

Java Sample
String accessToken = ...
String accessTokenSecret = ...
String networkUpdateId = ...
LinkedInConnector linkedin = new LinkedInConnector();
Object response = linkedin.getNetworkUpdateComments(accessToken, accessTokenSecret, networkUpdateId);

Parameters
networkUpdateId The network update id to search
Returns
  • the network update comments

public Likes getNetworkUpdateLikes (String networkUpdateId)

Gets the network update likes. For details see http://developer.linkedin.com/docs/DOC-1043

Java Sample
String accessToken = ...
String accessTokenSecret = ...
String networkUpdateId = ...
LinkedInConnector linkedin = new LinkedInConnector();
Object response = linkedin.getNetworkUpdateLikes(accessToken, accessTokenSecret, networkUpdateId);

Parameters
networkUpdateId The network update id to search
Returns
  • the network update likes

public Network getNetworkUpdates (List<NetworkUpdateType> updateTypes, Integer start, Integer count, Date startDate, Date endDate, Boolean showHiddenMembers)

Gets the network updates. For details see http://developer.linkedin.com/docs/DOC-1006

Java Sample
String accessToken = ...
String accessTokenSecret = ..
List<NetworkUpdateType> updateTypes = ...
Integer start = ...
Integer count = ...
Date startDate = ...
Date endDate = ...
Boolean showHiddenMembers
LinkedInConnector linkedin = new LinkedInConnector();
Object response = linkedin.getNetworkUpdates(accessToken, accessTokenSecret, updateTypes, start, count, startDate, endDate, showHiddenMembers);

Parameters
updateTypes The update types to retrieve
start The start, if set count needs to be specified
count The count, if set start needs to be specified
startDate The start date, if set end date needs to be specified
endDate The end date, if set start date needs to be specified
showHiddenMembers Whether to show hidden memberts
Returns
  • the network updates

public Person getProfileById (String id, List<ProfileField> profileFields)

Gets the profile by id. For details see http://developer.linkedin.com/docs/DOC-1002

Java Sample
String accessToken = ...
String accessTokenSecret = ..
String id = ...
List<ProfileField> profileFields = ...
LinkedInConnector linkedin = new LinkedInConnector();
Person response = linkedin.getProfileById(accessToken, accessTokenSecret, id, profileFields);

Parameters
id The id to search
profileFields The profile fields to retrieve
Returns
  • the profile by id

public Person getProfileByUrl (String url, ProfileType profileType, List<ProfileField> profileFields)

Gets the profile by url. For details see http://developer.linkedin.com/docs/DOC-1002

Java Sample
String accessToken = ...
String accessTokenSecret = ..
String url = ...
ProfileType profileType = ...
List<ProfileField> profileFields = ...
LinkedInConnector linkedin = new LinkedInConnector();
Person response = linkedin.getProfileByUrl(accessToken, accessTokenSecret, url, profileType, profileFields);

Parameters
url The url to search
profileType The profile type to search
profileFields The profile fields to retrieve
Returns
  • the profile by url

public Person getProfileForCurrentUser (List<ProfileField> profileFields)

Gets the profile for current user. For details see http://developer.linkedin.com/docs/DOC-1002

Java Sample
String accessToken = ...
String accessTokenSecret = ...
List<ProfileField> profileFields = ...
LinkedInConnector linkedin = new LinkedInConnector();
Person response = linkedin.getProfileForCurrentUser(accessToken, accessTokenSecret, profileFields);

Parameters
profileFields The profile fields to retrieve
Returns
  • the profile for current user

public String getScope ()

public Network getUserUpdates (List<NetworkUpdateType> updateTypes, Integer start, Integer count, Date startDate, Date endDate)

Gets the network updates. For details see http://developer.linkedin.com/docs/DOC-1006

Java Sample
String accessToken = ...
String accessTokenSecret = ...
List<NetworkUpdateType> updateTypes = ...
Integer start = ...
Integer count = ...
Date startDate = ...
Date endDate = ...
LinkedInConnector linkedin = new LinkedInConnector();
Object response = linkedin.getUserUpdates(accessToken, accessTokenSecret, updateTypes, start, count, startDate, endDate);

Parameters
updateTypes The update types to retrieve
start The start, if set count needs to be specified
count The count, if set start needs to be specified
startDate The start date, if set end date needs to be specified
endDate The end date, if set start date needs to be specified
Returns
  • the network updates

public Network getUserUpdatesById (String id, List<NetworkUpdateType> updateTypes, Integer start, Integer count, Date startDate, Date endDate)

Gets the network updates. For details see http://developer.linkedin.com/docs/DOC-1006

Java Sample
String accessToken = ...
String accessTokenSecret = ...
String id = ...
List<NetworkUpdateType> updateTypes = ...
Integer start = ...
Integer count = ...
Date startDate = ...
Date endDate = ...
LinkedInConnector linkedin = new LinkedInConnector();
Object response = linkedin.getUserUpdatesById(accessToken, accessTokenSecret, id, updateTypes, start, count, startDate, endDate);

Parameters
id The id to search
updateTypes The update types to retrieve
start The start, if set count needs to be specified
count The count, if set start needs to be specified
startDate The start date, if set end date needs to be specified
endDate The end date, if set end date needs to be specified
Returns
  • the network updates

public void likePost (String networkUpdateId)

Like post. For details see http://developer.linkedin.com/docs/DOC-1043

Java Sample
String accessToken = ...
String accessTokenSecret = ...
String networkUpdateId = ...
LinkedInConnector linkedin = new LinkedInConnector();
Object response = linkedin.likePost(accessToken, accessTokenSecret, networkUpdateId);

Parameters
networkUpdateId The network update id

public void postComment (String networkUpdateId, String commentText)

Post comment. For details see http://developer.linkedin.com/docs/DOC-1043

Java Sample
String accessToken = ...
String accessTokenSecret = ...
String networkUpdateId = ...
String commentText = ...
LinkedInConnector linkedin = new LinkedInConnector();
Object response = linkedin.postComment(accessToken, accessTokenSecret, networkUpdateId, commentText);

Parameters
networkUpdateId The network update id
commentText The comment text

public void postNetworkUpdate (String updateText)

Post network update. For details see http://developer.linkedin.com/docs/DOC-1009

Java Sample
String accessToken = ...
String accessTokenSecret = ...
String updateText = ...
LinkedInConnector linkedin = new LinkedInConnector();
Object response = linkedin.postNetworkUpdate(accessToken, accessTokenSecret, updateText);

Parameters
updateText The update text

public void postShare (String commentText, String title, String url, String imageUrl, LinkedInVisibilityType visibility, Boolean postToTwitter)

Post share. For details see http://developer.linkedin.com/docs/DOC-1212

Java Sample
String accessToken = ...
String accessTokenSecret = ...
String commentText = ...
String title = ...
String url = ...,
String imageUrl = ...
VisibilityType visibility = ...
Boolean postToTwitter = ...
LinkedInConnector linkedin = new LinkedInConnector();
Object response = linkedin.postShare(accessToken, accessTokenSecret, commentText, title, url, imageUrl, visibility, postToTwitter);

Parameters
commentText The comment text
title The title
url The url
imageUrl The image url
visibility The visibility
postToTwitter Whether to post to twitter

public void reShare (String shareId, String commentText, LinkedInVisibilityType visibility)

Re-share. For details see http://developer.linkedin.com/docs/DOC-1212

Java Sample
String accessToken = ...
String accessTokenSecret = ...
String shareId = ...
String commentText = ...
VisibilityType visibility = ...
LinkedInConnector linkedin = new LinkedInConnector();
Object response = linkedin.reShare(accessToken, accessTokenSecret, shareId, commentText, visibility);

Parameters
shareId The share id
commentText The comment text
visibility The visibility

public People searchPeople (Map<SearchParameter, String> searchParameters, List<ProfileField> profileFields, Integer start, Integer count, SearchSortOrder sortOrder)

Search people. For details see http://developer.linkedin.com/docs/DOC-1005

Java Sample
String accessToken = ...
String accessTokenSecret = ...
Map<SearchParameter, String> searchParameters  = ...
List<ProfileField> profileFields = ...
Integer start = ...
Integer count = ...
SearchSortOrder sortOrder = ...
LinkedInConnector linkedin = new LinkedInConnector();
Object response = linkedin.searchPeople(accessToken, accessTokenSecret, searchParameters, profileFields, start, count, sortOrder);

Parameters
searchParameters The search parameters to use
profileFields The profile fields to retriee
start The start, if set count needs to be specified
count The count, if set start needs to be specified
sortOrder The sort order to use, defaults to RELEVANCE
Returns
  • the people

public PeopleSearch searchPeopleWithFacetFields (Map<SearchParameter, String> searchParameters, List<ProfileField> profileFields, List<FacetField> facetFields, Integer start, Integer count, SearchSortOrder sortOrder, Map<FacetType, String> facets)

Search people. For details see http://developer.linkedin.com/docs/DOC-1005

Java Sample
String accessToken = ...
String accessTokenSecret = ...
Map<SearchParameter, String> searchParameters  = ...
List<ProfileField> profileFields = ...
List<FacetField> facetFields = ...
Integer start = ...
Integer count = ...
SearchSortOrder sortOrder =
Map<FacetType, String> facets = ...
LinkedInConnector linkedin = new LinkedInConnector();
Object response = linkedin.searchPeopleWithFacetFields(accessToken, accessTokenSecret, searchParameters, profileFields, facetFields, start, count, sortOrder, facets);

Parameters
searchParameters The search parameters
profileFields The profile fields to retrieve
facetFields The facet fields to use
start The start, if set count needs to be specified
count The count, if set start needs to be specified
sortOrder The sort order, defaults to RELEVANCE
facets The facets to use
Returns
  • the people

public People searchPeopleWithFacets (Map<SearchParameter, String> searchParameters, List<ProfileField> profileFields, Integer start, Integer count, SearchSortOrder sortOrder, Map<FacetType, String> facets)

Search people. For details see http://developer.linkedin.com/docs/DOC-1005

Java Sample
String accessToken = ...
String accessTokenSecret = ...
Map<SearchParameter, String> searchParameters  = ...
List<ProfileField> profileFields = ...
Integer start = ...
Integer count = ...
SearchSortOrder sortOrder =
Map<FacetType, String> facets = ...
LinkedInConnector linkedin = new LinkedInConnector();
Object response = linkedin.searchPeopleWithFacets(accessToken, accessTokenSecret, searchParameters, profileFields, start, count, sortOrder, facets));

Parameters
searchParameters The search parameters
profileFields The profile fields to retrieve
start The start, if set count needs to be specified
count The count, if set start needs to be specified
sortOrder The sort order to use, defaults to RELEVANCE
facets The facet type and a comma separated string with all the values
Returns
  • the people

public void sendInviteByEmail (String email, String firstName, String lastName, String subject, String message)

Send invite. For details see http://developer.linkedin.com/docs/DOC-1012

Java Sample
String accessToken = ...
String accessTokenSecret = ...
String email = ...
String firstName = ...
String lastName = ...
String subject = ...
String message = ...
LinkedInConnector linkedin = new LinkedInConnector();
Object response = linkedin.sendInviteByEmail(accessToken, accessTokenSecret, email, firstName, lastName, subject, message);

Parameters
email The email
firstName The first name
lastName The last name
subject The subject
message The message

public void sendMessage (List<String> recepientIds, String subject, String message)

Send message. For details see http://developer.linkedin.com/docs/DOC-1044

Java Sample
String accessToken = ...
String accessTokenSecret = ...
List<String> recepientIds = ...
String subject = ...
String message = ...
LinkedInConnector linkedin = new LinkedInConnector();
Object response = linkedin.sendMessage(accessToken, accessTokenSecret, recepientIds, subject, message);

Parameters
recepientIds The recepient ids
subject The subject
message The message

public void setAccessToken (String accessToken)

Parameters
accessToken

public void setAccessTokenSecret (String accessTockenSecret)

Parameters
accessTockenSecret

public void setApiKey (String apiKey)

Parameters
apiKey

public void setApiSecret (String apiSecret)

Parameters
apiSecret

public void setScope (String scope)

Parameters
scope

public void unlikePost (String networkUpdateId)

Unlike post. For details see http://developer.linkedin.com/docs/DOC-1043

Java Sample
String accessToken = ...
String accessTokenSecret = ...
String networkUpdateId = ...
LinkedInConnector linkedin = new LinkedInConnector();
Object response = linkedin.unlikePost(accessToken, accessTokenSecret, networkUpdateId);

Parameters
networkUpdateId The network update id

public void updateCurrentStatus (String status, Boolean postToTwitter)

Update current status. For details see http://developer.linkedin.com/docs/DOC-1007

Java Sample
String accessToken = ...
String accessTokenSecret = ...
String status = ...
Boolean postToTwitter = ...
LinkedInConnector linkedin = new LinkedInConnector();
Object response = linkedin.updateCurrentStatus(accessToken, accessTokenSecret, status, postToTwitter);

Parameters
status The status
postToTwitter Whether to post the update to Twitter