为什么某些Facebook网址无法通过图形API返回其Facebook页面ID? [英] Why do some Facebook urls not return their Facebook page id through graph api?

查看:75
本文介绍了为什么某些Facebook网址无法通过图形API返回其Facebook页面ID?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于大多数Facebook网址,调用将查询字符串参数设置为url的 ids 的图形api可以正确返回该网址的Facebook页面....

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

返回

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

但是,有些人只是将url作为id元素的值返回...

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

返回

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

我找不到有关此页面为何不返回其页面ID或如何通过图形api获取ID(知道URL)的解释.

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.

我可以使用FQL来获取ID,但仅当将URL发送为http(而不是https)并且要使用图形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.

这里还有另一个与此类似的问题: Facebook Graph API-获取URL的ID?

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).

有什么想法吗?

谢谢

马特

推荐答案

我知道了.这与页面限制和您使用的令牌有关.由于该页面被标记为酒精含量,因此任何人都无法看到,因此仅我的应用程序令牌还不够好.如果我使用用户令牌访问它,那么我将获得全部信息.

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.

这篇关于为什么某些Facebook网址无法通过图形API返回其Facebook页面ID?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆