publish video facebook wall graph api - php

I have developed an application for facebook. I want to post a video on the users wall using the graph API. What can I do to publish video on facebook wall?

Recently i have to do the same thing and to do it is very simple.
The parameters you must use are:
source = urlencode ( url/to/swf )
link = url/to/web
picture = url/to/picture
And no more, so if you use the graph api you the url will be like:
https://graph.facebook.com/userID/feed?access_token=&source=urlencode
(url/to/swf)&picture=url/to/picture&link=url/to/web
Hope it will help.

As of April 2011, Facebook has added the ability to upload videos through the new graph API:
http://developers.facebook.com/blog/post/493/

Related

Upload video to facebook with php api v2.5

I am trying to allow user to share video on my website to their facebook.
$data = [
'title' => urldecode($_GET['c']),
'description' => urldecode($_GET['t']),
'source' => $fb->videoToUpload('video/video_1mb.mp4'),
];
$response = $fb->post('/me/videos', $data, $accessToken);
Above is the php code I used to post the video to their facebook. It works but I have some questions:
I have some description and links (in the description) wants to share with the video to facebook. As facebook is not allowed to prefill sharing message in the post, how can I add description and links? I want the description and links show below the video. Just like sharing a youtube video to facebook. When you play the youtube video on facebook, there is some text below the video. Can I do the same things for facebook video?
I know you can add a link at the end of the facebook video on facebook page. Can I do the same thing if I am sharing to personal account not page?
I can get the like counter after getting the user login of their facebook account. But can I get the number of video view as well? I saw there is a insight but is it only working for facebook page?
Thanks,
Alex
I finally change the whole way I did.
I upload the video to facebook page as admin role
I share the video post on the facebook page to personal wall
I found some reference to do #1
This show how to upload video to facebook page as admin. However, the access token he said is not permanent.
How to publish a post on a Facebook Fan Page as Page Owner or Admin in Graph API
This show you how to get a permanent access token for the page (this is a long steps for me!)
facebook: permanent Page Access Token?
After you posted the video to facebook page, it will return you a post id. The video on the facebook page has a permanent link like this:
https://www.facebook.com/{FACEBOOK_PAGE_ID}/videos/{POST_ID_FROM_THE_RETURN}
Now, you can share this link to your personal account using the facebook dialog or api if you want.
This make you able to upload video to facebook with description (and you can also add some links in the description if you want) without banned by the facebook prefill policy. And I think I can now add the "call to action" button to the end of the video and use the facebook page insight to check the view count.

Is it possible to get the number of facebook video views using facebook graph API

I have Looked at the facebook graph api reference for videos (https://developers.facebook.com/docs/graph-api/reference/video) But I currently don't see any way of getting the number of facebook video views. Is it possible to get the number of facebook video views using this api or any other walkaround?
You can use the insights edge to retrieve video views.

Upload photo to facebook using Rest API

Can you please have a look to this URL
http://developers.facebook.com/docs/reference/rest/photos.upload/
I need to have a working example, how can I use this api to upload a photo to my facebook profile.
Actually I have a php site from where I want to allow users to upload photo to their facebook profile.
Thank you
The link you posted refers to an outdated approach to FB API. It's better to use the Graph API in conjunction with the latest PHP SDK.
http://developers.facebook.com/docs/reference/api/
https://github.com/facebook/php-sdk
here's a reference to the photo object methods
http://developers.facebook.com/docs/reference/api/photo/
Here's a fairly recent example from the facebook developers blog:
http://developers.facebook.com/blog/post/498/

Facebook Graph API with PHP connection

i want to display facebook friends on my website and i want to use facebook graph api for that,
please
Thanks
Prakash
Facebook Graph API with PHP connection
This tutorial might help: Facebook PHP SDK
It includes example as well.
Generate an access token for yourself by going to https://developers.facebook.com/tools/explorer and then you may be able to retrieve your friends by accessing https://graph.facebook.com/_YOUR_USER_ID_/friends?access_token=xx and then the profile images can be retrieved using the following graph API call - https://graph.facebook.com/_FRIEND_PROFILE_ID_/picture?type=square
Of course, for more details, the Facebook Documentation (https://developers.facebook.com/docs/) is where you go to.

Facebook API - webcam FBML

What is the FBML tag or any other option (I mean in API) to take photo from a webcam in Facebook (and next upload it to my profile)? I can see such an option in my profile, but I don't know how to use it in Facebook app.
There is no such option (as far as I know). In any case FBML will be deprecated on June 6, 2012. You will have to look into the video API https://developers.facebook.com/docs/reference/api/user/#videos.
There are examples on the Facebook Developers' blog of how to achieve this
Using the Graph API to upload Video
Uploading Videos to an Application, Group, or Page via the Graph API

Categories