Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LinkedIn Share Post URL

Tags:

linkedin

I have an app that lets people post content to their LinkedIn page. What I want to do is create a button that I can include in an email that when clicked, will send the user to LinkedIn and open the box to share a post. What I would like to know is how to generate this url. What is the structure like? All the information I've found so far is about how to share a link to another website on LinkedIn, not how to direct a user to the share post box.

Example link: https://www.linkedin.com/share?id=0123456789

linkedin

like image 247
Daniel Bonnell Avatar asked Oct 29 '15 23:10

Daniel Bonnell


People also ask

How can I get the URL of a LinkedIn Post?

Now, if you're wondering how to copy your LinkedIn profile link, it is quite easy. Just highlight (select) the web link in your web browser, copy the entire URL, and paste it on your resume or other digital touchpoints.

Can you share a link in a LinkedIn post?

To share an article or a link from your homepage: Click Start a post. Paste the link or type the URL into the text field. Allow a few seconds for a preview image to display (image frame is a 1.91:1 ratio and 1200 (w) x 627 (h) pixels).

How do I share a short LinkedIn URL?

When you share a link that's longer than 26 characters, we automatically shorten it once you click Post, to make it easier to read. You can add text to your post either before or after the URL. If you're sharing an article and there's no text after the link, the URL will be hidden from the share.


1 Answers

First step, let's see what URL is right...

2010:

https://www.linkedin.com/cws/share?url={url} 

2015:

https://www.linkedin.com/shareArticle?url={url}&title={title}&summary={text}&source={provider} 

2020:

https://www.linkedin.com/sharing/share-offsite/?url={url} 

Official Microsoft LinkedIn Share API Documentation. Of course, don't take our word for it! Any of the above URL formats will redirect to the 2020 URL format.

Second step, just how do you use things like `summary`, `title`, etc.?

Use og: tags in the <head> block of your HTML! To quote the documentation, these should look like...

  • <meta property='og:title' content='Title of the article'/>
  • <meta property='og:image' content='//media.example.com/ 1234567.jpg'/>
  • <meta property='og:description' content='Description that will show in the preview'/>
  • <meta property='og:url' content='//www.example.com/URL of the article' />

Source: LinkedIn Share Documentation: Making Your Website Shareable on LinkedIn

Third step, now want to check to see you did everything right?

That's the easy part! Take the URL you are sharing (i.e., example.com, not linkedin.com?share=example.com), and input it into the LinkedIn Post Inspector. You will be told everything that goes into determining how your webpage is shared on LinkedIn, from og: tags to oEmbed data.

Here's an online demo with share links to 20+ services. Check the source code and you can see first-hand how the share link for Linkedin works!

Fourth step, why doesn't the `og:description` tag work?

I have a more detailed answer elsewhere on the og:description tag not displaying in the LinkedIn preview.

If you are interested in a regularly maintained GitHub project that keeps track of this so you don't have to, check it out! I'm a contributor! Social Share URLs

Social Share URLs Image

like image 106
HoldOffHunger Avatar answered Sep 20 '22 14:09

HoldOffHunger