Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

179
Views
Show Preview of Images or Video from Links embedded within a Text on LinkedIn

I am working with the LinkedIn Shares API and I use the below code to share content to LinkedIn. The problem is that if the text contains a video link or image link, LinkedIn doesn't know how to grab the Link from the text and show a Preview of the image or video.

E.g imagine the text says

Hello world and has an embedded YouTube Link Like this and more text here

How can I make LinkedIn pick up the YouTube link from the text and preview it?

Here is my code:

let postUrl = `https://api.linkedin.com/v2/shares`;
let headers = {
    'Authorization': `Bearer ${access_token}`,
    'X-Restli-Protocol-Version': '2.0.0'
};
let requestBody = {
    text: {
        text: `Hello world and has an embedded  **[YouTube Link Like this][1]** and more text here`
    },
    "distribution": {
        "linkedInDistributionTarget": {}
    },
    owner: `urn:li:organization:${organization.id}`
};
let pagePostResponse = await axios.post(postUrl, requestBody, {
    headers: headers
});
//The content gets posted successfully to LinkedIn but the youtube link preview is not showing

Thank you

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!