hpPh
hpPh

Reputation: 71

How to post on a facebook test page?

I'm trying to post on a test Facebook page, but it wouldn't work here's what I did:

window.FB.api(
      '/https://graph.facebook.com/700757323715208/feed',
      'POST',
      {message:"Hello Fans", access_token:"{access_token}"
    },
      function(response) {
        console.log(response)      }
    );

and it's rendering this:

{id: "2568244933261615", url: "https://graph.facebook.com/700757323715208/feed"}

But it's supposed to render something like this :

{
  "id":"1116692661689527",
  "post_id":"546349135390552_1116692711689522"
}

Upvotes: 0

Views: 61

Answers (1)

andyrandy
andyrandy

Reputation: 73984

Correct version:

window.FB.api(
    '/me/feed',
    'POST',
    {message:"Hello Fans", access_token:"{access_token}"
}, function(response) {
    console.log(response);
});

You do not need the Page ID, you have to use a Page Token of that Page anyway.

Upvotes: 1

Related Questions