jriggins
jriggins

Reputation: 688

How to Get Description Field to Display with LinkedIn Share API

When I post this JSON to the Share API:

{
  "comment": "Here is my comment",
  "content": {
    "title": "Here is my title",
    "description": "Description:  The picture will be of a blue and gold macaw",
    "submitted-url": "https://en.wikipedia.org/wiki/Macaw",  
    "submitted-image-url": "http://yourshot.nationalgeographic.com/u/ss/fQYSUbVfts-T7pS2VP2wnKyN8wxywmXtY0-FwsgxoJBD4C1qJrqA8EfaP7jL8gZYg0MJlb9NNBxrHhmaSdwF/"
  },
  "visibility": {
    "code": "anyone"
  }  
}

I see this in the Activity:

enter image description here

What I don't see is the content in the description field. I did not write our original integration to this, but my project manager claims that the LinkedIn UI originally showed these descriptions. Has something changed? Are we doing something wrong?

UPDATE:

I just noticed a similar question here:

Share On LinkedIn Description field not displayed in new UI

I'm actually not sure what I should do from an SO perspective since I provided extra content that I think would be helpful in identifying the problem.

Upvotes: 18

Views: 3441

Answers (3)

user14383954
user14383954

Reputation: 1

It´s all about the size of the image. If it´s large, LinkedIn shows only the image (it becomes an image sharing). If it´s tiny, LinkedIn creates an actual article share, with a kind of card, with the text and image like an icon. the linkedin card

Upvotes: 0

HoldOffHunger
HoldOffHunger

Reputation: 20948

I have spent two weeks talking with the LinkedIn support staff and developers about this problem. Oh the humanity... Succinct summary...

  • If you have an image defined (using og:image or API), then no description will display in share preview.
  • If you have no image defined (using og:image or API), but you have a description defined (using og:description tag or API), then description will display in share preview.

Easiest way to test? GitHub has an og:image tag, but Wikipedia does not have an og:image tag. What do they look like in social sharing in LinkedIn?

Wikipedia: No og:image tag, but og:description displays.
GitHub: Yes og:image tag, but no og:description displays.

I also went through the hassle of making a super simple demo to test this hypothesis...

Working LinkedIn Share Link Demo Without og:image Tags:

<HTML><HEAD>
    <meta property="og:title" content="LinkedIn Share URL Test">
    <meta property="og:description" content="Testing description!">
    <meta property='og:url' content="https://www.revoltlib.com/linkedin-social-share-url-test.html"/>
</HEAD><BODY>This page has no og:image tag.</BODY></HTML>

You shouldn't need to have trouble finding a site with og:image tags, basically every site seems to have it!

After thorough testing, it seems to check out! I'm well aware that the Official Microsoft LinkedIn Share Documentation makes no mention whatsoever of this, but all of the real evidence seems to point in the opposite direction.

Upvotes: 12

Zolt&#225;n
Zolt&#225;n

Reputation: 144

What I found out playing with the api is that the description field is only shown if an image is not provided. While you can ommit the submitted-image-url property the linkedin crawler will place an image to the post if it finds in the meta of the page.

With this api call:

{
  "comment": "Here is my comment",
  "content": {
    "title": "Here is my title",
    "description": "Description:  The picture will be of a blue and gold macaw",
    "submitted-url": "https://developer.microsoft.com/hu-hu/"
  },
  "visibility": {
    "code": "anyone"
  }  
}

I could produce this post: linkedin post with description

Honestly I think this is a bug in there renderer.

Upvotes: 1

Related Questions