Implementing Linkedin Share API

北慕城南 提交于 2021-01-28 21:10:49

问题


I am trying to use linkedin API for sharing my web site post on linkedIn.

While making an rest api call to linkedin, I am gettting below error:

{ "errorCode": 0, "message": "Invalid arguments: {S_400_BAD_REQUEST=Bad request}", "status": 400, }

I am getting invalid arguments error. However, I am passing all the required arguments as described in LinkedIn documentation.

Please help if anyone faced and resolved above error.

Thanks!!


回答1:


I ditched the rest api and used the js api, it was much easier. I coded almost exactly what you are trying to code, so it could help you greatly. You can find it here: https://github.com/kaburkett/LinkedIn-Advanced-Share




回答2:


To share on LinkedIn, all you need is:

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

Source: Microsoft LinkedIn Share URL Documentation.

For example, this works for me:

https://www.linkedin.com/sharing/share-offsite/?url=http://www.wikipedia.org/

Works fine:

Just make your own button, stylize it, and hyperlink it. No need for a plugin or SDK or jslib bundle or whatever.

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



来源:https://stackoverflow.com/questions/35561578/implementing-linkedin-share-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!