Share video on a page on facebook - php

I want to share a video from my site on a page on facebook, not on my profile.
For Eg: I want to share video on https://www.facebook.com/pages/Opticians/108277472608071
I have a button as post to wall. On clicking it the video should get uploaded on the above mentioned page. I searched a lot for this but I ended in getting only share button which shares the post/video to our profile. How can i share that video on a different page on facebook?
Any Help would be greatly appreciated.

The reference page for this API can be found here. And here is a Facebook Developers blog post related to your problem.
According to this resources Facebook provides graph-video.facebook.com endpoint, that can be used to upload a video to user's wall. You need to perform HTTP POST request to this endpoint passing video file in file POST parameter.

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.

contnet of post is missing when share a post on facebook page itself

I have a website, where i share some content to the Facebook through app and it works well ,there is two situation first when we post content manually on Facebook page, you can share it again with all data. but in second case when you share data through code,anyone can share the content again on Facebook page but the description of post is missing.

Posting an image to a Facebook event wall/feed? Not as a link based update.

I have searched the facebook API documentation and we cannot figure out how to post an image to a Facebook event wall feed.
I have only been able to post a link based update. I do not want to change the cover photo or profile picture, but I do want users to be able to upload an image post to their event wall.
I have had no problem making this work for facebook profiles, groups and pages. Not sure why events would work differently :/
If anyone can show me where in the Facebook API this is possible it would be massively appreciated!
Thanks :)

Posting Videos on Facebook using own buttons, similar to share button

I'm working with facebook integration (API) and stuff and I was wondering if it is possible to post videos on facebook using something similar to the Share button.
I know the share button is depreciated, but it still works... but it pops out a dialog box. I'm trying to figure out how to do something like the share button but not have a popout?
I currently have an input field that I can publish to my facebook stream, but would like to see if I can say upload a video with that input field and click on my own created button and publish on the facebook stream?
Does this question make sense?
Thanks in advance!
EDIT:
I guess something like instagram app and the likes where if you post something to their own streaming, on facebook it'll show a photo too.
You have 2 choices.
If you want to actually upload the video to Facebook you may upload it using the PHP graph API, see this link: http://developers.facebook.com/blog/post/493/
Publish a feed to the user wall with data regarding the video.
You can do this by pushing a post request to me/feed and fill in the picture parameter with the thumbnail of the video and a link to it.
see: http://developers.facebook.com/docs/reference/api/user/ - under posts - create

post on facebook page wall as facebook admin through facebook php api

I would like to post feed to facebook page wall as page admin. I can publish post to facebook wall with publish_stream from fb php api, but it is just as a normal facebook user. May I know how can I do likewise as a page admin (meaning that the post publish from facebook page and not from other fb user on the page wall)? Thank you. It is urgent.
Regards,
Benjamin
Just come across this question. This was a know bug within the Graph API which has now been addressed. There is an additional permission named manage_pages which has been added to the list of extended permissions. If you request this permission as part of your authentication process then you should be up and running.
Further information can be found in the documentation and the bug fix that has been put in place.
it is mentioned here.
If you want to post to Page Wall as Page, use page id in the UID not in the target_id.
Pages can't post to other pages.
If you want to post to Page Wall as Application, use page id in the target_id, and the app id in the UID here

Categories