Solved

GET call facebook server from php

Posted on 2014-03-25
2
526 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 110

Accepted Solution

by:
Ray Paseur earned 500 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 110

Expert Comment

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

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MySQL Persistent Connections 10 54
Redirection of links in facebook 1 24
Convert complicated date to yyyy-mm-dd format 22 50
Joomla Editing 3 21
There are countless ways to use social media and often times businesses are not using it properly. Is your business making any social media mistakes? Here are some tips to get your foot in the door with social media and make the most of it for your …
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

734 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