0

I've written code which work under unversioned version and it uses ugcPosts api to gets Share/UgcPosts. In response I have thumbnails like below:

UgcPosts - https://api.linkedin.com/v2/ugcPosts/{encoded ugcPostUrn|shareUrn}?viewContext=AUTHOR

{
    "author": "urn:li:person:123ABC",
    "contentCertificationRecord": "{\"originCountryCode\":\"us\",\"modifiedAt\":1500590592795,\"spamRestriction\":{\"classifications\":[],\"contentQualityClassifications\":[],\"systemName\":\"MACHINE_SYNC\",\"lowQuality\":false,\"contentClassificationTrackingId\":\"B6A8B437D1D5E59D123455F6DCE5B\",\"contentRelevanceClassifications\":[],\"spam\":false}}",
    "created": {
        "actor": "urn:li:person:123ABC",
        "time": 1500590543962
    },
    "firstPublishedAt": 1500590592702,
    "id": "urn:li:ugcPost:123456",
    "lastModified": {
        "actor": "urn:li:person:123ABC",
        "time": 1500590592806
    },
    "lifecycleState": "PUBLISHED",
    "**specificContent**": {
        "**com.linkedin.ugc.ShareContent**": {
            "**media**": [
                {
                    "media": "urn:li:digitalmediaAsset:123ABDEFHAG",
                    "status": "READY",
                    "**thumbnails**": [/**here i can have some thumbnail **]
                }
            ],
            "shareCommentary": {
                "attributes": [
                    {
                        "length": 35,
                        "start": 66,
                        "value": {
                            "com.linkedin.common.CompanyAttributedEntity": {
                                "company": "urn:li:organization:12345"
                            }
                        }
                    }
                ],
                "text": "Testing a UGC Post!"
            },
            "shareMediaCategory": "VIDEO"
        }
    },
    "versionTag": "2",
    "visibility": {
        "com.linkedin.ugc.MemberNetworkVisibility": "PUBLIC"
    }
}

But now after "migration" I dont see any option to get thumbnails for retriving posts ...

https://api.linkedin.com/rest/posts/{encoded ugcPostUrn|shareUrn}

and example of respone:

{
  "lifecycleState": "PUBLISHED",
  "lastModifiedAt": 1634790968774,
  "visibility": "PUBLIC",
  "publishedAt": 1634790968774,
  "author": "urn:li:organization:5515715",
  "distribution": {
    "feedDistribution": "NONE",
    "thirdPartyDistributionChannels": []
  },
  "content": {
    "media": {
      "id": "**urn:li:video:C5F10AQGKQg_6y2a4sQ**"  - I can see only this, so probably I need to use VideoApi, but if there will be URN:LI:IMAGE ? Then what? How to get thumbnail for URN:LI:Image ?
    }
  },
  "lifecycleStateInfo": {
    "isEditedByAuthor": false
  },
  "isReshareDisabledByAuthor": false,
  "createdAt": 1634790968743,
  "id": "urn:li:ugcPost:6856810298419044352",
  "commentary": "comment on Oct 20",
  "adContext": {
    "dscStatus": "ACTIVE",
    "dscAdType": "VIDEO",
    "isDsc": true,
    "dscAdAccount": "urn:li:sponsoredAccount:520866471"
  }
}

TL:DR :)

How to get thumbnail for urn:li:image ? If I get this in response content from posts, how to get this thumbnail for this type of content. For urn:li:video I guess that I can use VideoApi but for Image ?

I was looking for answer in documentation but without success.

  • Looks like it's impossible https://stackoverflow.com/q/59074851/11825162 – IQbrod Nov 04 '22 at 08:29
  • According to this: https://api.linkedin.com/rest/videos/urn:li:video:C4E10AQGUkQY7trgh-Q you can see in documentation that now in this case probably we can get thumbnails ... But still dont know how to do this with urn:li:image :( – LinkedInNewbie Nov 04 '22 at 09:59

0 Answers0