2012-12-27 73 views
0

我在我的代碼中的FQL查詢,直到上週(左右)完美工作,然後突然停止工作。FQL錯誤803突然顯示出來

我現在越來越奇怪#803錯誤以及消息「您請求的某些別名不存在:」這是特殊的(我相信是一個總的紅鯡魚),因爲我現在已經嘗試刪除所有我以前的別名,並用「名稱」替換它們。

完全在我的繩子結束試圖弄清楚Facebook上改變了過去幾周,將是造成這個的。如果有人有任何見解,我會非常感激聽到它。

我在這裏發佈我的代碼,但我沒想到的代碼本身的任何評論看到它如何在過去兩週左右的時間內完美地工作了好幾個月,直到某一點。

代碼的具體目的是爲取得用於用戶的身份驗證令牌,然後檢索一些更詳細的信息不可用的/我請求。

//I call this first to get the token 

       function checkStatus() {  
      try{ 

       FB.getLoginStatus(function(loginResponse){ 
        if(loginResponse.status == "connected"){ 
         authToken = loginResponse.authResponse.accessToken;//this comes back as expected 
         expiresIn = loginResponse.authResponse.expiresIn;//this comes back as expected 
         getUserInfo(); 
        } else { 
         registerApp();//this gets called if the user hasn't approved the app yet... this continues to work as expected 
        } 
       }); 

      } 
      catch(e){ 
       alert("ERROR" + e); 
      } 
     } 



//so the above method calls this 


       function getUserInfo(){ 
      FB.api("/me", function(meResponse){ 

       meResponse.authToken = authToken; 
       meResponse.expiresIn = expiresIn;   
       console.log("meResponse = " + JSON.stringify(meResponse)); 
//this contains all the correct expected data 

       FB.api(escape("/fql&q=SELECT name FROM user WHERE uid = '"+ meResponse.id +"'"),//here I've eliminated ALL extra aliases (though none of them were a problem before 
        function(response){ 
         console.log("RESP = " + JSON.stringify(response)); //this comes back with the following error: 
//{"error":{"message":"(#803) Some of the aliases you requested do not exist: fql&q=SELECT name FROM user WHERE uid = 'xxxxxxxxx'","type":"OAuthException","code":803}} 

        } 
       )    
      }); 

     } 

回答

0

所以......這樣看來,FB只是完全改變了FQL如何被調用的語法,而我沒有看到對我有更高(這TOTALLY工作)的老路上任何引用。

新的方法是在一個JSON對象看起來像這樣通過:

{method:'fql.query',       query: "SELECT uid,name,email,first_name,last_name,birthday_date,pic_big FROM user WHERE uid = '"+ meResponse.id +"'"} 

和響應不再回來作爲數組稱爲數據,並且現在是在一個原始無名數組返回對象的頂層......所以在上面的示例中,我現在只是查看response [0]而不是response.data [0]。

我看不到任何這些變化,他們的任何文件的提...也許我只是失去了我的腦海,但看起來他們只是完全並修改了自己的API沒有警告。

也許我錯過了什麼(我通常是)。

萬一別人需要幫助這個......這裏的新的工作代碼示例...

FB.api(
        {method:'fql.query', 
         query: "SELECT uid,name,email,first_name,last_name,birthday_date,pic_big FROM user WHERE uid = '"+ meResponse.id +"'"}, 
       function(response){ 
        console.log("RESP = " + JSON.stringify(response)); 
        //all the data for this specific user is now in response[0], obviously if your search criteria contains more users, they'll be in the subsequent indexed items under the response array.            
       } 
      )