0

I am sharing my page "www.mysite.com/detail/?v=2442411" to linkedIn but I just get a "Oops" on linkedIn.

In code I have it like this:

string LinkedIn = $"https://www.linkedin.com/shareArticle?mini=true&url={mysiteurlvariable}?v={myidvariable}&title=ThisTitle"

It spits out this link: https://www.linkedin.com/shareArticle/?mini=true&url=www.mysite.com/detail/?v=2442411&title=ThisTitle

When following the link as I say I just get a oops from LinkedIn. Although when replacing the url with any other url also without a parameter its fine.

It seems like it does not like the ?v={myidvatiable} part

Anyone know of this issue or why this is an issue

user1702369
  • 1,089
  • 2
  • 13
  • 31

1 Answers1

0

You need to do URL-encoding with parameters you are feeding to another URL. And also, since you have posted your question, the LinkedIn Share URL parameters have changed. Source: Official Microsoft LinkedIn Share URL Documentation.

So, this is what you should want...

https://www.linkedin.com/sharing/share-offsite/?url={mysiteurlvariable}%3Fv%3D%7Bmyidvariable%7D%26title%3DThisTitle%22

Hope this helps!

HoldOffHunger
  • 18,769
  • 10
  • 104
  • 133