T
T
The Whiz2015-08-26 17:44:48
ruby
The Whiz, 2015-08-26 17:44:48

How to get Facebook access_token using Ruby and Koala?

I want to make a small Facebook application with simple Ruby tools.
I created the required www app on the Facebook for Developers page and now I need to get an access_token to make it work. I want the application to work independently, and not on behalf of the logged in user.
The documentation says that I need to make a request to get a token:

To generate an app access token, you need to make a Graph API call:

GET /oauth/access_token?
     client_id={app-id}
    &client_secret={app-secret}
    &grant_type=client_credentials

For any such request, fb returns 404:
file = open("https://graph.facebook.com/endpoint?key=value&access_token=#{app_id}|#{app_secret}")
access_token = file.read

Help, please!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question