2016-08-13 106 views
0

我的應用程序已被批准爲publish_actions權限,我想發佈到用戶的牆上表現我的用戶。我試着撥打圖形API這樣的:如何發佈到Facebook牆上的新帖子?

https://graph.facebook.com/v2.7/me/feed?access_token=<token>&method=post&message=Hello

我讀了Facebook的文件,它說A user access token with publish_actions permission can be used to publish new posts. 但實際上,我不能發佈消息到用戶的牆。我收到的是:

{ 
    "error": { 
     "message": "Invalid OAuth 2.0 Access Token", 
     "type": "FacebookApiException", 
     "code": 190, 
     "error_subcode": 1732004, 
     "is_transient": false, 
     "error_user_title": "Invalid Access Token", 
     "error_user_msg": "Invalid access token received.", 
     "fbtrace_id": "<trace code here>" 
      } 
    } 

我犯了什麼錯誤嗎?

更新:加入我的令牌調試信息 enter image description here

+0

你必須做一個POST調用,而不是GET ... – luschn

+0

我試着使用Post方法,並得到了相同的結果。 BTW,AFAIK,使用參數「method = post」的GET請求將被視爲POST請求。 –

+0

然後發佈您的代碼,並調試您的訪問令牌 – luschn

回答

0

這對我工作的罰款截圖:https://graph.facebook.com/me/feed?access_token=xxx&method=post&message=test

確保訪問令牌是有效的,包括publish_actions許可,您可以在這裏進行測試:https://developers.facebook.com/tools/debug/access_token/

+0

嗯,我用附加的截圖更新我的問題,正如你所看到的,這個標記是有效的並且有'publish_actions'。我可以使用此令牌檢索我的提要,但無法發佈新提要。 –