2012-11-21 23 views
2

我在Facebook上創建了應用程序。代表用戶發佈在用戶的時間軸上

現在我正在嘗試使用Graph API發佈用戶的時間線上的評論,但我無法打開我需要做的事情。

我已經授權應用程序(我授權此權限:'user_status,publish_stream,user_photos,email')。

如果我看我的個人信息 - >隱私,我可以看到,應用程序可以:

This app can: Post on your behalf 
This app may post on your behalf, including status updates, photos and more. 

Last data access: 
Basic InformationToday 
See details · Learn more 
Posts on your behalf: 
Who can see posts this app makes for you on your Facebook timeline? 
Public 
Notifications: 
When to notify you? 
The app sends you a notification 

因此,這部分似乎確定。

在我的應用程序上,我做了以下操作以嘗試在我的時間線上發帖(我需要在離線時發帖)。

1)GET:https://graph.facebook.com/oauth/access_token?client_id= APPID & client_secret = * APP_SECRET * & grant_type = client_credentials

RESPONSE:

access_token = 422828347771671|UdQELQIf0N7krF4JUo7VwtPLTkk 

2)GET:https://graph.facebook.com/search?q= myemail & type = user

迴應:

_"error":_{ 
______"message":_"A_user_access_token_is_required_to_request_this_resource_", 
______"type":_"OAuthException", 
______"code":_102 
___} 

但閱讀文檔(https://developers.facebook.com/docs/reference/api/#searching)看來,這一要求並不需要任何形式的訪問令牌。

我也嘗試添加訪問令牌,但結果仍然相同。

3)我知道我的facebookid所以我試圖直接使用它:

POST:https://graph.facebook.com/100001139132403/feed

參數:

的access_token = 422828347771671 | UdQELQIf0N7krF4JUo7VwtPLTkk,

消息=你好

RESPONSE:

"error": { 
     "message": "(#200) This API call requires a valid app_id.", 
     "type": "OAuthException", 
     "code": 200 
    } 
} 

於是,我就添加的client_id = APPIDAPP_ID = APPID,我試圖把一個,其他的也都參數作爲GET或POST,但什麼都沒有改變。

我檢查了APPId廣告,它是正確的。

有人有什麼想法嗎?

謝謝!

回答

相關問題