简体   繁体   English

使用没有用户访问令牌的Facebook Graph API

[英]Using Facebook Graph API without User Access Token

What I want to achieve 我想实现的目标

I want to display posts of a public facebook page on my website. 我想在我的网站上显示公共Facebook页面的帖子。 For that reason it does not make sense to use a user access token, since it requires a login. 因此,使用用户访问令牌是没有意义的,因为它需要登录。

Possible Solution I found 我发现的可能解决方案

I know you can use the App Tokens . 我知道您可以使用App令牌 There was a related question on Stackoverflow . 关于Stackoverflow有一个相关的问题。 I tested this using the Graph API Explorer. 我使用Graph API Explorer对此进行了测试。

https://graph.facebook.com/v2.3/google/statuses

returns: (#100) Requires user session 返回: (#100) Requires user session

https://graph.facebook.com/v2.3/google/posts

returns: a valid result, but a totally different result than the same request with a User Access Token (less posts). 返回:有效结果,但与带有用户访问令牌的相同请求(更少的帖子)完全不同。 same request for nike delivers a better result. 对耐克的相同要求带来了更好的结果。

Questions 问题

  • Why does the same request deliver two diferent results? 为什么相同的请求会产生两个不同的结果?
  • Can you only grab certain posts with the app token? 您只能使用应用令牌捕获某些帖子吗?
  • Under which conditions can you get the full timeline without user access token? 在什么情况下可以获取没有用户访问令牌的完整时间表?

It's all in the docs. 全部在文档中。 There's a fundamental difference between posts and statuses , and the permission requirements are also well documented: postsstatuses之间有根本的区别,权限要求也有据可查:

Quotes: 语录:

  • An access token is required to view publicly shared posts. 需要访问令牌才能查看公开共享的帖子。
  • A user access token is required to retrieve posts visible to that person. 需要用户访问令牌才能检索该人可见的帖子。
  • A page access token is required to retrieve any other posts. 需要页面访问令牌才能检索任何其他帖子。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM