Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

GET call facebook server from php

Posted on 2014-03-25
2
Medium Priority
?
543 Views
Last Modified: 2014-03-25
Hi

I'm writing some code that writes posts to facebook and the access token i get expires in an hour. In the docs it says to make this call to facebook server

https://developers.facebook.com/docs/facebook-login/access-tokens/

GET /oauth/access_token?  
    grant_type=fb_exchange_token&          
    client_id={app-id}&
    client_secret={app-secret}&
    fb_exchange_token={short-lived-token}

Sorry to be so daft but how do i do this i php? I dont know what the url of the facebook server is or how to make a get requests to it

Thanks
0
Comment
Question by:andieje
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 111

Accepted Solution

by:
Ray Paseur earned 2000 total points
ID: 39954132
I can't tell you the URL; Facebook would have to tell you that.  A GET request is made by putting the information into the URL request string.  So you could type it into a browser address bar or you could use PHP file_get_contents() or cURL.  Probably the things in curly braces are information that you will need to fill in.

$response = file_get_contents( {FACEBOOK URL}/oauth/access_token?grant_type=fb_exchange_token&client_id={app-id}&client_secret={app-secret}&fb_exchange_token={short-lived-token} );
var_dump($response);

Open in new window

0
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 39954463
Thanks for the points and thanks for using EE, ~Ray
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
This article discusses how to create an extensible mechanism for linked drop downs.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

597 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question