访问“公共”从应用程序图API资源? [英] Access "Public" Graph API resources from an app?

查看:112
本文介绍了访问“公共”从应用程序图API资源?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个正在尝试使用公开Facebook内容的网络应用程序。

I am creating a web application that is trying to use "public" Facebook content.

这不是您传统的Facebook应用程序,因为我实际上并不是注册Facebook用户使用它,但用户将全部是服务器端。

It is not your traditional "Facebook Application" because I'm not actually signing up Facebook users to use it, but the users will be all server-side.

我已经到了一个要点,我不得不使用access_token 对于某些公开的内容,我已经能够生成一个应用程序access_token,但这并不适用于我有兴趣访问的公共数据。

I've come to a point in which I am having to use an "access_token" for certain "public" pieces of content and I have been able to generate a app access_token but this does not work for the public data I'm interested in accessing.

access_token通过

access_token's created via

https://graph.facebook.com/oauth/access_token?client_id=APP_ID&client_secret=APP_SECRET&grant_type=client_credentials

不适用

https://graph.facebook.com/chickfila/notes?access_token=CODE_FROM_ABOVE

这是公开可访问w / o在这里登录...

which is publicly accessable w/o login here...

http://www.facebook.com/ChickfilA?sk=notes

任何方式给应用程序本身一个用户级access_token?

Any way to give an app itself a user-level access_token?

推荐答案

我与公开的事件数据有一个非常相似的问题。我要做的是为应用程序的管理员创建一个离线访问令牌。

I had a very similar problem with publicly available event data. What I had to do was to create an offline access token for the admin of the application.

所以,使用你的管理员登录并打开以下URL(替换APP ID与你的ID,最终你需要更多的权限,但read_stream和offline_access应该做的伎俩):

So, log in with your admin and open the following URL (replace APP ID with your ID and eventually you need more permissions, but read_stream and offline_access should do the trick):

https://graph.facebook.com/oauth/authorize?client_id=APPID&scope=offline_access,read_stream&redirect_uri=http://www.facebook.com/connect/login_success.html

这将为您提供一个代码,您将粘贴到以下URL(使用您的APP ID和SECRET):

This will give you a code, that you will paste in the following URL (with your APP ID and SECRET):

https://graph.facebook.com/oauth/access_token?client_id=APPID&redirect_uri=http://www.facebook.com/connect/login_success.html&client_secret=SECRET&code=CODE

这将给你一个应该永远工作的访问令牌(或直到你改变您的密码)。

This will give you an access token that should work forever (or until you change your password).

这篇关于访问“公共”从应用程序图API资源?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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