Facebook OAuthException when posting to Wall for a Page

I integrate Facebook posting with a few different websites and services, so I've gotten to know Facebook's Open Graph and API pretty well over the past few years. A lot of sites I work with automatically post new stories straight to a Facebook Page's wall, and have a format with a message and an attached link. All of these parameters are well documented in Facebook's API under Post.

However, lately I've been getting the following error message whenever a site uses the first method below to send a post with a link attached:

  "message" : "An unknown error has occurred.",
  "type" : "OAuthException",
  "code" : 1

I tried using the Open Graph Explorer, the official Facebook SDK for PHP, and other methods to see if there was any other way to get around that exception, but nothing I did turned out any different response.

Here's how I sent a typical request with just a link (just using plain-vanilla PHP with cURL):

// Set up params to be posted to Facebook.
$params = array(
'title' => $title,
'link' => $url,
'description' => $link_description,
'caption' => $link_caption,
'access_token' => FACEBOOK_APP_ID . '|' . FACEBOOK_APP_SECRET,
// Post the message to Facebook.
$url = 'https://graph.facebook.com/' . FACEBOOK_PAGE_ID . '/feed';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, count($params));
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
$result = curl_exec($ch);

Now, to get the message to post without throwing the strange OAuthException, I have to send everything in the 'message' of the post (with no link attached). You can pass along other params, but if you pass anything in the 'link' param, you'll get the error at the top of this post.

// Set up params to be posted to Facebook.
$params = array(
'message' => $title . ' — ' . substr($description, 0, 350) . '...' . "\r\n\r\n" . 'Source: ' . $url,
'access_token' => FACEBOOK_APP_ID . '|' . FACEBOOK_APP_SECRET,

There's an open bug for this on Facebook's Developers site, but it's been triaged as 'low priority', so I don't know if it'll ever be fixed. I just wanted to post this so any other frustrated developers don't have to spend a few hours scratching their heads over the same issue.


Posting on pages, if the param object contains a 'link' it throws error. But same thing if you post on your wall it'll work. I don't know why is this although link is a valid field as here show https://developers.facebook.com/docs/reference/api/link/

Something new in this case? I have the same problem with posting on my Facebook page. Thanks for more info.

Not yet, unfortunately.

I tried this today and it's working. But link has to end with '/'.

Hey Jerry, could you please let me know which fields to you attach to the request? Because I am still getting "An error occured while creating the share" error

Dear all, I am not PHP guy, but good in Java... I using Native API and APP access token to achieve Posting link, Feed or send notification to the user:

Following are links and their Parameter with Post Method:
To Post Link and Feed:

To Post Notification:

Another Important reason why on get Error Code-1 unknown is:
When One set App from Web to Native/Desktop , he/she should set [App Secret in Client: to [No] ]

Works if i put something like www.example.com.