restfb

Why am I getting a 400 response code?

心不动则不痛 提交于 2019-12-24 14:28:36
问题 I am trying to get some acquaintance in using facebook API using Java (restfb). I am trying out the following code. public class FBJava { private String API_Key = "xxxxxx"; private String API_Secret = "xxxxxxxx"; public String firstReq = "https://graph.facebook.com/oauth/authorize?client_id="+API_Key+"&" + "redirect_uri=http://www.facebook.com/connect/login_success.html& scope=publish_stream,offline_access,create_event"; public String secondReq = "https://graph.facebook.com/oauth/access_token

RestFB doesn't give comments of post

纵饮孤独 提交于 2019-12-23 19:39:44
问题 i'm using restfb to fetch some posts and every comment of each posts of a facebook page in this way: FacebookClient facebookClient = new DefaultFacebookClient(MY_ACCESS_TOKEN); Connection<Post> pagePosts = facebookClient.fetchConnection("iPhone.page/feed", Post.class); for (List<Post> posts : pagePosts) for (Post post : posts){ for(Comment comment: post.getComments().getData()){ //get number of likes of comment } String message = post.getMessage(); String id = post.getId(); long timestamp =

How to unlike a post that a user has liked in facebook in android

不想你离开。 提交于 2019-12-23 03:14:26
问题 I have written facebook android application using restfb . For unlike a post , Facebook Graph Api says to send an Http delete to https://graph.facebook.com/postid/likes with the access token The sample code is String postURL = FacebookAppConstants.GRAPH_API_ACCESS+"/"+postID+ "/likes&access_token="+FacebookAppConstants.accessToken; Log.out(logFlag, logTag, "########Delete URL = "+postURL); HttpDelete dislikePost = new HttpDelete(postURL); Log.out(logFlag,logTag,"####Method : "+dislikePost

How to unlike a post that a user has liked in facebook in android

↘锁芯ラ 提交于 2019-12-23 03:14:14
问题 I have written facebook android application using restfb . For unlike a post , Facebook Graph Api says to send an Http delete to https://graph.facebook.com/postid/likes with the access token The sample code is String postURL = FacebookAppConstants.GRAPH_API_ACCESS+"/"+postID+ "/likes&access_token="+FacebookAppConstants.accessToken; Log.out(logFlag, logTag, "########Delete URL = "+postURL); HttpDelete dislikePost = new HttpDelete(postURL); Log.out(logFlag,logTag,"####Method : "+dislikePost

Facebook: POST userid/apprequest throws an exception (Invitation is sent though)

南笙酒味 提交于 2019-12-13 17:57:18
问题 I am using trying to send app request to friends, My code always throws exception but I see that my friends get the App request. I am confused. Can someone let me know hot to handle the request dialog using rest-fb api? My Code String apprequestCall = "6111349/apprequests"; FacebookClient facebookClient = new DefaultFacebookClient(MY_ACCESS_TOKEN); try { String appRequest = facebookClient.publish(apprequestCall, String.class, Parameter.with("message", "Santhosh"), Parameter.with("data",

How come I get a “must have accepted TOS” error for test users with app installed?

孤人 提交于 2019-12-13 04:16:55
问题 I'm writing integration tests and programatically creating and registering some test users for my app in my test by using the graph API to create the users with the installed flag set to true. This should create a user that is an app user, therefore I assume the test user has agreed to the TOS already. Is I switch to the test users then the app is listed in the users history in the app center. However when I try and send an app request to this user from another test user then I get the TOS

FQL Photo Query

别来无恙 提交于 2019-12-11 04:53:56
问题 I am attempting to query the Photo table through FQL using this query: SELECT owner FROM photo WHERE pid="XXXX" For some reason, no matter what pid I choose, I get an empty set response: Facebook responded with HTTP status code 200 and response body: [] I am using RestFB. 回答1: Do you have permissions to access the users photos? user_photos and/or friends_photos Provides access to the photos the user has uploaded, and photos the user has been tagged in. https://developers.facebook.com/docs

Java + RestFB API: Getting fresh Page Access Token without messing with AppID, appSecret

旧城冷巷雨未停 提交于 2019-12-11 02:33:00
问题 What I want to do: I am trying to make a simple program that posts 5-10 statuses, at a time, on a page's wall. The post to the page will have to be done under the name of the page . I've read tons of badly written Facebook Developers documentation and I'm reaching the point of confusion where I don't even know what questions to ask. So her I am. My code so far: I manually got the Page Access token manually, by this method: Go to https://developers.facebook.com/tools/explorer At the GET

How to unlike a post that a user has liked in facebook in android

别说谁变了你拦得住时间么 提交于 2019-12-08 05:38:23
I have written facebook android application using restfb . For unlike a post , Facebook Graph Api says to send an Http delete to https://graph.facebook.com/postid/likes with the access token The sample code is String postURL = FacebookAppConstants.GRAPH_API_ACCESS+"/"+postID+ "/likes&access_token="+FacebookAppConstants.accessToken; Log.out(logFlag, logTag, "########Delete URL = "+postURL); HttpDelete dislikePost = new HttpDelete(postURL); Log.out(logFlag,logTag,"####Method : "+dislikePost.getMethod()); try { HttpResponse response = httpClient.execute(dislikePost); Log.out(logFlag, logTag

How to create a java class for a JSON string where keys are variable?

我只是一个虾纸丫 提交于 2019-12-08 04:23:35
问题 The response array ( 0 => array ( 'time_start' => 1252652400, 'time_stop' => 1252911600, 'stats' => array ( 6002306163363 => array ( 'id' => 6002306163363, 'impressions' => '6713', 'clicks' => '7', 'spent' => '593', 'actions' => '1', ), ), ), ) data is shown in facebook api of rest/ads.getAdGroupStats. I am not able to convert the stats part to a Java class, Where the 6002306163363 is a variable and similarly could have many more mappings. Below is the full result for three ads 123456,23456