2012-05-07 28 views
0

使用Graph API Explorer一個鏈接,我嘗試發佈以下內容:/[another_user_id]/links和LINK域
但我得到這個錯誤:如何分享其他用戶的牆

(#240) Requires a valid user is specified (either via the session or via the API parameter for specifying the user.

缺少什麼我在這裏?使用/[another_user_id]/feed作品,但我希望它是一個共享鏈接。

+0

我不認爲您可以用新的OAuth API代表用戶發佈到其他用戶的牆上。這SO帖子應該對你有所幫助。 http://stackoverflow.com/questions/3536920/post-on-a-friends-wall-on-behalf-of-a-user –

回答

0

下面的代碼發佈在用戶朋友牆。

try { 
    $newStatus = $facebook->api("/$FRIENDSUSERID/feed", 'POST', 
    array(
     'link' => "https://apps.facebook.com/XXXXXXXXX", 
     'picture' => "https://XXXXXXXXX", //colour 
     'name' => "XXXXXXXXX", 
     'description' => "XXXXXXXXX", 
     'access_token' => $access_token 
    )); 
    //echo '<pre>Post ID: ' . $newStatus['id'] . '</pre>'; 
} catch(FacebookApiException $e) { 
     error_log($e->getType()); 
     error_log($e->getMessage()); 
     //echo '<textarea style="width: 300px; height: 200px;">' . $e->getMessage() . '</textarea>'; 
} 
+0

好的,這個工程。但我希望它顯示共享鏈接,與「共享鏈接通過​​3210」。 – minx

相關問題