feat: LinkedIn - move to v2 API calls, drop the advertising API requirement #463
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The LinkedIn Advertising API requirement is challenging, because it requires manual review and approval of the app by LinkedIn.
The only reason for the LinkedIn Advertising API is to be able to read r_basicprofile - which is typically used to view other people's profiles. Postiz only needs to view the currently logged in user, and accessing /v2/userinfo is a better way of doing this, ad /v2/me is a legacy API call.
This change removes the calls to /v2/me, and just uses the /v2/userinfo call, which means we can drop the LinkedIn Advertising API requirement - making it much easier for users to add LinkedIn support in postiz (including me!).
I have tested this on my own LinkedIn account, and posting is working just fine.
I see that there is a company() function, but I don't see this actually being used at the moment.
I originally raised #428 to discuss this, but I think a PR would be easier to discuss.