使用某些 facebook 页面 id/用户名访问图形 api 时出现问题

发布于 2024-11-28 14:02:32 字数 923 浏览 4 评论 0原文

我已经成功制作了一个 facebook 应用程序,它显示来自 facebook graph api 的实时数据,无需身份验证。我使用的方法是与图形 API 的简单连接,因为我只需要它的基本信息。

    $url = 'http://graph.facebook.com/'.$pagename;
    // for id
    $url = 'http://graph.facebook.com/'.$page_id;
    $pageinfo = json_decode(file_get_contents($url));

这种方法效果很好,但不适用于 facebook 中的某些页面。我的客户已将这些页面网址发送给我。从我的电脑但无法访问这些页面(Facebook 将我重定向到主页)。我还尝试通过这些页面用户名和 ID 访问图表。它只是返回false

这是这些页面。 请注意,并非所有页面,只有少数页面存在此问题:

https://www.facebook。 com/MontanaDaleCarnegie

https://www.facebook.com/pages/The-Painted-Swan-Online-Marketing/223492000998546

我找不到这些页面无法访问的问题。页面设置页面中是否有任何设置使页面不公开或无法通过图形 API 访问?客户说他可以访问这些页面。

我需要你的经验来克服这种情况。谢谢!

I have successfully made an facebook application which shows real time data from facebook graph api with no authentication. The method i have used is something the simple connection to the graph api because i only need the basic info for it.

    $url = 'http://graph.facebook.com/'.$pagename;
    // for id
    $url = 'http://graph.facebook.com/'.$page_id;
    $pageinfo = json_decode(file_get_contents($url));

This methord works fine but not for some pages in facebook. My client has send those pages url to me. From my pc but can't access those page (facebook redirects me to the homepage). Also i have tried to access the graph via those page username and id. Its just returning false.

Here are those pages. Note that not all pages but a few has this problem:

https://www.facebook.com/MontanaDaleCarnegie

https://www.facebook.com/pages/The-Painted-Swan-Online-Marketing/223492000998546

I can't find the issue why these pages aren't accessible. Is there any settings in the page settings page that make the page nonpublic or inaccessible via graph api? The client saying that he can access these pages.

I need your experience an input to overcome this situation. Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

雾里花 2024-12-05 14:02:32

显然,如果任何页面的隐私设置受到限制,则该页面信息无法公开访问。

有几种情况:

  1. 如果页面仅限于任何国家/地区。
  2. 如果该页面有任何年龄限制。选择除任何人 (13+) 之外的任何内容

在此处输入图像描述

您可能会发现它很有帮助 http://bugs.developers.facebook.net/show_bug.cgi?id=18162 检查评论 #3。

Apparently if any page has privacy setting restricted the page info can't be access in public.

There is couple of cases:

  1. If the page is restricted to any country.
  2. If the page has any age restriction. Selected anything other then Anyone (13+)

enter image description here

You might find it helpfull http://bugs.developers.facebook.net/show_bug.cgi?id=18162 Check comment #3.

听不够的曲调 2024-12-05 14:02:32

我尝试查看您的两个示例,它们都将我带回到主屏幕。这当然意味着这些页面不公开。

页面设置页面中是否有任何设置使页面
非公开或无法通过图形 API 访问?

是:在“管理权限”下的页面设置中,有一个“页面可见性”复选框:

只有管理员可以看到此页面

如果选中此复选框,则 facebook 上的用户和图形 api 都无法访问它。唯一的可能性是(但我不确定)使用 来自其中一位管理员的离线访问令牌

I tried to take a look at your two examples and both take me back to the home screen. This certainly means that those pages are not publicly available.

Is there any settings in the page settings page that make the page
nonpublic or inaccessible via graph api?

Yes: In the page settings under "manage permissions" there is a checkbox for "page visibility":

Only admins can see this page

If this is checkbox is selected, neither a user on facebook nor the graph api have access to it. The only possibility would be (but I'm not sure) to use an offline access token from one of the admins.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文