1
votes

I have a PHP app which interacts with facebook. I'm successfully able to post a photo to user wall , uswer timeline and to the wall of a facebook page, but when i try to post the same photo to facebook page timeline it throws an error "invalid appsecret_proof parameter". i commented out the code that tries to set the appsecret_proof in base_facebook.php file and then tried running the app it gave "The user hasn't authorized the application to perform this action" error. i have given 'photo_upload , publish_stream , publish_actions , manage_pages , user_photos' permissions to the app . i have set the access token of the page before making the following call

$ret_obj = $facebook->api ( '/page_id/feed' , 'POST' , array(  
                                                'source'  => $photo ,
                                                'message' => $message ,
                                                'name' => 'vinay' ,
        ) );

how do i resolve this?

edit : i have also disabled the "Require AppSecret Proof for Server API calls" in the app advanced settings

1
Photos are to be posted against page_id/photos, not page_id/feed according to docs.CBroe
using page_id/photos i'm able to post to page's timeline, how do i post to page album or to the news feed such that the photo appears in page's home.vinayhudli
By posting against /album_id/photos …? developers.facebook.com/docs/reference/api/album/#photosCBroe
yes, but shouldn't page_id/photos do the same thing as album_id/photos, according to facebook doc if no album id is specified app should create an album and post the photos to the albumvinayhudli
CBroe just answered to your ques: how do i post to page album.Sahil Mittal

1 Answers

1
votes

If you want to post to a specific album, use /album_id/photos and if you don't care of any album simply use: /page_id/photos.

Now, if you use the user access token, the photo will be uploaded on that page (in either of the above two cases), but it will appear in the page wall under the section:

Recent Posts by Others on PageName

If you want your photo to be visible on the page's timeline; the photo must be published on behalf of the page itself- using the page access token, not the user access token.

To get the page access token query for: /me/accounts with permission: manage_pages. Demo