Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Requesting JSON response from facebook Graph API

This might be a very simple question, but I just need to have a JSON response from Facebook for ths query

https://graph.facebook.com/oauth/access_token?grant_type=fb_exchange_token&client_id='my app id'&client_secret='my secret id'&fb_exchange_token='old_token'

This works and returns a response with a long term Facebook token. But I just need to have the response in JSON format. How can I do that?

like image 244
user3392740 Avatar asked Jan 28 '26 19:01

user3392740


1 Answers

Unfortunately, this is one of the only calls in the Facebook API that does not return JSON. You can reference the still open bug on the Facebook developers site:

https://developers.facebook.com/bugs/351715371565218

I use the FB .NET SDK and retrieve the new token thusly:

newAccessToken = responseString.Split('=', '&')[1];
like image 96
Matthew at Critical Cognition Avatar answered Feb 01 '26 06:02

Matthew at Critical Cognition



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!