4
votes

I'm using Facebook's graph API to authorize an app. I just authorized the app with

https://www.facebook.com/v2.8/dialog/oauth

and got an access_token from the redirect uri with less expiration time.

Then I just used

https://graph.facebook.com/oauth/access_token

this to get an access_token with higher expiration time.

The problem is that the format of response I got from this method is text/plain. It's just like

access_token=EAAYZC5w2OP4kBAKNU7nfSKRkdlrGeE2ZCamo8CSTEFZAwzZBMgqlPxPZATTE8EPpM0rdJJX1Rh7ZA8ABZAeOqt0ZA3OxldZB3nnfPWUrcqdTa5R0q9nas1T0OXSZChKgUyxzZBh5Ugbjvm4GMixVcM8vo2tZCdo3YUZD&expires=5184000

My query is that how to get the response in application/json format. Any help will be appreciated !!!

1
Specify the API version in the second call as well. (Only from v2.3 on it returns JSON.)CBroe
how do you specify Api version in the second call ?? ThanksTaseen
I just added the version in URL like: graph.facebook.com/v2.8/oauth/access_tokenAbhishek Ramachandran

1 Answers

5
votes

Specify the API version in the second call as well.

Only from v2.3 on it returns JSON.