Shashank singh
Shashank singh

Reputation: 641

Facebook Graph Api search in android

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.

Upvotes: 3

Views: 978

Answers (3)

Saurabh Singh Rathore
Saurabh Singh Rathore

Reputation: 190

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/

Upvotes: 1

Naveen Agarwal
Naveen Agarwal

Reputation: 1036

Try this new API, hope this help you.

Graph Event API

Graph API

Upvotes: 1

Related Questions