[[linkedin-component]]
= Linkedin Component
:page-source: components/camel-linkedin/camel-linkedin-component/src/main/docs/linkedin-component.adoc

*Available as of Camel version 2.14*

The LinkedIn component provides access to all of LinkedIn REST APIs
documented
at https://developer.linkedin.com/rest[https://developer.linkedin.com/rest]. 

LinkedIn uses OAuth2.0 for all client application authentication. In
order to use camel-linkedin with your account, you'll need to create a
new application for LinkedIn at
https://www.linkedin.com/secure/developer[https://www.linkedin.com/secure/developer].
The LinkedIn application's client id and secret will allow access to
LinkedIn REST APIs which require a current user. A user access token is
generated and managed by component for an end user. Alternatively the
Camel application can register an implementation
of org.apache.camel.component.linkedin.api.OAuthSecureStorage to provide
an org.apache.camel.component.linkedin.apiOAuthToken OAuth token.

Maven users will need to add the following dependency to their pom.xml
for this component:

[source,java]
-----------------------------------------------
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-linkedin</artifactId>
        <version>${camel-version}</version>
    </dependency>
-----------------------------------------------

== URI format

[source,java]
-------------------------------------------------
    linkedin://endpoint-prefix/endpoint?[options]
-------------------------------------------------

Endpoint prefix can be one of:

* comments
* companies
* groups
* jobs
* people
* posts
* search

== LinkedInComponent




// component options: START
The Linkedin component supports 2 options, which are listed below.



[width="100%",cols="2,5,^1,2",options="header"]
|===
| Name | Description | Default | Type
| *configuration* (common) | To use the shared configuration |  | LinkedInConfiguration
| *basicPropertyBinding* (advanced) | Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean
|===
// component options: END





// endpoint options: START
The Linkedin endpoint is configured using URI syntax:

----
linkedin:apiName/methodName
----

with the following path and query parameters:

=== Path Parameters (2 parameters):


[width="100%",cols="2,5,^1,2",options="header"]
|===
| Name | Description | Default | Type
| *apiName* | *Required* What kind of operation to perform |  | LinkedInApiName
| *methodName* | *Required* What sub operation to use for the selected operation |  | String
|===


=== Query Parameters (34 parameters):


[width="100%",cols="2,5,^1,2",options="header"]
|===
| Name | Description | Default | Type
| *accessToken* (common) | LinkedIn access token to avoid username and password login procedure. LinkedIn responds to login forms by using a CAPTCHA. This makes it impossible for a standalone, headless process to log in to LinkedIn by specifying a username and password. To work around this, obtain a LinkedIn access token and provide the token as the setting of the accessToken parameter. Obtaining a LinkedIn access token is a multi-step procedure. You must configure your LinkedIn application, obtain a LinkedIn authorization code, and exchange that code for the LinkedIn access token. For details, see: \https://developer.linkedin.com/docs/oauth2 The default behavior is that the access token expires after 60 days. To change this, specify a value for the expiryTime paramter. If the access token expires, the LinkedIn component tries to log in to LinkedIn by providing a username and password, which results in a CAPTCHA so the login fails. The LinkedIn component cannot refresh the access token. You must manually obtain a new access token each time an access token expires. When you update the access token you must restart the application so that it uses the new token. |  | String
| *clientId* (common) | LinkedIn application client ID |  | String
| *clientSecret* (common) | LinkedIn application client secret |  | String
| *expiryTime* (common) | A number of milliseconds since the UNIX Epoch. The default is 60 days. A LinkedIn access token expires when this amount of time elapses after the token is in use. |  | Long
| *httpParams* (common) | Custom HTTP parameters, for example, proxy host and port. Use constants from AllClientPNames. |  | Map
| *inBody* (common) | Sets the name of a parameter to be passed in the exchange In Body |  | String
| *lazyAuth* (common) | Flag to enable/disable lazy OAuth, default is true. When enabled, OAuth token retrieval or generation is not done until the first REST call. | true | boolean
| *redirectUri* (common) | Application redirect URI, although the component never redirects to this page to avoid having to have a functioning redirect server. For testing, one could use \https://localhost. |  | String
| *scopes* (common) | List of LinkedIn scopes as specified at \https://developer.linkedin.com/documents/authentication#granting |  | OAuthScope[]
| *secureStorage* (common) | Callback interface for providing an OAuth token or to store the token generated by the component. The callback should return null on the first call and then save the created token in the saveToken() callback. If the callback returns null the first time, a userPassword MUST be provided. |  | OAuthSecureStorage
| *userName* (common) | LinkedIn user account name, MUST be provided |  | String
| *userPassword* (common) | LinkedIn account password |  | String
| *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | boolean
| *sendEmptyMessageWhenIdle* (consumer) | If the polling consumer did not poll any files, you can enable this option to send an empty message (no body) instead. | false | boolean
| *exceptionHandler* (consumer) | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored. |  | ExceptionHandler
| *exchangePattern* (consumer) | Sets the exchange pattern when the consumer creates an exchange. |  | ExchangePattern
| *pollStrategy* (consumer) | A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing you to provide your custom implementation to control error handling usually occurred during the poll operation before an Exchange have been created and being routed in Camel. |  | PollingConsumerPollStrategy
| *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing. | false | boolean
| *basicPropertyBinding* (advanced) | Whether the endpoint should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean
| *synchronous* (advanced) | Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported). | false | boolean
| *backoffErrorThreshold* (scheduler) | The number of subsequent error polls (failed due some error) that should happen before the backoffMultipler should kick-in. |  | int
| *backoffIdleThreshold* (scheduler) | The number of subsequent idle polls that should happen before the backoffMultipler should kick-in. |  | int
| *backoffMultiplier* (scheduler) | To let the scheduled polling consumer backoff if there has been a number of subsequent idles/errors in a row. The multiplier is then the number of polls that will be skipped before the next actual attempt is happening again. When this option is in use then backoffIdleThreshold and/or backoffErrorThreshold must also be configured. |  | int
| *delay* (scheduler) | Milliseconds before the next poll. You can also specify time values using units, such as 60s (60 seconds), 5m30s (5 minutes and 30 seconds), and 1h (1 hour). | 500 | long
| *greedy* (scheduler) | If greedy is enabled, then the ScheduledPollConsumer will run immediately again, if the previous run polled 1 or more messages. | false | boolean
| *initialDelay* (scheduler) | Milliseconds before the first poll starts. You can also specify time values using units, such as 60s (60 seconds), 5m30s (5 minutes and 30 seconds), and 1h (1 hour). | 1000 | long
| *repeatCount* (scheduler) | Specifies a maximum limit of number of fires. So if you set it to 1, the scheduler will only fire once. If you set it to 5, it will only fire five times. A value of zero or negative means fire forever. | 0 | long
| *runLoggingLevel* (scheduler) | The consumer logs a start/complete log line when it polls. This option allows you to configure the logging level for that. | TRACE | LoggingLevel
| *scheduledExecutorService* (scheduler) | Allows for configuring a custom/shared thread pool to use for the consumer. By default each consumer has its own single threaded thread pool. |  | ScheduledExecutorService
| *scheduler* (scheduler) | To use a cron scheduler from either camel-spring or camel-quartz component | none | String
| *schedulerProperties* (scheduler) | To configure additional properties when using a custom scheduler or any of the Quartz, Spring based scheduler. |  | Map
| *startScheduler* (scheduler) | Whether the scheduler should be auto started. | true | boolean
| *timeUnit* (scheduler) | Time unit for initialDelay and delay options. | MILLISECONDS | TimeUnit
| *useFixedDelay* (scheduler) | Controls if fixed delay or fixed rate is used. See ScheduledExecutorService in JDK for details. | true | boolean
|===
// endpoint options: END
// spring-boot-auto-configure options: START
== Spring Boot Auto-Configuration

When using Spring Boot make sure to use the following Maven dependency to have support for auto configuration:

[source,xml]
----
<dependency>
  <groupId>org.apache.camel</groupId>
  <artifactId>camel-linkedin-starter</artifactId>
  <version>x.x.x</version>
  <!-- use the same version as your Camel core version -->
</dependency>
----


The component supports 15 options, which are listed below.



[width="100%",cols="2,5,^1,2",options="header"]
|===
| Name | Description | Default | Type
| *camel.component.linkedin.basic-property-binding* | Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | Boolean
| *camel.component.linkedin.configuration.access-token* | LinkedIn access token to avoid username and password login procedure. LinkedIn responds to login forms by using a CAPTCHA. This makes it impossible for a standalone, headless process to log in to LinkedIn by specifying a username and password. To work around this, obtain a LinkedIn access token and provide the token as the setting of the accessToken parameter. Obtaining a LinkedIn access token is a multi-step procedure. You must configure your LinkedIn application, obtain a LinkedIn authorization code, and exchange that code for the LinkedIn access token. For details, see: \https://developer.linkedin.com/docs/oauth2 The default behavior is that the access token expires after 60 days. To change this, specify a value for the expiryTime paramter. If the access token expires, the LinkedIn component tries to log in to LinkedIn by providing a username and password, which results in a CAPTCHA so the login fails. The LinkedIn component cannot refresh the access token. You must manually obtain a new access token each time an access token expires. When you update the access token you must restart the application so that it uses the new token. |  | String
| *camel.component.linkedin.configuration.api-name* | What kind of operation to perform |  | LinkedInApiName
| *camel.component.linkedin.configuration.client-id* | LinkedIn application client ID |  | String
| *camel.component.linkedin.configuration.client-secret* | LinkedIn application client secret |  | String
| *camel.component.linkedin.configuration.expiry-time* | A number of milliseconds since the UNIX Epoch. The default is 60 days. A LinkedIn access token expires when this amount of time elapses after the token is in use. |  | Long
| *camel.component.linkedin.configuration.http-params* | Custom HTTP parameters, for example, proxy host and port. Use constants from AllClientPNames. |  | Map
| *camel.component.linkedin.configuration.lazy-auth* | Flag to enable/disable lazy OAuth, default is true. When enabled, OAuth token retrieval or generation is not done until the first REST call. | true | Boolean
| *camel.component.linkedin.configuration.method-name* | What sub operation to use for the selected operation |  | String
| *camel.component.linkedin.configuration.redirect-uri* | Application redirect URI, although the component never redirects to this page to avoid having to have a functioning redirect server. For testing, one could use \https://localhost. |  | String
| *camel.component.linkedin.configuration.scopes* | List of LinkedIn scopes as specified at \https://developer.linkedin.com/documents/authentication#granting |  | OAuthScope[]
| *camel.component.linkedin.configuration.secure-storage* | Callback interface for providing an OAuth token or to store the token generated by the component. The callback should return null on the first call and then save the created token in the saveToken() callback. If the callback returns null the first time, a userPassword MUST be provided. |  | OAuthSecureStorage
| *camel.component.linkedin.configuration.user-name* | LinkedIn user account name, MUST be provided |  | String
| *camel.component.linkedin.configuration.user-password* | LinkedIn account password |  | String
| *camel.component.linkedin.enabled* | Enable linkedin component | true | Boolean
|===
// spring-boot-auto-configure options: END

== Producer Endpoints:

Producer endpoints can use endpoint prefixes followed by endpoint names
and associated options described next. A shorthand alias can be used for
some endpoints. The endpoint URI MUST contain a prefix.

Endpoint options that are not mandatory are denoted by []. When there
are no mandatory options for an endpoint, one of the set of [] options
MUST be provided. Producer endpoints can also use a special
option *inBody* that in turn should contain the name of the endpoint
option whose value will be contained in the Camel Exchange In message.

Any of the endpoint options can be provided in either the endpoint URI,
or dynamically in a message header. The message header name must be of
the format *CamelLinkedIn.<option>*. Note that the *inBody* option
overrides message header, i.e. the endpoint option *inBody=option* would
override a *CamelLinkedIn.option* header.

For more information on the endpoints and options see LinkedIn REST API
documentation
at https://developer.linkedin.com/rest[https://developer.linkedin.com/rest]. 

=== Endpoint prefix _comments_

The following endpoints can be invoked with the prefix *comments* as
follows:

[source,java]
------------------------------------------
    linkedin://comments/endpoint?[options]
------------------------------------------

[width="100%",cols="25%,25%,25%,25%",options="header",]
|=======================================================================
|Endpoint |Shorthand Alias |Options |Result Body Type

|getComment |comment |comment_id, fields |org.apache.camel.component.linkedin.api.model.Comment

|removeComment |comment |comment_id | 
|=======================================================================

[[LinkedIn-URIOptionsforcomments]]
URI Options for _comments_

[width="100%",cols="50%,50%",options="header",]
|=======================================================================
|Name |Type

|comment_id |String

|fields |String
|=======================================================================

=== Endpoint prefix _companies_

The following endpoints can be invoked with the prefix *companies* as
follows:

[source,java]
-------------------------------------------
    linkedin://companies/endpoint?[options]
-------------------------------------------

[width="100%",cols="25%,25%,25%,25%",options="header",]
|=======================================================================
|Endpoint |Shorthand Alias |Options |Result Body Type

|addCompanyUpdateComment |companyUpdateComment |company_id, update_key, updatecomment |

|addCompanyUpdateCommentAsCompany |companyUpdateCommentAsCompany |company_id, update_key, updatecomment |

|addShare |share |company_id, share |

|getCompanies |companies |email_domain, fields, is_company_admin |org.apache.camel.component.linkedin.api.model.Companies

|getCompanyById |companyById |company_id, fields |org.apache.camel.component.linkedin.api.model.Company

|getCompanyByName |companyByName |fields, universal_name |org.apache.camel.component.linkedin.api.model.Company

|getCompanyUpdateComments |companyUpdateComments |company_id, fields, secure_urls, update_key |org.apache.camel.component.linkedin.api.model.Comments

|getCompanyUpdateLikes |companyUpdateLikes |company_id, fields, secure_urls, update_key |org.apache.camel.component.linkedin.api.model.Likes

|getCompanyUpdates |companyUpdates |company_id, count, event_type, fields, start |org.apache.camel.component.linkedin.api.model.Updates

|getHistoricalFollowStatistics |historicalFollowStatistics |company_id, end_timestamp, start_timestamp, time_granularity |org.apache.camel.component.linkedin.api.model.HistoricalFollowStatistics

|getHistoricalStatusUpdateStatistics |historicalStatusUpdateStatistics |company_id, end_timestamp, start_timestamp, time_granularity, update_key |org.apache.camel.component.linkedin.api.model.HistoricalStatusUpdateStatistics

|getNumberOfFollowers |numberOfFollowers |companySizes, company_id, geos, industries, jobFunc, seniorities |org.apache.camel.component.linkedin.api.model.NumFollowers

|getStatistics |statistics |company_id |org.apache.camel.component.linkedin.api.model.CompanyStatistics

|isShareEnabled |  | company_id |org.apache.camel.component.linkedin.api.model.IsCompanyShareEnabled

|isViewerShareEnabled |  |company_id |org.apache.camel.component.linkedin.api.model.IsCompanyShareEnabled

|likeCompanyUpdate |  | company_id, isliked, update_key |
|=======================================================================

[[LinkedIn-URIOptionsforcompanies]]
URI Options for _companies_

If a value is not provided for one of the option(s) *[companySizes,
count, email_domain, end_timestamp, event_type, geos, industries,
is_company_admin, jobFunc, secure_urls, seniorities, start,
start_timestamp, time_granularity]* either in the endpoint URI or in a
message header, it will be assumed to be *null*. Note that
the *null* value(s) will only be used if other options do not satisfy
matching endpoints.

[width="100%",cols="50%,50%",options="header",]
|=======================================================================
|Name |Type

|companySizes |java.util.List

|company_id |Long

|count |Long

|email_domain |String

|end_timestamp |Long

|event_type |org.apache.camel.component.linkedin.api.Eventtype

|fields |String

|geos |java.util.List

|industries |java.util.List

|is_company_admin |Boolean

|isliked |org.apache.camel.component.linkedin.api.model.IsLiked

|jobFunc |java.util.List

|secure_urls |Boolean

|seniorities |java.util.List

|share |org.apache.camel.component.linkedin.api.model.Share

|start |Long

|start_timestamp |Long

|time_granularity |org.apache.camel.component.linkedin.api.Timegranularity

|universal_name |String

|update_key |String

|updatecomment |org.apache.camel.component.linkedin.api.model.UpdateComment
|=======================================================================

=== Endpoint prefix _groups_

The following endpoints can be invoked with the prefix *groups* as
follows:

[source,java]
----------------------------------------
    linkedin://groups/endpoint?[options]
----------------------------------------

[width="100%",cols="25%,25%,25%,25%",options="header",]
|=======================================================================
|Endpoint |Shorthand Alias |Options |Result Body Type

|addPost |post |group_id, post |

|getGroup |group |group_id |org.apache.camel.component.linkedin.api.model.Group
|=======================================================================

[[LinkedIn-URIOptionsforgroups]]
URI Options for _groups_

[width="100%",cols="50%,50%",options="header",]
|=======================================================================
|Name |Type

|group_id |Long

|post |org.apache.camel.component.linkedin.api.model.Post
|=======================================================================

=== Endpoint prefix _jobs_

The following endpoints can be invoked with the prefix *jobs* as
follows:

[source,java]
--------------------------------------
    linkedin://jobs/endpoint?[options]
--------------------------------------

[width="100%",cols="25%,25%,25%,25%",options="header",]
|=======================================================================
|Endpoint |Shorthand Alias |Options |Result Body Type

|addJob |job |job |

|editJob |  | job, partner_job_id |

|getJob |job |fields, job_id |org.apache.camel.component.linkedin.api.model.Job

|removeJob |job |partner_job_id
|=======================================================================

[[LinkedIn-URIOptionsforjobs]]
URI Options for _jobs_

[width="100%",cols="50%,50%",options="header",]
|=======================================================================
|Name |Type

|fields |String

|job |org.apache.camel.component.linkedin.api.model.Job

|job_id |Long

|partner_job_id |Long
|=======================================================================

=== Endpoint prefix _people_

The following endpoints can be invoked with the prefix *people* as
follows:

[source,java]
----------------------------------------
    linkedin://people/endpoint?[options]
----------------------------------------

[width="100%",cols="25%,25%,25%,25%",options="header",]
|=======================================================================
|Endpoint |Shorthand Alias |Options |Result Body Type

|addActivity |activity |activity |

|addGroupMembership |groupMembership |groupmembership |

|addInvite |invite |mailboxitem |

|addJobBookmark |jobBookmark |jobbookmark |

|addUpdateComment |updateComment |update_key, updatecomment |

|followCompany |  |company |

|getConnections |connections |fields, secure_urls |org.apache.camel.component.linkedin.api.model.Connections

|getConnectionsById |connectionsById |fields, person_id, secure_urls |org.apache.camel.component.linkedin.api.model.Connections

|getConnectionsByUrl |connectionsByUrl |fields, public_profile_url, secure_urls |org.apache.camel.component.linkedin.api.model.Connections

|getFollowedCompanies |followedCompanies |fields |org.apache.camel.component.linkedin.api.model.Companies

|getGroupMembershipSettings |groupMembershipSettings |count, fields, group_id, start |org.apache.camel.component.linkedin.api.model.GroupMemberships

|getGroupMemberships |groupMemberships |count, fields, membership_state, start |org.apache.camel.component.linkedin.api.model.GroupMemberships

|getJobBookmarks |jobBookmarks |  | org.apache.camel.component.linkedin.api.model.JobBookmarks

|getNetworkStats |networkStats |  | org.apache.camel.component.linkedin.api.model.NetworkStats

|getNetworkUpdates |networkUpdates |after, before, count, fields, scope, secure_urls, show_hidden_members,
start, type |org.apache.camel.component.linkedin.api.model.Updates

|getNetworkUpdatesById |networkUpdatesById |after, before, count, fields, person_id, scope, secure_urls,
show_hidden_members, start, type |org.apache.camel.component.linkedin.api.model.Updates

|getPerson |person |fields, secure_urls |org.apache.camel.component.linkedin.api.model.Person

|getPersonById |personById |fields, person_id, secure_urls |org.apache.camel.component.linkedin.api.model.Person

|getPersonByUrl |personByUrl |fields, public_profile_url, secure_urls |org.apache.camel.component.linkedin.api.model.Person

|getPosts |posts |category, count, fields, group_id, modified_since, order, role, start |org.apache.camel.component.linkedin.api.model.Posts

|getSuggestedCompanies |suggestedCompanies |fields |org.apache.camel.component.linkedin.api.model.Companies

|getSuggestedGroupPosts |suggestedGroupPosts |category, count, fields, group_id, modified_since, order, role, start |org.apache.camel.component.linkedin.api.model.Posts

|getSuggestedGroups |suggestedGroups |fields |org.apache.camel.component.linkedin.api.model.Groups

|getSuggestedJobs |suggestedJobs |fields |org.apache.camel.component.linkedin.api.model.JobSuggestions

|getUpdateComments |updateComments |fields, secure_urls, update_key |org.apache.camel.component.linkedin.api.model.Comments

|getUpdateLikes |updateLikes |fields, secure_urls, update_key |org.apache.camel.component.linkedin.api.model.Likes

|likeUpdate |  | isliked, update_key |

|removeGroupMembership |groupMembership |group_id |

|removeGroupSuggestion |groupSuggestion |group_id |

|removeJobBookmark |jobBookmark |job_id |

|share |  | share |org.apache.camel.component.linkedin.api.model.Update

|stopFollowingCompany |  | company_id |

|updateGroupMembership |  | group_id, groupmembership |
|=======================================================================

[[LinkedIn-URIOptionsforpeople]]
URI Options for _people_

If a value is not provided for one of the option(s) *[after, before,
category, count, membership_state, modified_since, order,
public_profile_url, role, scope, secure_urls, show_hidden_members,
start, type]* either in the endpoint URI or in a message header, it will
be assumed to be *null*. Note that the *null* value(s) will only be used
if other options do not satisfy matching endpoints.

[width="100%",cols="50%,50%",options="header",]
|=======================================================================
|Name |Type

|activity |org.apache.camel.component.linkedin.api.model.Activity

|after |Long

|before |Long

|category |org.apache.camel.component.linkedin.api.Category

|company |org.apache.camel.component.linkedin.api.model.Company

|company_id |Long

|count |Long

|fields |String

|group_id |Long

|groupmembership |org.apache.camel.component.linkedin.api.model.GroupMembership

|isliked |org.apache.camel.component.linkedin.api.model.IsLiked

|job_id |Long

|jobbookmark |org.apache.camel.component.linkedin.api.model.JobBookmark

|mailboxitem |org.apache.camel.component.linkedin.api.model.MailboxItem

|membership_state |org.apache.camel.component.linkedin.api.model.MembershipState

|modified_since |Long

|order |org.apache.camel.component.linkedin.api.Order

|person_id |String 

|public_profile_url |String

|role |org.apache.camel.component.linkedin.api.Role

|scope |String

|secure_urls |Boolean

|share |org.apache.camel.component.linkedin.api.model.Share

|show_hidden_members |Boolean

|start |Long

|type |org.apache.camel.component.linkedin.api.Type

|update_key | String

|updatecomment |org.apache.camel.component.linkedin.api.model.UpdateComment
|=======================================================================

=== Endpoint prefix _posts_

The following endpoints can be invoked with the prefix *posts* as
follows:

[source,java]
---------------------------------------
    linkedin://posts/endpoint?[options]
---------------------------------------

[width="100%",cols="25%,25%,25%,25%",options="header",]
|=======================================================================
|Endpoint |Shorthand Alias |Options |Result Body Type

|addComment |comment |comment, post_id |

|flagCategory |  | post_id, postcategorycode |

|followPost |  | isfollowing, post_id |

|getPost |post |count, fields, post_id, start |org.apache.camel.component.linkedin.api.model.Post

|getPostComments |postComments |count, fields, post_id, start |org.apache.camel.component.linkedin.api.model.Comments

|likePost |  | isliked, post_id |

|removePost |post |post_id |
|=======================================================================
 
[[LinkedIn-URIOptionsforposts]]
URI Options for _posts_

If a value is not provided for one of the option(s) *[count, start]*
either in the endpoint URI or in a message header, it will be assumed to
be *null*. Note that the *null* value(s) will only be used if other
options do not satisfy matching endpoints.

[width="100%",cols="50%,50%",options="header",]
|=======================================================================
|Name |Type

|comment |org.apache.camel.component.linkedin.api.model.Comment

|count |Long

|fields |String

|isfollowing |org.apache.camel.component.linkedin.api.model.IsFollowing

|isliked |org.apache.camel.component.linkedin.api.model.IsLiked

|post_id |String

|postcategorycode |org.apache.camel.component.linkedin.api.model.PostCategoryCode

|start |Long
|=======================================================================

=== Endpoint prefix _search_

The following endpoints can be invoked with the prefix *search* as
follows:

[source,java]
---------------------------------------
   linkedin://search/endpoint?[options]
---------------------------------------

[width="100%",cols="25%,25%,25%,25%",options="header",]
|=======================================================================
|Endpoint |Shorthand Alias |Options |Result Body Type

|searchCompanies |companies |count, facet, facets, fields, hq_only, keywords, sort, start |org.apache.camel.component.linkedin.api.model.CompanySearch

|searchJobs |jobs |company_name, count, country_code, distance, facet, facets, fields,
job_title, keywords, postal_code, sort, start |org.apache.camel.component.linkedin.api.model.JobSearch

|searchPeople |people |company_name, count, country_code, current_company, current_school,
current_title, distance, facet, facets, fields, first_name, keywords,
last_name, postal_code, school_name, sort, start, title |org.apache.camel.component.linkedin.api.model.PeopleSearch
|=======================================================================

[[LinkedIn-URIOptionsforsearch]]
URI Options for _search_

If a value is not provided for one of the option(s) *[company_name,
count, country_code, current_company, current_school, current_title,
distance, facet, facets, first_name, hq_only, job_title, keywords,
last_name, postal_code, school_name, sort, start, title]* either in the
endpoint URI or in a message header, it will be assumed to be *null*.
Note that the *null* value(s) will only be used if other options do not
satisfy matching endpoints.

[width="100%",cols="50%,50%",options="header",]
|=======================================================================
|Name |Type

|company_name |String

|count |Long

|country_code |String

|current_company |String

|current_school |String

|current_title |String

|distance |org.apache.camel.component.linkedin.api.model.Distance

|facet |String

|facets |String

|fields |String

|first_name |String

|hq_only |String

|job_title |String

|keywords |String

|last_name |String

|postal_code |String

|school_name |String

|sort |String

|start |Long

|title |String
|=======================================================================

== Consumer Endpoints

Any of the producer endpoints can be used as a consumer endpoint.
Consumer endpoints can
use http://camel.apache.org/polling-consumer.html#PollingConsumer-ScheduledPollConsumerOptions[Scheduled
Poll Consumer Options] with a *consumer.* prefix to schedule endpoint
invocation. By default Consumer endpoints that return an array or
collection will generate one exchange per element, and their routes will
be executed once for each exchange. To change this behavior use the
property *consumer.splitResults=true* to return a single exchange for
the entire list or array. 

== Message Headers

Any URI option can be provided in a message header for producer
endpoints with a *CamelLinkedIn.* prefix.

== Message body

All result message bodies utilize objects provided by the Camel LinkedIn
API SDK, which is built using Apache CXF JAX-RS. Producer endpoints can
specify the option name for incoming message body in the *inBody*
endpoint parameter.

== Use cases

The following route gets user's profile:

[source,java]
----------------------------------------
    from("direct:foo")
        .to("linkedin://people/person");
----------------------------------------

The following route polls user's connections every 30 seconds:

[source,java]
-------------------------------------------------------------------------------------
    from("linkedin://people/connections?consumer.timeUnit=SECONDS&delay=30")
        .to("bean:foo");
-------------------------------------------------------------------------------------

The following route uses a producer with dynamic header options. The
*personId* header has the LinkedIn person ID, so its assigned to the
*CamelLinkedIn.person_id* header as follows:

[source,java]
-----------------------------------------------------------------
    from("direct:foo")
        .setHeader("CamelLinkedIn.person_id", header("personId"))
        .to("linkedin://people/connectionsById")
        .to("bean://bar");
-----------------------------------------------------------------
