> For the complete documentation index, see [llms.txt](https://docs.appstrategy.com/apprules-r-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.appstrategy.com/apprules-r-documentation/platform/platform-features/system-settings/data-sources/connection-settings/socialnetworks/linkedin.md).

# Linkedin

### Connecting to LinkedIn <a href="#connecting-to-linkedin" id="connecting-to-linkedin"></a>

The LinkedIn CompanyId is a string of numbers, usually 6 to 9 digits long, that is unique to your company. You can find this ID in the URL of the search results page when you click on See All Jobs on your LinkedIn Page. The CompanyId is often required in queries for company data. While this may be set directly in the criteria of a query, the CompanyId may be set globally to avoid issues where the query is not so easily modified.

### Authenticating to LinkedIn <a href="#authenticating-to-linkedin" id="authenticating-to-linkedin"></a>

#### OAuth <a href="#oauth" id="oauth"></a>

LinkedIn supports OAuth authentication only.

#### Create a Custom OAuth App

1. Log in to your [LinkedIn developers dashboard](https://www.linkedin.com/secure/developer) and click Create New App. Enter information to be displayed to users when they are prompted to grant permissions to your application.
2. Select your application and select the following in Default Application Permissions: w\_share, r\_basicprofile, and rw\_company\_admin.
3. Set the RedirectURI:

   * For desktop applications, set the Redirect URI to <http://localhost:33333> or a port number of your choice. When you connect must set the CallbackURL connection property to this exact URL.
   * For web applications, set the Redirect URI to a page on your Web app that you would like the user to be returned to after they have authorized your application.
   * For headless machines, set the Redirect URI to <http://localhost:33333> or a port number of your choice.

   The OAuthClientId and OAuthClientSecret are also displayed in the same page.

After setting the following, you are ready to connect:

* InitiateOAuth: Set this to GETANDREFRESH. You can use InitiateOAuth to avoid repeating the OAuth exchange and manually setting the OAuthAccessToken.
* OAuthClientId (custom applications only): Set this to the client Id assigned when you registered your application.
* OAuthClientSecret (custom applications only): Set this to the client secret assigned when you registered your application.
* CallbackURL (custom application only): Set this to the redirect URI defined when you registered your application.

When you connect, the provider opens LinkedIn's OAuth endpoint in your default browser. Log in and grant permissions to the application. The provider then completes the OAuth process:

* The provider obtains an access token from LinkedIn and uses it to request data.
* Extracts the access token from the callback URL and authenticates requests.
* Saves OAuth values in the path specified in OAuthSettingsLocation. These values persist across connections.

The provider refreshes the access token automatically when it expires.

&#x20;


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.appstrategy.com/apprules-r-documentation/platform/platform-features/system-settings/data-sources/connection-settings/socialnetworks/linkedin.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
