第98章 LinkedIn


LinkedIn コンポーネント

Camel 2.14 から利用可能
LinkedIn コンポーネントは、https://developer.linkedin.com/rest に記載されている LinkedIn REST API へのアクセスを提供します。
LinkedIn は、すべてのクライアントアプリケーション認証に OAuth2.0 を使用します。アカウントで camel-linkedin を使用するには、https://www.linkedin.com/secure/developer で LinkedIn に新しいアプリケーションを作成する必要があります。LinkedIn アプリケーションのクライアント ID およびシークレットにより、現在のユーザーを必要とする LinkedIn REST API へのアクセスが許可されます。ユーザーアクセストークンは、エンドユーザーのコンポーネントによって生成および管理されます。また、Camel アプリケーションは org.apache.camel.component.linkedin.api.OAuthSecureStorage の実装を登録し、org.apache.camel.component.linkedin.apiOAuthToken OAuth トークンを提供することもできます。
TLS (Transport Layer Security)を使用するように camel-linkedin コンポーネントを設定するには、Security Guide の Configuring Transport Security for Camel Components の章を参照してください
Maven ユーザーは、このコンポーネントの以下の依存関係を pom.xml に追加する必要があります。
<dependency>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-linkedin</artifactId>
    <version>${camel-version}</version>
</dependency>
Copy to Clipboard Toggle word wrap

URI 形式

linkedin://endpoint-prefix/endpoint?[options]
Copy to Clipboard Toggle word wrap
endpoint-prefix は以下のいずれかになります。
  • comments
  • companies
  • groups
  • jobs
  • people
  • posts
  • search

LinkedInComponent

LinkedIn コンポーネントは、以下のオプションで設定できます。これらのオプションは、org.apache.camel.component.linkedin.LinkedInConfiguration タイプのコンポーネントの Bean プロパティー 設定 を使用して指定できます。
Expand
オプション タイプ 説明
clientId String LinkedIn アプリケーションクライアント ID
clientSecret String LinkedIn アプリケーションクライアントシークレット
httpParams java.util.Map プロキシーホストおよびポートなどのカスタム HTTP パラメーター。AllClientPNamesからの定数を使用します。
lazyAuth boolean Lazy OAuth を有効または無効にするフラグ。デフォルトは true です。有効にすると、OAuth トークンの取得または生成は最初の REST 呼び出しまで実行されません。
redirectUri String アプリケーションのリダイレクト URI は、機能するリダイレクトサーバーを用意しなくても、コンポーネントはこのページにリダイレクトされません。テストには https://localhost を使用できます。
scopes org.apache.camel.component.linkedin.api.OAuthScope[] https://developer.linkedin.com/documents/authentication#grantingで指定される LinkedIn スコープの一覧
secureStorage org.apache.camel.component.linkedin.api.OAuthSecureStorage OAuth トークンを提供するコールバックインターフェイス、またはコンポーネントによって生成されたトークンを保存するコールバックインターフェイス。コールバックは最初の呼び出しで null を返し、作成されたトークンを saveToken ()コールバックに保存します。コールバックが初めて null を返す場合は、userPassword を指定する必要があります。
userName String LinkedIn ユーザーアカウント名を指定する必要があります。提供する必要があります
userPassword String LinkedIn アカウントのパスワード

プロデューサーエンドポイント:

プロデューサーエンドポイントはエンドポイント接頭辞を使用し、続いてエンドポイント名と以下で説明する関連オプションを使用できます。一部のエンドポイントには、短縮エイリアスを使用できます。エンドポイント URI には 接頭辞が含まれている必要があります。
必須ではないエンドポイントオプションは [] で示されます。エンドポイントに必須のオプションがない場合は、[] オプションのセットの 1 つを指定する必要があります。プロデューサーエンドポイントは、Camel Exchange In メッセージに含まれる値を持つ endpoint オプションの名前が含まれる必要がある特別なオプション inBody を使用することもできます。
エンドポイントオプションは、エンドポイント URI またはメッセージヘッダーで動的に指定できます。メッセージヘッダー名は CamelLinkedIn.<option> の形式である必要がありますinBody オプションはメッセージヘッダーを上書きすることに注意してください。つまり、エンドポイントオプションの inBody=optionCamelLinkedIn.option ヘッダーを上書きすることに注意してください。
エンドポイントおよびオプションの詳細は、https://developer.linkedin.com/rest の LinkedIn REST API ドキュメントを参照してください。

エンドポイント接頭辞のコメント

以下のエンドポイントは、以下のように接頭辞 コメント で呼び出すことができます。
linkedin://comments/endpoint?[options]
Copy to Clipboard Toggle word wrap
Expand
エンドポイント 短縮形エイリアス オプション 結果ボディーのタイプ
getComment comment comment_id, fields org.apache.camel.component.linkedin.api.model.Comment
removeComment comment comment_id

コメントの URI オプション

Expand
名前 タイプ
comment_id String
fields String

エンドポイント接頭辞企業

以下のエンドポイントは、以下のように接頭辞 企業 で呼び出すことができます。
linkedin://companies/endpoint?[options]
Copy to Clipboard Toggle word wrap
Expand
エンドポイント 短縮形エイリアス オプション 結果ボディーのタイプ
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

企業の URI オプション

[s) [companySizes, count, email_domain, end_timestamp, event_type, geos, industry, is_company_admin, jobFunc, secure_urls, depthities, start, start_timestamp, time_granularity] のいずれかのオプションに値が指定されていない場合、null と見なされます。null 値は、他のオプションが一致するエンドポイントを満たさない場合にのみ使用されることに注意してください。
Expand
名前 タイプ
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

エンドポイント接頭辞グループ

以下のエンドポイントは、以下のように接頭辞 グループ で呼び出すことができます。
linkedin://groups/endpoint?[options]
Copy to Clipboard Toggle word wrap
Expand
エンドポイント 短縮形エイリアス オプション 結果ボディーのタイプ
addPost post group_id, post
getGroup group group_id org.apache.camel.component.linkedin.api.model.Group

グループの URI オプション

Expand
名前 タイプ
group_id Long
post org.apache.camel.component.linkedin.api.model.Post

エンドポイント接頭辞ジョブ

以下のエンドポイントは、以下のように接頭辞 ジョブ で呼び出すことができます。
linkedin://jobs/endpoint?[options]
Copy to Clipboard Toggle word wrap
Expand
エンドポイント 短縮形エイリアス オプション 結果ボディーのタイプ
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

ジョブの URI オプション

Expand
名前 タイプ
fields String
job org.apache.camel.component.linkedin.api.model.Job
job_id Long
partner_job_id Long

エンドポイント接頭辞 people

以下のエンドポイントは、以下のように接頭辞 people で呼び出すことができます。
linkedin://people/endpoint?[options]
Copy to Clipboard Toggle word wrap
Expand
エンドポイント 短縮形エイリアス オプション 結果ボディーのタイプ
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

ユーザーの URI オプション

[after, before, category, count, membership_state, modified_since, order, public_profile_url, role, scope, secure_urls, show_hidden_members, start, type] のいずれかのオプションに値が指定されていない場合は、null と見なされます。null 値は、他のオプションが一致するエンドポイントを満たさない場合にのみ使用されることに注意してください。
Expand
名前 タイプ
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

エンドポイント接頭辞 POST

以下のエンドポイントは、以下のように posts 接頭辞で呼び出すことができます。
linkedin://posts/endpoint?[options]
Copy to Clipboard Toggle word wrap
Expand
エンドポイント 短縮形エイリアス オプション 結果ボディーのタイプ
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

投稿の URI オプション

エンドポイント URI またはメッセージヘッダーのいずれかで値が提供されない [count, start] オプションの場合は、null と見なされます。null 値は、他のオプションが一致するエンドポイントを満たさない場合にのみ使用されることに注意してください。
Expand
名前 タイプ
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

エンドポイント接頭辞検索

以下のエンドポイントは、以下のように接頭辞 search で呼び出すことができます。
linkedin://search/endpoint?[options]
Copy to Clipboard Toggle word wrap
Expand
エンドポイント 短縮形エイリアス オプション 結果ボディーのタイプ
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

検索の URI オプション

[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] のいずれかのオプションに指定しないと、null と見なされます。null 値は、他のオプションが一致するエンドポイントを満たさない場合にのみ使用されることに注意してください。
Expand
名前 タイプ
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. 接頭辞を持つ Scheduled Poll Consumer オプション を使用して、エンドポイント呼び出しをスケジュールできます。デフォルトでは、配列またはコレクションを返すコンシューマーエンドポイントは、要素ごとにエクスチェンジを 1 つ生成し、それらのルートはエクスチェンジごとに 1 回実行されます。この動作を変更するには、consumer.splitResults=true プロパティーを使用して、リストまたは配列全体の単一のエクスチェンジを返します。

メッセージヘッダー

すべての URI オプションは、CamelLinkedIn. 接頭辞を持つプロデューサーエンドポイントのメッセージヘッダーで指定できます。

メッセージボディー

すべての結果メッセージ本文は、Apache CXF JAX-RS を使用してビルドされる Camel LinkedIn API SDK によって提供されるオブジェクトを使用します。プロデューサーエンドポイントは、inBody エンドポイントパラメーターに受信メッセージボディーのオプション名を指定できます。

ユースケース

以下のルートはユーザーのプロファイルを取得します。
from("direct:foo")
	.to("linkedin://people/person");
Copy to Clipboard Toggle word wrap
以下のルートは、30 秒ごとにユーザーの接続をポーリングします。
from("linkedin://people/connections?consumer.timeUnit=SECONDS&consumer.delay=30")
	.to("bean:foo");
Copy to Clipboard Toggle word wrap
以下のルートは、動的ヘッダーオプションを持つプロデューサーを使用します。personId ヘッダーには LinkedIn person ID があるため、以下のように CamelLinkedIn.person_id ヘッダーに割り当てられます。
from("direct:foo")
	.setHeader("CamelLinkedIn.person_id", header("personId"))
	.to("linkedin://people/connectionsById")
	.to("bean://bar");
Copy to Clipboard Toggle word wrap
トップに戻る
Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。 最新の更新を見る.

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

Theme

© 2025 Red Hat