2011-07-28 23 views
3

我試圖從test console使用getCount使用getCount時出現「需要指定有效用戶...」錯誤

當我進入已安裝我的應用程序的用戶的uid(使用基本和publish_stream權限),我收到以下錯誤:

{ 
    "error_code": 240, 
    "error_msg": "Requires a valid user is specified (either via the session or via the API parameter for specifying the user.", 
    "request_args": [ 
    { 
     "key": "uid", 
     "value": "REMOVED_USER_ID" 
    }, 
    { 
     "key": "method", 
     "value": "dashboard.getCount" 
    }, 
    { 
     "key": "access_token", 
     "value": "REMOVED_ACCESS_TOKEN" 
    }, 
    { 
     "key": "format", 
     "value": "json" 
    } 
    ] 
} 

任何想法,爲什麼是這個happenning?我該如何解決它?我需要一些額外的權限嗎?

回答

8

約翰,你不需要額外的權限。問題出在您的訪問令牌上。該工具使用您的個人訪問令牌用戶訪問令牌,並且僅適用於您的uid。如果您使用應用程序訪問令牌(意思是APP_ID | APP_SECRET),那麼您將能夠爲您的應用程序的所有用戶查看此方法的結果。

api.facebook.com/method/dashboard.getCount?uid=[UID]&access_token=[appid|appsecret]&format=json

+0

非常感謝:) –

相關問題