How to Get Description Field to Display with LinkedIn Share API
Asked Answered
B

3

18

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.

Burnedout answered 30/3, 2017 at 23:47 Comment(1)
Hey, I know this post is four years old by now, but any thoughts on accepting an answer maybe?Ingrid
I
11

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.

Ingrid answered 15/6, 2020 at 14:36 Comment(2)
This is the answer! Very difficult to find this information elsewhere.Duumvir
Thanks i have the same error! Really, love you hahahaErmin
M
1

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.

Mclaren answered 16/1, 2018 at 13:26 Comment(2)
Hello, are you able to add description even the page meta has image? having the same issue as yours :(Brezhnev
As far as I remember I couldn't back then. Haven't tried that for a while.Cinquain
I
0

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

Iila answered 3/10, 2020 at 8:47 Comment(1)
ideally, 138x72Iila

© 2022 - 2024 — McMap. All rights reserved.