简体   繁体   English

使用Graph API Java获取Facebook组

[英]fetch facebook group using Graph api java

i am trying to get all groups from my facebook account using restfb in java, i wrote following code 我试图在Java中使用restfb从我的Facebook帐户中获取所有群组,我编写了以下代码

JsonObject json = fbClient.fetchObject(userObj.getLong("id") + "/groups", JsonObject.class, Parameter.with("fields", "description,email,name));

when i check my Json i am deting output : 当我检查我的Json时,我想输出:

{
  "data":  []
}

i dont know what is happening here when i try to use Facebook graph Api Explorer it work fine and display all group available in Facebook account. 当我尝试使用Facebook图形Api Explorer时,我不知道这里发生了什么,它工作正常并显示Facebook帐户中可用的所有组。

if an one can help me please. 如果有人可以帮助我的话。

Thanks 谢谢

You can only get groups you manage, and you have to authorize with the user_managed_groups permission. 您只能获得您管理的组,并且必须使用user_managed_groups权限进行授权。

Most likely, you don´t manage any groups or the Access Token does not include the permission. 最有可能的是,您不管理任何组,或者访问令牌不包含该权限。

As this answer describes, it is unlikely you will ever get permission to do what you want to do. 就像这个答案所描述的那样,您不太可能会获得许可去做您想做的事情。

https://stackoverflow.com/a/31043823/1542667 https://stackoverflow.com/a/31043823/1542667

In short: Facebook will no longer approve user_groups permission for most developers starting from 30 Apr 2015. 简而言之:自2015年4月30日起,Facebook将不再批准大多数开发人员的user_groups权限。

How to get posts from Facebook groups using RestFB in Java? 如何使用Java中的RestFB从Facebook组获取帖子?

I'm using apptoken to get posts in pages, but when I create the connection using groupeId+"/post" the program says: 我正在使用apptoken在页面中获取帖子,但是当我使用groupeId+"/post"创建连接时,程序会说:

Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (default-cli) on project MonitoringFB:
    Command execution failed. Process exited with an error: 1 (Exit value: 1) -> [Help 1]

To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.

For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException"

What does this mean? 这是什么意思?

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

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