Publishing multiple images on restFb - facebook graph api 2.5

1,062 views
Skip to first unread message

Uros Gepek

unread,
Dec 14, 2015, 3:18:47 AM12/14/15
to RestFB
Hey

I am trying to use this function to publish multiple images on facebook, but it doesnt work, everytime only first image is posted on page feed.

Performs a Graph API publish operation on the given connection and includes some files - photos, for example - in the publish request, and mapping the result to an instance of objectType.
Parameters:
<T> Java type to map to.
connection The Connection to publish to.
objectType Object type token.
binaryAttachments The files to include in the publish request.
parameters URL parameters to include in the API call.
Returns:
An instance of type objectType which contains the Facebook response to your publish request.
Throws:
FacebookException - If an error occurs while performing the API call.


I have underlined, this contains List of binary attachments, so i am unsure why this is not working, it only posts first image in the list.. Any help if this is not possible, or how to post multiple images on facebook page feed then ?

Thanks

Uros Gepek

unread,
Dec 14, 2015, 3:24:31 AM12/14/15
to RestFB
Is it due to this ? the Graph API supports only the upload of *one* photo in *one* call. 

Why rest facebook the supports uploading list of binary attachments if api doesnt support it ?

Is there any other way to make a feed post that conatins multiple images ? Like when you post directly through facebook..

Norbert Bartels

unread,
Dec 17, 2015, 7:48:43 AM12/17/15
to RestFB

Open Graph Stories support multiple images, so we have to allow the user to use this feature, but because RestFB is a rather low level API we expect the user to know what he does with the API. And therefore it is necessary to know the special features of Facebook.

We have the intention to provide a FAQ section and a Cookbook on the restfb website. But this is a dream of the future :-)

Uros Gepek

unread,
Dec 22, 2015, 2:40:38 AM12/22/15
to RestFB
I understand Norbert.

Thanks for your answer, i have been using Fb api for quite some time, and restfb as well. I dont think open graph stories can be used with pages when posting so i have implemented only support for single image for now. There is another way that i have found, but there are other limitations to it(and it also doesnt show the same way when u do it on facebook), like uploading images to a new album and then sharing only their id in a post, but returned real time update contains this as "different type which i dont want due to other problems.
Reply all
Reply to author
Forward
0 new messages