Publishing in facebook page as admin in v2.3 Javascript api

132 views Asked by At

I try to post in fan page as admin but it does not work:

it works but not as admin

 var wallPost = {
                            access_token: token,
                            message: 'asdasdasd'
                        };
                        FB.api('/xxxxx/feed', 'post', wallPost, function(response) {
                           console.log(response);
                        });

This has an error:

                    FB.api('/' + page_id, {fields: 'access_token'}, function(resp) {
                        if(resp.access_token) {
                            FB.api('/' + page_id + '/feed',
                                'post',
                                { message: "I'm a Page!", access_token: resp.access_token }
                                ,function(response) {
                                    console.log(response);
                            });
                        }else{
                             console.log(resp);
                        }
                    });

the error is: "(#200) The user hasn't authorized the application to perform this action"

My scope: 'manage_pages,publish_actions,read_stream,user_groups'

1

There are 1 answers

0
CBroe On BEST ANSWER

Since v2.3, you need permission publish_pages (in addition to manage_pages) to post as a page.

They separated this from publish_actions, which is now for posting as a user only.

(See also: https://developers.facebook.com/docs/apps/changelog#v2_3_changes)