我想通过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")));
}
?>
请帮我...在此先感谢。
'laafo.uni.me'不是绝对的URL,它只是一个主机名。完整的URL将会像'http:// laafo.uni.me /'一样,所以试试看。 (调试器自动添加协议'http://'作为浏览器会 - 但我不认为实际的API是宽容的。) – CBroe
尝试http也,但同样的错误正在显示。 –