content type id: linkedin_post
field ids:
body - textarea
field_post_id - text
field_thumbnail - text
field_post_date - date(date only)
field_embedded_image - boolean
- Create Linkedin app
- Enable Advertising API on products page
- Add authorized redirect URLs on OAuth 2.0 settings. You can get Drupal redirect URL on the Drupal settings form
/admin/config/services/linkedin
- Go to settings form
/admin/config/services/linkedin - Set required fields.
- Save configurations
- Fetch Access Token
- If token is fetched then you will find Token Expiration Date information on the settings form.
- Create LinkedIn post content type with field ids provided above.
- Run drush command
drush linkedin:company_fetch_all- it will fetch 10 latest posts.
There is a cron job which automatically get a new access token using refresh token.
Also you can configure cron on your server and use drush command: drush linkedin_posts:refresh_token