Package com.tnsai.tools.social
Class LinkedInTools
java.lang.Object
com.tnsai.tools.social.LinkedInTools
Function-shape LinkedIn tools — basic profile lookup + UGC post sharing
via the LinkedIn v2 REST API. Replaces the legacy
LinkedInTool.
LinkedIn's API surface is heavily partner-gated — most operations (company search, connections, jobs, full profile) require Marketing / Talent Solutions / Sales Navigator partnership approval. This POJO exposes only the two endpoints accessible with the basic "Sign In with LinkedIn" OAuth flow:
| Method | Endpoint | Idempotent |
|---|---|---|
linkedinMe() | GET /v2/me | true |
linkedinShare(java.lang.String, java.lang.String) | POST /v2/ugcPosts | false (publishes a new post) |
Other legacy operations (company / search_companies / connections / jobs) returned informational stubs about partnership requirements; they can be added piecewise once a real consumer has the right partner tier.
Requires LINKEDIN_ACCESS_TOKEN.
- Since:
- 0.5.7 (Phase 2 batch 31a — built-in tool migration to function shape, see #188)
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor — picks LINKEDIN_ACCESS_TOKEN from env.LinkedInTools(String accessToken) Explicit-token constructor.LinkedInTools(String accessToken, okhttp3.OkHttpClient http, com.fasterxml.jackson.databind.ObjectMapper mapper) Full constructor for tests / shared HTTP. -
Method Summary
-
Constructor Details
-
LinkedInTools
public LinkedInTools()Default constructor — picks LINKEDIN_ACCESS_TOKEN from env. -
LinkedInTools
Explicit-token constructor. -
LinkedInTools
public LinkedInTools(String accessToken, okhttp3.OkHttpClient http, com.fasterxml.jackson.databind.ObjectMapper mapper) Full constructor for tests / shared HTTP.
-
-
Method Details
-
linkedinMe
@Tool(name="linkedin_me", description="Fetch the authenticated user\'s basic LinkedIn profile (id / firstName / lastName / profilePicture). Works with the basic \"Sign In with LinkedIn\" OAuth scope. Returns the raw JSON response. Requires LINKEDIN_ACCESS_TOKEN.", keywords={"linkedin","profile","me","user"}, idempotent=true) public String linkedinMe() throws IOException- Throws:
IOException
-