1

I use

FB.api('/me/apprequests/?access_token=' + access_token + '&date_format=' + escape('Y/m/d H:i:s eO'), function(response) {
    if(response.error)
    {

to get user's app requests. but some times,some users cannot get the app requests list. only get {"error":{"type":"http","message":"unknown error"}}

some users may get this error all the time. I trace this error to my GA quality,Statistical results show some users get this error As many as tens of thousands of times.

the access_token is the current user's.

why some user get unknown error with type http?

I do not get this.

thank you.

thanks for your answer.

I think this error is not caused due to the permission.because I log the access_token when one error occurs.and use facebook debug tool check it.It shows

Issued: 
1362702044 (about an hour ago)
Expires:    
1367886044 (in about 2 months)
Valid:  True
Origin: Web
Scopes: email publish_actions user_games_activity

.So ,I do not known why those problem occur.

Edward Lee
  • 21
  • 3
  • Are you checking if the user has all required permissions before making the api call? You might get this error when user didn't give you some extended permission. – Darvex Mar 06 '13 at 08:10
  • thanks for your response. after FB.init,I call FB.api('/'+userfbid+'/permissions',{access_token: access_token}, function(response){ permissions = response.data; permissions = permissions[0]; if(!permissions.publish_actions || !permissions.user_games_activity) { FB.login(function(response) { // handle the response }, {scope: 'publish_actions,user_games_activity,email'}); } }); to ensure users have the right permissions. – Edward Lee Mar 06 '13 at 08:15
  • I use fql instead of graph api to get the app requests.but some users get the same error. – Edward Lee Mar 22 '13 at 01:11

1 Answers1

1

I have the same problem and it is resolved now. The error message : {"error":{"type":"http","message":"unknown error"}} means FB API's response is broken because of some other action in the page.

In my scenario, I put a html tag :button in a form, and this button is to invoke FB.api. However, when a user clicks the button, the form will be submitted automatically and does not wait the response of FB.api.

The code is as below:

<form>
    <button onclick="test();">Test</button> 
</form>


function test(){
 FB.api('/me', function(response) {
        alert(response.name);
    }); 
}

I add "return false;" in button's onclick method after it calls test() to avoid the form automatically submitting.

I suggest you to check the javascript in the page to confirm there is no action occurs during interactive function with FB.

Xu Hanyang
  • 11
  • 1