GET call facebook server from php


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

GET /oauth/access_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

Who is Participating?
Ray PaseurConnect With a Mentor Commented:
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} );

Open in new window

Ray PaseurCommented:
Thanks for the points and thanks for using EE, ~Ray
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.