How to configure DataZen to access LinkedIn.
Pre-Requisite
The recommended approach is to register a new application with LinkedIn and request
specific access to the LinkedIn API for this registered application. At a high level, the following steps may
be required to register a new LinkedIn Application.
- Register a LinkedIn developer account
-
Create a new LinkedIn application
Make sure to add the following Redirect URL when registering the application: http://localhost/
Also, make a note of your Client ID and Client Secret - they will be needed later -
Once your application has been created, you may need the following Products assigned to your application in order
to access various parts of the API:
- Share On LinkedIn
- Sign-In with LinkedIn
- Marketing Developer Platform
Once the application has been approved along with the necessary products, your application page should look like this:
Connection String
Once you have configured an application, you can create a Central Connection String in DataZen. Please note that if you need to change your
Authorization Scopes later, or need to refresh your authorization tokens (which expire about a year later automatically), you will need to go through
these steps again.
- In DataZen, choose Configuration -> Central Connection Strings
- Choose New -> HTTP/S Endpoint
- Enter a friendly name for the connection, and specify this HTTP Endpoint URI: https://api.linkedin.com/v2/me
- Choose Bearer for the authentication
- Click on the Obtain OAuth Token... link
- On the OAuth Setting dropdown, select LinkedIn OAuth 2.0 Settings option
- Enter your application Client ID in the appropriate field
- Enter your application Client Secret in the appropriate field
- Make sure the Redirect URI is set to: http://localhost/
-
Enter the Scopes you would like to have approved by the OAuth Token; the 3 Products selected previously, if approved,
grant you access to the following scopes:
- r_basicprofile
- r_emailaddress
- r_liteprofile
- r_organization_social
- r_1st_connections_size
- r_ads_reporting
- r_ads
- w_member_social
- w_organization_social
- rw_adds
- rw_organization_admin
- Click on the Get Access Token field; this will start the authentication process by opening your default browser; complete the authorization flow
- Once the previous is completed, go back to this screen (the Code field should be automatically filled out)
- Click on Get Bearer Token; the Token and Refresh Token will be automatically filled out
- Click OK
- Back in the Connection String screen, specify a Call Rate Limit if desired; this is important to avoid throttling by Linked In; because LinkedIn does not publish rate limits, and rates vary depending on the call made, you should look at your application's Analytics page.
- Click OK to create/update the Connection String
Reader
You can create a Job Reader that reads data from LinkedIn. The endpoints you can read from require you to have sufficient permissions as
defined by the Scopes associated with your OAuth 2.0 token. Follow the following steps to read data from LinkedIn:
- In DataZen, select an Agent, and choose New -> Data Sync...
- Select the connection previously created for your Source Connection
- Choose a Quick Setup option to assist with configuration (for example, select LinkedIn Organization Share Statistics)
- Modify the URL as needed (the URL may container a {ID} parameter that should be replaced with your Organization ID)
- Make sure the Apply XML/JSON Transformation is checked
- Make sure the Document Root Path is set appropriately (normally $.elements)
- Verify the paging settings are set appropriately
-
Certain LinkedIn calls require additional headers; click on the Custom HTTP Headers if required
- Certain calls require the use of the X-Restli-Protocol-Version header, set to 2.0.0; see the LinkedIn documentation for more information
- Modify the Max Rows value if desired
- Click the preview link