Method: HyperGraph.get_access_token

Defined in:
lib/hyper_graph.rb

.get_access_token(client_id, client_secret, redirect_uri, code) ⇒ Object



52
53
54
55
56
57
58
# File 'lib/hyper_graph.rb', line 52

def get_access_token(client_id, client_secret, redirect_uri, code)
  http = initialize_http_connection
  request_path = "/oauth/access_token"
  request_path << "?#{build_query(:client_id => client_id, :client_secret => client_secret, :redirect_uri => redirect_uri, :code => code)}"
  http_response = http.get(request_path)
  http_response.body.split('=')[1]
end