The LinkedIn platform posts to your companies feed.
- create an company your account can manage
- find your company id (in the url, like , 93841222)
- save this as
LINKEDIN_COMPANY_ID
in your users storage.json
- save this as
- create an app to manage the company page
https://www.linkedin.com/developers/apps/new - add 'share on linkedin' product on your app
- add 'advertising api' product to the app
- this requires a lengthy application form - wait for approval
- on the 'settings' tab of your app
- click the 'verify' button next to the page you want the app to manage
and follow instructions there
- click the 'verify' button next to the page you want the app to manage
- on the 'auth' tab of your app
- copy ClientID and ClientSecret
and save those asFAIRPOST_LINKEDIN_CLIENT_ID
andFAIRPOST_LINKEDIN_CLIENT_SECRET
in your global.env
- add redirect url for your app as set in your .env (http://localhost:8000/callback)
- copy ClientID and ClientSecret
- Add 'linkedin' to your
FEED_PLATFORMS
in your usersstorage.json
This token last for 60 days and should be refreshed. The refresh token (if given) lasts for 1 year.
- call
./fairpost.js @userid setup-platform --platform=linkedin
- follow instructions from the command line
- call
./fairpost.js @userid test-platform --platform=linkedin
One fairpost user can only manage one page. If you create a second user, you can use the same app id to manage a different page. The app is registered on your account, so if you can manage the other page, so can the app.
- call
./fairpost.js create-user --userid=foo
- add linkedin to its FAIRPOST_PLATFORMS
- find your company id (in the url, like , 93841222)
- save this as
LINKEDIN_COMPANY_ID
in your users storage.json
- save this as
- call
./fairpost.js @foo setup-platform --platform=linkedin
- follow instructions from the command line
- call
./fairpost.js @foo test-platform --platform=linkedin
LINKEDIN_PLUGIN_SETTINGS
- a json object describing / overwriting the plugins used to prepare posts
...
...
xxx
https://www.linkedin.com/help/linkedin/answer/a548372
- Maximum file size: 5GB
- Minimum file size: 75KB
- Maximum video duration: 15 minutes when uploading from desktop and 10 minutes when uploading from the LinkedIn mobile app.
- Minimum video duration: 3 seconds
- Resolution range: 256x144 to 4096x2304
- Aspect ratio: 1:2.4 - 2.4:1
- Frame rates: 10fps - 60 fps
- Bit rates: 192 kbps - 30 Mbps
https://www.linkedin.com/advice/1/how-do-you-use-refresh-tokens-different-types-oauth-20-clients client credentials flow
require scopes (r_liteprofile, w_member_social)
https://stackoverflow.com/a/65652798/95733 You need to select an enterprise product, like the Marketing Developer Platform. Go to your app and request access to this product. Your app needs to be reviewed first so this may take some time.
https://learn.microsoft.com/en-us/linkedin/shared/authentication/programmatic-refresh-tokens
LinkedIn supports programmatic refresh tokens for all approved Marketing Developer Platform (MDP) partners. By default, access tokens are valid for 60 days and programmatic refresh tokens are valid for a year.
https://jcergolj.me.uk/publish-linkedin-post-with-video/ (lgc)
get a lease https://learn.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/videos-api?view=li-lms-2023-10&tabs=http#initialize-video-upload OR https://learn.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/vector-asset-api?view=li-lms-2023-10&tabs=http#register-an-upload-for-video