Edward Lee
Edward Lee

Reputation: 21

The graph api /me/apprequests return http error

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.

Upvotes: 1

Views: 1628

Answers (1)

Xu Hanyang
Xu Hanyang

Reputation: 11

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.

Upvotes: 1

Related Questions