1
votes

I am making a call to the linkedin v2 api to share a link (an article) and it works fine in the post inspector (image thumbnail is shown) but when I use the api the thumbnail is not displayed.

The documentation says LinkedIn will automatically fetch the thumbnail from the meta og:image tag....which I have.

https://docs.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/share-api#controlling-how-share-content-is-displayed

Controlling How Share Content is Displayed If you're unable to provide a complete share with all metadata, LinkedIn fetches the content directly from the page. To best facilitate this, set [Open Graph tags][http://ogp.me/] if you have control over the published content that's being shared.

TABLE 11 Tag Description og:title Set the title tag to control how your web page's title displays on LinkedIn. og:description Set the description tag to control how the shared link is described on LinkedIn. og:image Set the image tag to control which image is displayed on LinkedIn. og:url The URL tag is recommended to provide the best URL link for LinkedIn to use to point to your web page. If you're unable to set Open Graph tags within the page that's being shared, LinkedIn attempts to fetch the content automatically by determining the title, description, thumbnail image, etc.

Does anyone know how to get the thumbnail to show up via the v2 share api?

2

2 Answers

1
votes

This is a bug at LinkedIn on one of their views. This is affecting everyone.

If you view the post when not logged in, the preview should show up just fine. This hints that the "logged in" view does not grab the external preview image.

If possible, report this to LinkedIn.

If you have to get this done before LinkedIn figures out that the bug is on your side, then I think there is a way:

You can get around this by writing code that provides the image with the post. You would scrape HTML for the OG image tag. Then you would pull that image from the OG tag, and then upload it to the user's media. You can then provide the image id to the post.

0
votes

If you have the og: tag working, then it definitely should be working. Source: Official LinkedIn Shareable Documentation.

They state some limitations, but, I don't see your image, so, I'm not sure how to point out anything specific, but generally, according to the linked docs above...

  • Max file size: 5 MB
  • Minimum image dimensions: 1200 (w) x 627 (h) pixels
  • Recommended ratio: 1.91:1

If you're not sure, check out the LinkedIn Post Inspector with the URL you are trying to share. I have found that there is actually other meta data that LinkedIn considers sometimes more important: for instance, I have seen it looking at oEmbed data, which few people are aware is installed on their servers.

I know for a fact it works for me. Tested just today:

Hope this helps!