Learn how to authorize RAW to read LinkedIn.
How to create
As a prerequisite to accessing LinkedIn's API you will need a LinkedIn developer application. To create a new app you can go to LinkedIn's new app page. Information about LinkedIn's authorization flow can be seen in the authorization code flow page
Creating a new token for your LinkedIn App
First go to LinkedIn apps page, select the app you want to generate the new token.
Click on the "Auth" tab and click on the "Oauth 2.0 tools" on the right pane.
Click on "Create token".
Select the scopes you want to give to the new token.
You will be presented with a new access-token and refresh-token, do not close this page or copy paste the tokens somewhere.
Registering the Generated LinkedIn Token
Now we can register the linkedIn credential in your repository.
Go to your RAW-labs admin page, click on "Repositories" -> "Credentials" and click on the LinkedIn icon.
In the popup form add;
- The name you want to give to this credential.
- The token.
- The refresh-token.
- The client-ID.
- And the client-secret of your app
How to use from Snapi
LinkedIn APIs are essentially HTTP-accessible endpoints and as such they can be accessed using the Http package. For instance, here is an example that uses the service https://api.linkedin.com/v2/me
, which provides personal information for a specific LinkedIn user:
let
location = Http.Get(
"https://api.linkedin.com/v2/me",
authCredentialName = "MyLinkedInToken"
)
in
Json.Read(location)
LinkedIn Credential MyLinkedInToken
is defined previously using an access token generated for our test LinkedIn application. For further details, please see LinkedIn documentation and access token generator. Note that instead of using OAuth Token, we could use OAuth Client HTTP type and specify Client ID and Client Secret.