Deval Khandelwal
Deval Khandelwal

Reputation: 3548

FAcebook graph API - URL supplied invalid OAuthException: (#1500)

I am trying to post a link via the php-dsk graph API. When I typed my URL at http://developers.facebook.com/tools/debug , it was successful showing response code - 200. But when I am trying to post a link to the facebook wall, the following error appears :-

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

I have the following in my scope :- 'email,publish_stream,publish_actions,user_likes'

The following is my code to post a link to the user's wall :-

<?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")) );
 }


 ?>

Please help me...Thanks in advance.

Upvotes: 0

Views: 1041

Answers (1)

Vinoth Babu
Vinoth Babu

Reputation: 6852

The ability of posting into facebook wall using oauth authenticatoin has been removed from Feb 2013

Please search for 'Removing ability to post to friends walls via Graph API' in the below page.

FB ROADMAP

Upvotes: 1

Related Questions