【问题标题】:FAcebook graph API - URL supplied invalid OAuthException: (#1500)Facebook 图形 API - URL 提供的无效 OAuthException: (#1500)
【发布时间】:2013-06-06 09:53:56
【问题描述】:

我正在尝试通过 php-dsk graph API 发布链接。当我在 http://developers.facebook.com/tools/debug 输入我的 URL 时,它成功显示响应代码 - 200。 但是当我尝试发布到 facebook 墙的链接时,会出现以下错误:-

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

我的范围内有以下内容:- 'email,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 不会那么宽容。)
  • 也尝试过http,但显示同样的错误。

标签: php facebook-graph-api facebook-php-sdk


【解决方案1】:

从 2013 年 2 月起,使用 oauth authenticationatoin 在 facebook 墙上发帖的功能已被删除

请在以下页面搜索“移除通过 Graph API 向朋友墙发帖的功能”。

FB ROADMAP

【讨论】:

  • 感谢@Vinoth 的回答。您能告诉我现在如何发布指向用户墙的链接吗?
  • 我希望这是不可能的。
  • 不,我们可以......你可以在25labs.com/demo/fb/index.php看到演示他们正在发布指向用户墙的链接......
  • 本网站不会自动将任何内容发布到您的墙上或喜欢任何页面。查看该链接
  • 那是“自动”。但是,如果您要求它这样做,它会发布。点击 f-connect 按钮,然后点击“POST ABOUT 25LABS”
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-09-08
  • 1970-01-01
  • 2014-08-31
  • 2022-08-03
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多