Friday, October 08, 2021

[LinkedIn API] Accessing the LinkedIn API ... or not

Wow, "Saturday, July 20, 2019" was a while ago. Nevertheless, here we are again writing about code.

I'm trying, totally unsuccessfully at this point, to talk to the LinkedIn API. There's copious documentation but something isn't connecting up in my mind and I'm having an IJDGI (I just don't get it) moment.

I've followed the process listed at https://docs.microsoft.com/en-us/linkedin/shared/authentication/client-credentials-flow?context=linkedin/compliance/context insofar as I have created an app and had it verified.

At the moment I'm in Visual Studio Code (VSC) and using the RestClient tool to do two-legged OAuth:

POST /oauth/v2/accessToken HTTP/1.1
Host: www.linkedin.com
Content-Type: application/x-www-form-urlencoded

grant_type=client_credentials&client_id=xxxxxxxxxx&client_secret=zyxwvutsrqponm

(client_id and client_secret obfuscated)

The rather long-winded response I'm getting from that request ends with
{ "error": "access_denied", "error_description": "This application is not allowed to create application tokens" }

LATER

This project may well come under what LinkedIn calls an "Unapproved Use Case" as their site says,
Unapproved Use Cases
Additional use cases we do not permit:

No Social Feeds: Under our MDP Terms, none of the data provided via our 
Page Management APIs can be used in a social feed use case (e.g. to display 
a feed of LinkedIn company updates on the company’s website or intranet).

Hmm... 

I've also asked for help on RedditDEV and StackOverflow. I expect they'll tell me it's unapproved.