Retrieve thumbnails for Linkedin Video Post (ugcPost API) - linkedin

I try to retrieve a thumbnails for a Video Post with the ugcPost api without any success.
I retrieve always an empty array for thumbnails.
Regarding the doc Retrieve UGC Posts, like the sample response:
"com.linkedin.ugc.ShareContent": {
"media": [
{
"media": "urn:li:digitalmediaAsset:123ABDEFHAG",
"status": "READY",
"thumbnails": []
}
],
Any idea about how to retrieve a thumbnails with some projection or using the digitalmediaAsset urn?
EDIT: I've already tried this https://stackoverflow.com/a/58401470/2270041 without any success

According to the docs this is not possible, simply stating
Video thumbnails are not retrievable.

Related

Thumbnails not showing up after creating a post via linkedin API call

Thumbnails from external urls are not loading. However, the post inspector tool loads it just fine.
Page I used to perform some tests: https://www.cnbc.com/2022/10/28/more-than-40percent-of-us-households-will-owe-no-federal-income-tax-for-2022.html
Things I've tried so far:
Add an extra parameter at the end of the url in order to clear linkedin cache.
Post Inspector Tool
I did some research but I wasn't successful on finding a solution.
I created a post using different links like youtube and stackoverflow. Thumbnails didn't show up either.
I made sure each page has those required meta(open graph) tags that allows the crawler to retrieve information.
Here's an example of one of those API requests I've been calling to(I got this from the docs):
`
{
"author": "urn:li:person:{ID}",
"lifecycleState": "PUBLISHED",
"specificContent": {
"com.linkedin.ugc.ShareContent": {
"shareCommentary": {
"text": "Learning more about LinkedIn by reading the LinkedIn Blog!"
},
"shareMediaCategory": "ARTICLE",
"media": [
{
"status": "READY",
"description": {
"text": "Official LinkedIn Blog - Your source for insights and information about LinkedIn."
},
"originalUrl": "https://www.cnbc.com/2022/10/28/more-than-40percent-of-us-households-will-owe-no-federal-income-tax-for-2022.html",
"title": {
"text": "Official LinkedIn Blog"
}
}
]
}
},
"visibility": {
"com.linkedin.ugc.MemberNetworkVisibility": "PUBLIC"
}
}
`
In the Share Media object, you're missing the media attribute. It accepts LinkedIn URN so you'll need to upload the image. Personally, I'm not using that attribute but thumbnails that accepts image url. I don't see it in the docs anymore so something might have been changed. At least it's still working for me and I haven't seen it deprecated in the changelog yet. Be careful with the image requirements as well. It accepts an image url with this signature
{
...,
"thumbnails": [{
"url": "https://image-url.com"
}]
}

Frontity Woocommerce

I am new to the use of Frontity, but I do have a few questions, I hope this is the right place for it!.
Can someone explain me how to :
List products with Frontity.
Show variable products with Frontity
The use of REST API in Frontity.
Here is where you put in the API - its basically just your website URL plus wp-json.
"name": "#frontity/wp-source",
"state": {
"source": {
"api": "https://test.frontity.org/wp-json"
}

Using the LinkedIn API to update a profile header/background image

I am pretty new to the LinkedIn API. Does anyone know if there is a way to access a users profile header image/background image through the LinkedIn API? I have looked through the documentation and I cannot find it.
Also, if anyone has a good ASP.NET package that is built to work with LinkedIn so I don't have build the plumbing - would also love a recco.
Thanks.
JJO
linkedin
I found API documentation in https://learn.microsoft.com/en-us/linkedin/shared/integrations/people/profile-edit-api?context=linkedin/compliance/context#background-picture
Unfortunately, it's a complex process with 3 stes:
Register the background picture image to be uploaded.
1.1 POST https://api.linkedin.com/v2/assets?action=registerUpload
{
"registerUploadRequest": {
"recipes": [
"urn:li:digitalmediaRecipe:profile-originalbackground-image"
],
"owner": "urn:li:person:ABCDEF",
"serviceRelationships": []
}
}
1.2 POST https://api.linkedin.com/v2/assets?action=registerUpload
{
"registerUploadRequest": {
"recipes": [
"urn:li:digitalmediaRecipe:profile-displaybackground-image"
],
"owner": "urn:li:person:ABCDEF",
"serviceRelationships": []
}
}
Upload the background picture image to LinkedIn.
curl -i --upload-file /Users/peter/Desktop/superneatimage.png --header "Authorization: Bearer redacted" 'https://api.linkedin.com/mediaUpload/C5616AQEoeGkp7U5GEA/profile-uploadedBackgroundImage/0?ca=vector_profile&cn=uploads&m=AQIdKBw1WIgAWwAAAWhdlwvlhH13JEO0ZxBHb2VRuyAILbzD_VgJ-4UyLg&app=5480656&sync=0&v=beta&ut=1SpRkaq8G5DoA1'
Update the member's profile.
Use the asset from Step 1 to update the profile with the new background picture.
{
"patch": {
"backgroundPicture": {
"$set": {
"originalImage": "urn:li:digitalmediaAsset:C5604AQEMWf4Nl_mf2g",
"displayImage": "urn:li:digitalmediaAsset:C5616AQEoeGkp7U5GEA"
}
}
}
}

Create UGC Post with Video Asset with LinkedIn V2 API

I'm trying to create a UGC post with video asset. I'm able to upload the video and get the media id. but when I'm trying to create the UGC post with the media id, I'm getting a permission error:
urn:li:developerApplication: does not have permission to create ugc posts
Although I am able to create UGC post with an image without any errors.
api url: https://api.linkedin.com/v2/ugcPosts
request budy:
{
"author":"urn:li:organization:",
"lifecycleState":"PUBLISHED",
"specificContent":{
"com.linkedin.ugc.ShareContent":{
"media":[
{
"description":
{
"attributes":[],
"text":"Testing video upload."
},
"media":"urn:li:digitalmediaAsset:",
"status":"READY",
"thumbnails":[],
"title":
{
"attributes":[],
"text":""
}
}
],
"shareCommentary":{
"attributes":[],
"text":"Testing video upload."
},
"shareMediaCategory":"VIDEO"
}
},
"targetAudience":{
"targetedEntities":[]
},
"visibility":{
"com.linkedin.ugc.MemberNetworkVisibility":"PUBLIC"
}
}
Apparently only a few / whitelisted apps can create video UGC posts: https://stackoverflow.com/a/54934631/7844946

Sharing dymanically changing image in Linked IN using meta tag og:image is not working

Below is Our Requirement:
Sharing the dynamically changing content of a page in Linked IN (URL, title, summary and image).
Problem Statement:
1. All other content except Image is getting shared in Linked IN
Approach 1: Using Linked In Share URL
<a target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&url=<<OUR URL>>&title=<<Our TITLE>>&summary=<<OUR SUMMARY>>">Share</a>
Issue:
1. The URL above doesn’t have the parameter to pass the image like title, summary etc.It is fetching the image from meta tag content which is having the property as “og:image” in the page
<meta property="og:image" content="<<IMAGE URL>>">enter code here
Since the image is changed dynamically in the page, we tried dynamically changing the content of this meta tag using jQuery. But when the new share window is opened it is trying to fetch the default image available in meta tag and not the one set using jQuery.
Approach 2: Using AJAX Post Submit Action
function shareOnLinkedInTest() {
var dataJson= {"share": {
"comment": "Posting from the API using XML",
"content": {
"title": "A title for your share",
"submitted-url": "http://developer.linkedin.com",
"submitted-image-url":
"ImageURL",
},
"visibility": { "code": "anyone" }
}};
$.ajax({
type: 'POST',
crossDomain : true,
contentType: "application/json",
dataType:"jsonp",
jsonp: 'jsonp-callback',
url: "https://api.linkedin.com/v1/people/~/shares?format=json",
data:dataJson,
success: function(data) {
alert("it works>>>>>>>>>>>>>>"+data);
},
error : function (xhr, ajaxOptions, thrownError){
alert("error");
console.log(xhr);
console.log(thrownError);
}
}); }
Issue:
This is throwing 401 –Unauthorized exception as there is no option to enter the user credentials in the above script while sharing the content
It has been observed while going through various reference sites that Linked In is having cache issue while sharing the content.
https://www.wix.com/support/html5/ugc/e828aa26-d50b-4e5a-a982-ff563ca7e3dd/061f3e24-55e1-418d-ab65-9d6b0457b863
Getting old image while sharing page in LinkedIn
Can anyone help on this please????
Thanks In Advance,
Saritha
LinkedIn's crawler does not execute in-page Javascript, so if you are relying on client-side code to set the value of the meta tags, it will not be picked up when LinkedIn grabs the page for sharing. The value has to be rendered into the page statically (and if it has to be a dynamic value, that would have to be chosen at the back-end and rendered into the page).
Regarding your second approach, you have to authenticate a user before you attempt to post a share, which is why you're getting a 401 Unauthorized error when you try. There's more information about making an authenticated REST API call available at https://developer.linkedin.com/docs/rest-api

Resources