Hi all,
I would like to get the events of a user like that :
GET/v2.8/me/events?fields=id,name&since=2017-02-23
So i did this code in my java to test what I get :
public class JavaApplication1 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) throws JSONException, IOException, FacebookException {
Facebook facebook = new FacebookFactory().getInstance();
facebook.setOAuthAppId("...", "...");
facebook.getOAuthAppAccessToken();
BatchRequests<BatchRequest> batch = new BatchRequests<BatchRequest>();
batch.add(new BatchRequest(RequestMethod.GET, "theIduser"));
batch.add(new BatchRequest(RequestMethod.GET, "theIduser/events?fields=id,name&since=2017-02-23"));
List<BatchResponse> results = facebook.executeBatch(batch);
System.out.println(results);
}
}
However i get empty data like this :
I know there is a pb with the token, maybe it doesn't have the right permission.
So the question is, How can I initialize a token with this permission in my java code ?
Thank you !