2012-03-20 228 views
2

我下面的說明當我這樣做:錯誤在<a href="http://developers.facebook.com/docs/test_users/" rel="nofollow">http://developers.facebook.com/docs/test_users/</a></p> <p>創建Facebook的測試用戶

https://graph.facebook.com/APP_ID/accounts/test-users? 
    installed=true 
    &name=Fred 
    &locale=en_US 
    &permissions=read_stream 
    &method=post 
    &access_token=XXXXXXXXX 

我得到:

{ 
    "error": { 
     "message": "(#803) Some of the aliases you requested do not exist: APP_ID", 
     "type": "OAuthException", 
     "code": 803 
    } 
} 

我該如何解決這個問題?

+0

不欲問太傻問題,你肯定是使用的應用程序訪問令牌(在相同的應用程序),並正在使用實際的應用ID而不是字符串'APP_ID'?你確定這個應用ID是正確的嗎? – Igy 2012-03-20 19:04:03

+0

我正在使用由https://graph.facebook.com/oauth/access_token?client_id=XXXXXX&client_secret=XXXXXXXXX&grant_type=client_credentials返回的新訪問令牌。我從Facebook獲得了客戶端ID和祕密。由於我有一個訪問令牌,我認爲client_id和client_secret是好的。 – Jay 2012-03-20 19:28:32

+0

*嘆*我把這與另一個問題混淆,只是添加(和刪除)一個不正確的答案 - 請忽略,如果你已經看到它。我能想到的最後一件事(如果情況是這樣的話,是一個不正確的錯誤信息) - 您的應用的「應用類型」是否設置爲「native/Desktop」?如果是這樣,應用程序訪問令牌將不會被信任以代表應用程序進行API調用 – Igy 2012-03-20 19:46:55

回答

1

問題是您正在使用字符串APP_ID而不是您的應用程序ID。


進一步解釋

我能夠通過以下步驟來複制錯誤自己:

  1. 獲得一個應用程序訪問令牌:

    https://graph.facebook.com/oauth/access_token?client_id=YOUR_APP_ID&client_secret=YOUR_APP_SECRET&grant_type=client_credentials

    你的地方_APP_ID和YOUR_APP_SECRET被替換爲https://developers.facebook.com/apps的正確值

  2. 使用提供的訪問令牌,將其附加到url。

    https://graph.facebook.com/APP_ID/accounts/test-users?installed=true&name=Fred&locale=en_US&permissions=read_stream&method=post&access_token=YOUR_ACCESS_TOKEN

    其導致

    { 
    "error": { 
        "message": "(#803) Some of the aliases you requested do not exist: APP_ID", 
        "type": "OAuthException", 
        "code": 803 
        } 
    } 
    
  3. 與適當的應用程序ID更換APP_ID,也從https://developers.facebook.com/apps導致正確的響應。

相關問題