How to upload multiple images to one post in facebook via api

坚强是说给别人听的谎言 提交于 2019-12-01 02:46:56

问题


So. I can't make this work and i can't find any solution about this.

Here is my code.

        $result1 = $facebook->batchApi('***********/feed', 'POST', array(
            'attached_files' => $facebook->attachFile($uploads[2]),
        ));
        $result2 = $facebook->batchApi('*********/feed', 'POST', array(
            'attached_files' => $facebook->attachFile($uploads[1]),
        ));
        $res = $facebook->processBatch(array(
            "access_token" => $user_profile['data'][0]['access_token'],
        ));

I'm using facebook-batch-api. It's just simple wrapper for batch requests. Need make post like this https://www.facebook.com/centrMAN/posts/587573351326832


回答1:


You cannot post multiple images to a single feed. (Dosen't make any sense either)

The example link that you've mentioned in simply posting photos, not adding photos to a feed.

So, instead of /feed, simply use the /photos API to get the result.



来源:https://stackoverflow.com/questions/22395998/how-to-upload-multiple-images-to-one-post-in-facebook-via-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!