2013-06-06 44 views
0

我想通过php-dsk图形API发布链接。当我输入我的网址在http://developers.facebook.com/tools/debug,它是成功的显示响应码 - 200 但是,当我试图张贴链接到Facebook涂鸦墙,出现以下错误: -FAcebook graph API - 提供的URL无效OAuthException:(#1500)

Fatal error: Uncaught OAuthException: (#1500) The url you supplied is invalid thrown  
in /home/a1395850/public_html/src/base_facebook.php on line 1254 

我在下面我的范围: - “电子邮件,publish_stream,publish_actions,user_likes”

以下是我的代码来发布链接到用户的墙: -

<?php 
error_reporting(E_ALL); ini_set('display_errors', 'On'); 
require 'src/facebook.php'; 
include 'app_details.php'; 
$user = $facebook->getUser(); 
if ($user) { 
    try { 
    $user_profile = $facebook->api('/me'); 
    } catch (FacebookApiException $e) { 
    error_log($e); 
    $user = null; 
    } 
} 



$permissions = $facebook->api("/me/permissions"); 
if(array_key_exists('publish_stream', $permissions['data'][0])) { 
// Permission is granted! 
// Do the related task 
$args = array(
'message' => 'Hello from app', 
'link'  => 'laafo.uni.me', 
'caption' => 'Facebook API Tutorials!' 
); 
$post_id = $facebook->api("/me/feed", "post", $args); 

} else { 
// We don't have the permission 
// Alert the user or ask for the permission! 
header("Location: " . $facebook->getLoginUrl(array("scope" => "publish_stream"))); 
} 


?> 

请帮我...在此先感谢。

+1

'laafo.uni.me'不是绝对的URL,它只是一个主机名。完整的URL将会像'http:// laafo.uni.me /'一样,所以试试看。 (调试器自动添加协议'http://'作为浏览器会 - 但我不认为实际的API是宽容的。) – CBroe

+0

尝试http也,但同样的错误正在显示。 –

回答

1

使用OAuth authenticatoin发布到Facebook涂鸦墙的能力已经从2013年2月

删除,请搜索“删除通过图形API张贴到墙上朋友的能力”在下面的页面。

FB ROADMAP

+0

感谢您的回答,@Vinoth。你能告诉我,我怎么能发布一个链接到用户的墙上呢? –

+0

我希望这是不可能的。 –

+0

不,我们可以....你可以在http://25labs.com/demo/fb/index.php上的演示他们张贴链接到用户的墙壁... –