Facebook Graph API - temporary photos and scheduled posts - facebook-graph-api

I am creating a facebook app that posts to a business Page (not a users own feed) and I am uploading photos to go along with my post. I am uploading the photo as opposed to providing a url for fetching.
I also want to schedule these posts up to two months in advance.
In this page of the facebook graph documentation it says "After you upload an unpublished photo, Facebook stores it in a temporary upload state, which means it will remain on Facebook servers for about 24 hours. If you do not publish these photos within 24 hours, we delete them."
Does this mean that I need to publish my photos in order to use them with scheduled posts? ie, if I upload an image and set it to unpublished, but then use it in a scheduled post that is scheduled for 5 days from now, will the photo be deleted before the post is posted?

Related

Facebook Graph Not Getting All Photo Posts

I'm trying to get all posts from a facebook page for the last two years. Access token is my own which has manage_pages, publish_pages, show_page_list.
The posts are there, they're moderately old early 2016, but, graph doesn't bring them back these older ones. They were scheduled posts, visibility=everyone and of 'photo' type. Any query on {page}\feed, {page}\photos, or {page}\posts yields only a couple of posts.
Facebook Insights Screenshot
https://pasteboard.co/Hde6ZWU.png
Graph Explorer Output Screenshot
https://pasteboard.co/Hde7iDP.png
Does anyone know how to enumerate these posts with graph, or know of the reason why graph isn't reporting them using the get/feed and get/photos command?
These aren’t photos, they are posts.
1409847682673697/posts?since=2016-01-01&until=2016-02-01
shows the first post from your dashboard screenshot, “Andrew Smith - Malta”, just fine.
This is a share of a post onto your page only - the “original” is https://www.facebook.com/andrewmsmithart/photos/a.1533059820295875.1073741827.1533035286964995/1648921165376406/ But since that is not a photo uploaded by your page nor has your page tagged in it, naturally it doesn’t show when you request your page’s photos.
The object_id field of your page post refers the actual photo object.

Multiple Photo Uploads on Facebook Page Timeline

I would like to publish more than one photo on Page Timeline, but do not see any way how to manage it. I can publish only one photo on Page Timeline or album.
Is there any chance how to upload multiple photos into Page Post in help with Graph API?
Edit: As found out, not worked successfully, because there were changes. More info here...
This is an old post, and I don't know if this method could work back in 2014, but in 2017 it's working. Unfortunately there's no way to create the post in one FB query, but there's a trick.
Step 1
Batch upload the images in silent mode, which means there will be no post on the timeline, just pure upload.
For this you have to use
'published' => false,
in the parameters, and
/me/photos
as the URL.
Step 2
After each upload FB will give you back the ID of the uploaded image. Grab those into an array:
$resparr[] = $graphNode['id'];
Step 3
After the uploads you will have an array of the image IDs. Let's format them for the FB post:
$phc = 0;
foreach ($resparr as $pid) {
$linkData['attached_media['.$phc.']'] = (object)array('media_fbid'=>$pid);
$phc++;
}
Step 4
Make an other call to the API, but this time the URL should be
/me/feed
This will create a public post which contains the images.
(You need a page access token for this to post onto a page, or a user access token to post your wall.)
More info # Faceook Developers.

accessing videos uploaded to a page via the Graph API

I need to fetch videos uploaded by users to a Facebook Page.
I'd have expected them to show up in https://graph.facebook.com/me/videos/uploaded, but it appears this only covers videos I've uploaded to my profile, not to a page.
The only place I can find that these show up is https://graph.facebook.com/PageName/tagged, but there they're crammed in amongst all the other stuff and I can't filter to find just the authenticated user's uploads to the page.
Is there a way to get only a specific user's video uploads / tags to a page?
OK, if we’re just talking videos posted to the wall here, I guess you could get that info querying the FQL stream table.
Filter it by:
source_id: The ID of the page whose wall the post is on
actor_id: The ID of the user that published the post
type: "128" - Video posted
Information about the video should be in the attachment column.

How to assign a past date while uploading a photo via Facebook Graph API, so that it gets placed at the right point in Timeline?

Using the Facebook Graph API, I have been able to upload a photo. It is an old scanned photo. I would now like to modify the timestamp, so that it is shown at the appropriate point in the timeline. Does the API provide a way to do this?
Here is an article that says we can assign past dates to Facebook Timeline Posts - http://www.allfacebook.com/facebook-timeline-timestamp-2011-10 . I want to assign a past date to a photo I uploaded, and I would like to do it via the Graph API. Any leads would be helpful.

Facebook scenario - is this possible?

I'd like to know if the following is possible using Facebook apps:
I'm using the Facebook SDK for .NET and want to create an app that a page will use. The app will take a photograph from a user who happens to visit the page, that photograph should then be sent to one of the page's photo albums.
I've managed to perform this successfully, but only when logged in as the page admin. If I log out of the page admin, log in as my personal Facebook account (as most users of the app will do) then the photograph never gets sent to the pages photo album.
I would like to do all of this when the user uploads the photo, but if it isn't possible I'll need to look into a separate process to actually send the photo's to Facebook, and just store the image on my server until the process runs.
The admin photo album (aka page photo album) is not the same album as non-page admins get to upload to (which is the wall). They are separate buckets all together.
As you mentioned, you can always just upload and store the photos on your server, and then just have a feed item that links over to that image.