0

For most Facebook urls, a call to the graph api with a query string parameter of ids set to the url, returns the Facebook page of that url correctly....

https://graph.facebook.com/?ids=http://www.facebook.com/AdvantageInsulationNY&appToken&access_token=XXXXXXX

returns

{
  https://www.facebook.com/AdvantageInsulationNY: {
    id: "XXXXXX",
    about: "about"
    ......
  }
}

However, some simply return the url as the value of the id element...

https://graph.facebook.com/?ids=http://www.facebook.com/winetreefarm&access_token=XXXXXXXX

returns

{
  https://www.facebook.com/winetreefarm: {
    id: "https://www.facebook.com/winetreefarm"
  }
}

I can't find an explanation of why this page does not return its page id or how to obtain the id (knowing the url) through the graph api.

I can get the id utilizing FQL, but only when sending the url as http (not https) and I want to use the graph api.

There is another question similar to this here: Facebook Graph API - get ID for a URL?

But none of these answers fit my situation (there is a like button on the page).

Any ideas?

Thanks,

Matt

Community
  • 1
  • 1
Levitron
  • 1,033
  • 9
  • 14
  • _“how to obtain the id (knowing the url) through the graph api”_ - simply request the page name from the API, `/winetreefarm`, that will get you the id. (Page name and id are interchangeably for most stuff in any case.) – CBroe Jul 10 '15 at 18:44

1 Answers1

0

I figured it out. This has to do with page restrictions and the token you are using. Because the page is marked as alcohol content its not viewable to anyone, so just my app token isn't good enough. If I access it with the user token, then I get the full information.

Levitron
  • 1,033
  • 9
  • 14