Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Access to Facebook API using REST and HttpClient

I am going to use RESTful Web Services and HttpClient to access Facebook API REST Server.

Am somewhat of a newbie to REST and Facebook APIs...

Question(s):

Verification / Authorization

(1) If I have a session key sent by a client app, how do I verify and authenticate that the user exists and then query for his / her friends on the server side?

How can I be access these Facebook RESTful end points:

http://wiki.developers.facebook.com/index.php/Users.getInfo

and

http://wiki.developers.facebook.com/index.php/Friends.getLists

via a HTTP GET Request? Meaning, what does the full URL look like including parameters?

(2) What would the full RESTful URL look like to grab the APIs (which I have listed above)?

Posting to a Friend's Wall

(3) After verification / authorization, querying users friends, how (which API) would I use to a post to a Friend's Wall?

(4) Is there any additional parameters that I need to append to the Facebook RESTful Server's URL?

HTTP Client

(5) Do I include the RESTful web service calls to these Facebook APIs inside my Java program through HttpClient?

Happy programming and thank you for taking the time to read this...

like image 288
mw_javaguy Avatar asked May 18 '26 23:05

mw_javaguy


1 Answers

I can't answer all your questions but the method calls are made via http://api.facebook.com/restserver.php so a call to users.getInfo looks like this

http://api.facebook.com/restserver.php?method=users.getinfo

You also need to pass in your api key and any other parameters the method needs. But rather than make the http calls yourself there must be some Java library that abstracts all this away for you.

As for this being a REST API - there's one web service endpoint with method scoping in the URL and all calls are made via HTTP GET or POST.

Frankly, this is RPC over HTTP and about as far from REST as you can get (no pun intended!). Facebook should change their API documentation, it's just plain wrong.

like image 135
blank Avatar answered May 21 '26 13:05

blank



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!