Reputation: 41
I contacted Linkedin for support on this and they suggested posting here. So asking with #linkedin developers in the market.
My issues is with the Linkedin Rest API. The API is: https://api.linkedin.com/v2/ugcPosts You can find more about the API here: https://learn.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/share-on-linkedin
I am using the request as shown in the sample below:
{
"author": "urn:li:person:8675309",
"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://blog.linkedin.com/",
"title": {
"text": "Official LinkedIn Blog"
}
}
]
}[enter image description here][1]
},
"visibility": {
"com.linkedin.ugc.MemberNetworkVisibility": "PUBLIC"
}
}
Everything was working before the Linkedin API recent updates and I was passing my article link in the "originalUrl" key in the above request and it was generating the correct preview as shown in the attachment named: old_correct_preview.png
But now the preview of the url is not generating when posting on Linkedin as you can see in the attached image: current_wrong_preview.png I checked the URL in the Linkedin post inspector tool also and over there it is generating the correct preview as you can see in the attached image: post-preview-in-linkedin-post-inspector.png
I don't think it is the browser issue as it is happening on Linkedin itself.
Also note that on directly posting Link through Linkedin the correct preview is generating but it is only getting issues when I am using the API. The sample url with which the issue came while posting through API is: https://chetu.ctnt.co/video/112/ah-290-376-l
I have created two videos of the issue.
You can check them here:
enter image description here current wrong preview image
enter image description here Old correct preview image
enter image description here linkedin post preview image
Upvotes: 4
Views: 1753
Reputation: 31
I reached out to LinkedIn about this issue and specifically pointed out this post along with another similar post and this is the response they got back to me with. I followed what they mentioned to do and it's now working for me as well. I'm just going to paste in their reply to me and hopefully, you can follow the same steps to fix your code.
Apologies for the delay in our response. We are currently experiencing higher than expected support volume. I'm curious if the issues you are seeing from the API-created shares are from a recent change we made to article-type posts. https://learn.microsoft.com/en-us/linkedin/marketing/integrations/recent-changes#page-management
What’s happening: Starting May 31, 2021, for article type posts the description, title, and thumbnail will be set from LinkedIn’s URL Preview of the URL only if the description, title, and thumbnail are not provided from the API call. Prior to this change, each field was set from LinkedIn’s URL Preview if the specific field was not set. If a specific representation of the post is desired, set the description, title, or thumbnail fields, rather than rely on automatic preview. Use the Post Inspector tool to determine what the LinkedIn URL Preview looks like.
To summarize, because you are still passing some of the fields, we are not scraping the image. So if you remove all the fields except the link to be scraped from your call you should see that the image, title, and description are all scraped. So it's basically an all-or-nothing thing with scraping now, you either provide all the information or none of it and let our scraper do the rest. Can you try to only pass the URL and let me know if that resolves the issue for you?
Upvotes: 3