LinkedIn Share URL is not populating the message / title
Asked Answered
E

3

8

This is similar to this question

I am trying to build a url that populates a post for someone to share on LinkedIn. Following their guide I am using the url

https://www.linkedin.com/shareArticle
?url=<uriecodedurl>
&mini=true
&title=<uriencodedtitle>
&summary=<uriencodedwords>
&source=<uriencodedwords>

and also &text=hello from another SO Q.

This creates the post alright, but gets redirected and all the queries are removed except url. The share/post then contains the website with the title & summary from the meta tags, but I cannot work out how to pre-populate the text in the post.

So my question is, is it possible to pre-populate a post, and if so, how?

For example, with the twitter sharing url, I can use the &text=words to populate a tweet that the user can edit before posting.

Examinee answered 20/9, 2018 at 11:8 Comment(0)
S
3

if i am correct only the API call can make a comment, https://developer.linkedin.com/docs/share-on-linkedin

with the shareURL people can type a comment but only by pressing the share button on the redirected page. so it cannot be predifened.

https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fwww.css-tricks.com%2F&title=CSS-Tricks&summary=Tips%2C+Tricks%2C+and+Techniques+on+using+Cascading+Style+Sheets.&source=CSS-Tricks

Saboteur answered 20/9, 2018 at 12:28 Comment(1)
so are you saying you have to use the authenticate API then the share API to be able to specify the parameters of the share article?Gillen
B
5

Your URL format for sharing is deprecated and no longer supported by LinkedIn. For now, in 2020, url is the only acceptable GET argument and the following is the accepted share URL format...

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

Source: Official LinkedIn Sharing Documentation.

Question 1: Can you pre-populate the message?

No, there is no way to do that with the share-offsite URL above.

BUT -- if you register an application id with LinkedIn, and configure the LinkedIn Share Plugin (not to be confused with the LinkedIn Share URL), then yes, you will be able to configure texts. But that's an entirely different API and maybe a bit much. If you go that route, it's possible, otherwise, it's not.

The reasoning here should be obvious. Without a registered App_id, LinkedIn is worried about prepopulating harmful messages, whereas once you have an App_id, and you use their API package, then you are a trusted entity using a trusted auth platform, etc..

Question 2: Can you prepopulate the title?

Yes, set the og: tag in the <head> block of your HTML, like so...

  • <meta property='og:title' content='Title of the article"/>

Source: LinkedIn Developer Docs: Making Your Website Shareable on LinkedIn.

Bacchius answered 1/6, 2020 at 17:9 Comment(0)
S
3

if i am correct only the API call can make a comment, https://developer.linkedin.com/docs/share-on-linkedin

with the shareURL people can type a comment but only by pressing the share button on the redirected page. so it cannot be predifened.

https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fwww.css-tricks.com%2F&title=CSS-Tricks&summary=Tips%2C+Tricks%2C+and+Techniques+on+using+Cascading+Style+Sheets.&source=CSS-Tricks

Saboteur answered 20/9, 2018 at 12:28 Comment(1)
so are you saying you have to use the authenticate API then the share API to be able to specify the parameters of the share article?Gillen
B
3

Yes you can prepoulate the text using the updated share url which is https://www.linkedin.com/feed/?shareActive&mini=true&text={text}

Here instead of {text} add your own default text and it will work just fine.For this you do not need to call any API just use the link and it work just fine.you can also add URL in the text like this

https://learn.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/
share-on-linkedin?context=linkedin%2Fconsumer%2Fcontext
Booklover answered 28/4, 2023 at 11:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.