Publishing an image without a related URL via the LinkedIn API

為{幸葍}努か 提交于 2019-12-30 06:22:07

问题


The LinkedIn Share API states that:

Post must contain comment and/or (content/title and content/submitted-url).

This is a bit confusing, but the consequence is that our app cannot share an image unless it has an associated "article" URL. To a degree, this makes sense, since it seems that the Share API was intended to be used to share two things: 1) simple text status updates, and 2) articles.

This might be enough information to give up, but it appears that the LinkedIn web interface does, indeed, allow an image to be shared directly, without an associated URL.

Using the web interface:

The result:

Clicking on the image displays the image in a popup (lightbox):

So, my question is: The web client, as I have shown, clearly has the ability to share images without associated links/URLs. Is there a way to accomplish the same thing using the LinkedIn API?

Thanks!


回答1:


I've come to accept the disappointing fact that this is almost certainly just not possible via the API. Boo.




回答2:


You can provide the URL of the image itself as the submitted-url. This makes the link-preview box link to the image. This might not be ideal, but it works to get the image on the post.

However, LinkedIn has strange behavior with these kinds of messages if there are URLs in the comment itself. If there is one URL in the comment, LinkedIn will remove the URL. If there is more than one URL, LinkedIn will display all URLs in the comment. One of these two behaviors is a bug, I suspect.

Here's an image of what a post looks like when submitted-image-url and submitted-url are the same:



来源:https://stackoverflow.com/questions/22340483/publishing-an-image-without-a-related-url-via-the-linkedin-api

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