Just want to search all the events in a particular location by using new request in graph api,but error throws.
//Request for events
new Request(
session,
"/search?q=dubai&type=event",
null,
HttpMethod.GET,
new Request.Callback() {
public void onCompleted(Response response) {
System.out.println("Result: " + response.toString());
}
}
).executeAsync();
Permission:-
authButton.setPublishPermissions("publish_actions","manage_pages");
output:-
Result: {Response: responseCode: 400, graphObject: null, error: {HttpStatus: 400, errorCode: 100, errorType: GraphMethodException, errorMessage: Unsupported get request. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api}, isFromCache:false}
suggest some way to solve it.
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/{event-id}",
null,
HttpMethod.GET,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */
}
}
).executeAsync();
Hope it will help you, for detail go through below link
https://developers.facebook.com/docs/graph-api/reference/event/
Try this new API, hope this help you.
Graph Event API
Graph API
for facebook Api, please refer below its developer link:
https://developers.facebook.com/docs/graph-api/using-graph-api/v2.2
https://developers.facebook.com/docs/graph-api/reference
http://api-portal.anypoint.mulesoft.com/facebook/api/facebook-graph-api/docs/code
I hope it work.
Related
new GraphRequest(AccessToken.getCurrentAccessToken(),
"/"+userId+"/picture",
null,
HttpMethod.GET,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */ Log.e("new Response","----"+response);
}
}
).executeAsync();
}
I am getting response like below.
Response:
responseCode: 200, graphObject:
{"FACEBOOK_NON_JSON_RESULT":"����\u0000\u0010JFIF\u0000\u0001\u0002\u0000\u0000\u0001\u0000\u0001\u0000\u0000��\u0000�Photoshop"},
error: null}
Instead of creating executeGraphPathRequestAsync request, create simple GET request.
graph.facebook.com/YOUR_USER_ID/picture
Check below link to get image from remote url:
How to load an ImageView by URL in Android?
I am using Facebook SDK 4.x, and i need to get friend list with name but i can't get it,
i have also implemented this graph API
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/me/friend",
null,
HttpMethod.GET,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */
}
}
).executeAsync();
and this is my reponse
response {Response: responseCode: 200, graphObject: {"summary":{"total_count":3},"data":[]}, error: null}
I am not getting friend list with name, if you have any idea than plz give me.
Thanks in Advance.
I got solutions for using this
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/me/taggable_friends",
null,
HttpMethod.GET,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
Log.e("getFriendsDat",""+ response);
}
}
).executeAsync();
You will get friend list with name and detail.
you have to add user_friends permission and need to submit your app for review.
First of all, it´s /me/friends, not /me/friend. That being said, you can only get access to friends who authorized your App too, with the user_friends permission. The response means that you have 3 friends, but none of them authorized your App with user_friends.
More information: Get ALL User Friends Using Facebook Graph API - Android
I am trying to read feed from public page, but I get this error:
Response: responseCode: 400, graphObject: null, error: {HttpStatus: 400, errorCode: 15, errorType: OAuthException, errorMessage: (#15) Requires session when calling from a desktop app}, isFromCache:false}
My steps:
1) get access token via https://graph.facebook.com/oauth/access_token?grant_type=client_credentials&client_id=[APP_ID]&client_secret=[APP_SECRET]
2) create instance of AccessToken class: AccessToken token = AccessToken.createFromExistingAccessToken([TOKEN_FROM_STEP1], new Date(2015,3,2), new Date(), null, permissions);
3) open new session session = Session.openActiveSessionWithAccessToken(this, token, callback);
4) and make request:
new Request(session, "/[PUBLIC_PAGE_ID]/feed", null, HttpMethod.GET, new Request.Callback() {
public void onCompleted(Response response) {
//check response
}
}).executeAsync();
Where is mistake? What is the right way?
The "Native or Desktop app" setting is disabled for this app.
I am trying to send a facebook request with the following code:
new Request(
session,
"/me?fields=birthday",
null,
HttpMethod.GET,
new Request.Callback() {
public void onCompleted(Response response) {
if(response.getGraphObject() != null)
{
GraphObject go = response.getGraphObject();
}
}
}
).executeAsync();
The session I pass is valid and open, and the access token inside it is also valid (I doubled checked with the Access Token Debugger). Also, its permissions include the user_birthday permissions needed for the birthday. However, I still get the OAuthException:
{HttpStatus: 400, errorCode: 2500, errorType: OAuthException, errorMessage: An active access token must be used to query information about the current user.}
Did anyone encounter a familiar problem?
Thanks.
Just faced this problem
You can pass fields as bundle as shoved here: https://stackoverflow.com/a/21855119/2010395
Bundle params = new Bundle();
params.putString("fields", "birthday");
new Request(session, "me", params, HttpMethod.GET,
new Request.Callback() {
public void onCompleted(Response response) {
if (response.getGraphObject() != null) {
GraphObject go = response.getGraphObject();
}
}
}).executeAsync();
I'm trying to update my app to the new way to getting mutual friends from the facebook graph API v2.0.
On thier website here: https://developers.facebook.com/docs/graph-api/reference/v2.0/user.context/mutual_friends
they recommend to use this code:
Bundle params = new Bundle();
params.putString("fields", "context.fields(mutual_friends)");
/* make the API call */
new Request(
session,
"/{user-id}",
params,
HttpMethod.GET,
new Request.Callback() {
public void onCompleted(Response response) {
/* handle the result */
}
}
).executeAsync();
So I edited this code to put in the USER ID like so....
Bundle params = new Bundle();
params.putString("fields", "context.fields(mutual_friends)");
// make the API call
new Request(Session.getActiveSession(), "/{" + userProfile.getString("facebookId") + "}", params, HttpMethod.GET,
new Request.Callback() {
public void onCompleted(Response response) {
/* handle the result */
System.out.println(response.toString());
}
}).executeAsync();
When I run the code, I get this error:
{Response: responseCode: 404, graphObject: null, error: {HttpStatus: 404, errorCode: 803, errorType: OAuthException, errorMessage: (#803) Some of the aliases you requested do not exist: {10102533400666784}}, isFromCache:false}
This alias does exist. What is wrong with my request?
The error response explains it
{Response: responseCode: 404, graphObject: null, error: {HttpStatus: 404, errorCode: 803, errorType: OAuthException, errorMessage: (#803) Some of the aliases you requested do not exist: {10102533400666784}}, isFromCache:false}
This alias {10102533400666784} does not exist remove the {}