How to upload video and images to LinkedIn via REST API? - rest

We are developing an application in which user uploads the content and media in the form of image/video. The media gets stored in Azure. As mentioned in the share API, we are just passing the link as a part of the comment. Although the image is visible, it is seen as a link, which on clicked opens in another window.
In case of video, no preview is visible. It is seen just as a link.
The API we are using is:
https://api.linkedin.com/v1/people/~/shares
Is there any other API for this which is part of Partner Program?

You don't need to use any Partner Program
Image uploading you need to put
"title" => "your title",
"submitted-url" => 'your website url'
"submitted-image-url" => 'your image full http path'
so you can see images from submitted-image-url and submitted-url can be your website url that is compulsory so this way your url will not open popup image
Video uploading you need to create a dynamic page on you site there will some meta tags for url and img like og:url, og:img ...
and html video tag there in src you can put video url..
"title" => "your title",
"submitted-url" => 'dynamic created url with ids or timestamp for remove caching'
if meta is perfect on you page then from meta image will show as a preview in linkedin and when you click on image then your website page will open where you already have html video tag
so on your page video page video will play
you can create meta tags and page like buffer
https://video.buffer.com/v/5a82df3df78c53d21249f680
Thanks

Related

How could i post an image in Facebook feed dialog

I've been using Facebook's Feed Dialog to let users on a site share content on their Facebook feed. On their feed there would be a picture that serves as a link to the page on my site, with some text below it like name, caption and description fields. All of these - picture, name, caption and description are now deprecated and stop working now :( Is there any other way to achieve this functionality using a different method, i've proved the quote parameter but I don't like it.
You cannot post pictures on user profiles, not with the API and not with the feed dialog. The feed dialog is for sharing URLs, but they can include an image in the og:image tag of the page source. So you just need to add the correct image in the page source, with an absolut path: https://ogp.me/

Codenameone ShareButton - Sharing URL and Image content to Facebook

I have a Codenameone ShareButton in my app, when pressed opens a dialog containing a list of the standard social media apps, that i have on my device, eg. Facebook, SMS, Email, Twitter.
I am trying to get a combination of text, image and URL into the ShareButton dialog for Facebook, but failing. It seems to work for the other types of media. I have scoured StackOverflow without luck on this one.
I can share an image to facebook successfully:
ShareButton sb = new ShareButton();
sb.setImageToShare(imageFile, "image/png");
I can share a URL to facebook successfully:
ShareButton sb = new ShareButton();
sb.setTextToShare("www.mywebsite.co.uk");
My goal is to share a piece of text, a URL and an image to facebook (which i can do to other media). My issues are:
Text wont display in the facebook app dialog:
ShareButton sb = new ShareButton();
sb.setTextToShare("The text i want to display");
I have seen conflicting posts over the years about FB support for this, so maybe i'm doomed on this one.
I tried to trick it and prefix or suffix text to the URL but this didn't display that text still.
So I want to display an image and a URL in the post to FB and it really is just one or the other it seems. So the code below will display just the URL on its own in the FB dialog without the image (swapping out the URL for regular text, displays the image and no text):
ShareButton sb = new ShareButton();
sb.setImageToShare(imageFile, "image/png");
sb.setTextToShare("www.mywebsite.co.uk");
I'd be happy with just option 2 if needs be.
To be clear i'm using the facebook app on my device to share and not a token connection direct to facebook.
And if it helps i do have my own website, if there was a way to send it content and it dynamically build up the content for display, but that may not be possible (i'm no web developer).
As far as I recall from the last time I was dealing with posting to facebook, they don't allow you to post both an image and text, or a URL and text together. If you want to have something show up in the user's feed that includes both an image and a description, you'll need to create a web page that includes Facebook's supported Open Graph markup, which will cause it to be displayed "nicely" in the user's feed.
In projects I have worked on in the past, they used dynamic webpages so that it was easy to create a webpage that was specific to the content you want to post in the user's feed. You can essentially generate a separate webpage for each "share" if necessary.
We used the feed API directly. I'm not sure if it works from the share button, but if you were able to post a URL, then it probably works.

Dynamic URL in Open Graph og:url

I need to publish a MP4 video on Facebook using OpenGraph.
I've created a dynamic page that gets the ID of the video and generates meta tag according to selected id.
If i insert the url like http://site/video/ID inside the Facebook sharing debugger (https://developers.facebook.com/tools/debug/), the video is shared correctly with image preview and video player.
If i put a new id i get "This URL hasn't been shared on Facebook before." and preview does not work.
I don't think it makes sense to force Facebook to crawl for every ID, there must be a better way to do it.
Can anyone help me?

Facebook comment box connected to a certain photo

Im planning to show some facebook album pictures on a remote page. I would like to connect a facebook comment box (http://developers.facebook.com/docs/reference/plugins/comments/) to each photo. What url should i paste in the url attribute on the comment box to connect it with the comments posted on facebook? Thanks
Use the url that will take you directly to the photo itself (ie: http://www.facebook.com/photo.php?fbid=###&set=a.###). You can locate this url by right clicking one of your images in the thumbnail view and opening it in a new tab. Rather than opening it in the standard image viewer, it will open it a new tab by itself.

How to do a Facebook Video Embed Whitelist Request?

I need to post a swf on user wall and it is able to play inside the wall.
I searched the solution for few days and understand that I need to apply a facebook video embed whitelist request in order to do it. However the old request form link doesnt work (http://www.facebook.com/help/contact.php?show_form=video_embed_whitelist).
Anyone can help?
If you try writing something in the Facebook pop-up that comes up and then publish it to feed, the video would play there on the wall itself when the thumbnail is clicked.
If the feed doesn't have a message, the thumbnail becomes a direct link to the SWF itself and opens up in a new window.
You don't need to apply for any whitelist request for this. Any feed story can contain an SWF in it. Please see the Facebook JavaScript SDK for information about what elements you can post within a feed story. One parameter that you can use is the source parameter.
Taken from the documentation :
source:
The URL of a media file (e.g., a SWF or video file) attached
to this post. If both source and picture are specified, only source is
used.
so... for example - you could make a call with these parameters :
var obj = {
method: 'feed',
link: 'http://your_site.com/',
source: 'http://your_site.com/your_swf_movie.swf',
name: 'Publish SWF in feed!',
caption: 'SWF's are cool',
description: 'Here is an SWF file!.'
};
FB.ui(obj);
If your site is in the white list, the swf may play directly on the wall, otherwise it will pop up a new window to play the swf.