Skip to content

Conversation

@jamesread
Copy link
Contributor

@jamesread jamesread commented Dec 2, 2024

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.

@vercel
Copy link

vercel bot commented Dec 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
gitroom ⬜️ Ignored (Inspect) Visit Preview Dec 2, 2024 9:25pm
postiz ⬜️ Ignored (Inspect) Visit Preview Dec 2, 2024 9:25pm

@nevo-david
Copy link
Contributor

The main problem I have seen is that without the advertising API, you don't get the refresh token, is it working without in v2?

@jamesread
Copy link
Contributor Author

It looks like you're right; https://learn.microsoft.com/en-us/linkedin/shared/authentication/programmatic-refresh-tokens

Do you mind if I add the extra scope behind a LINKEDIN_SKIP_ADVERTISING_API env (default to not skipping if this isn't set - eg don't break platform.postiz.com).

Copy link

@A1exKH A1exKH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jamesread this PR LGTM.

@nevo-david nevo-david closed this Jan 26, 2025
@nevo-david nevo-david deleted the linkedin-drop-advertising-api branch January 26, 2025 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants