Unable to publish to facebook feed - facebook-graph-api

I operate a website, http://www.plingo.com.br/
I have created a like button for that webpage, as well as specified opengraph tags that point back to the same URL and included a video.
I have set the og:type tag to 'blog'.
When someone clicks Like, the video and URL get posted to the users feed as expected.
However, my issue revolves around being able to publish to users of my feed.
As you can see in my opengraph tags, I have associated my URL to a facebook application that I own.
I have followed the instructions at developers.facebook.com/docs/opengraph/ on how to publish to my feed directly, however when I run the PHP script, I receive this error:
"error": {
"message": "(#100) (the url) does not resolve to a valid user ID",
"type": "OAuthException"
}
However, the opengraph at the URL points both to my facebook account as well as my application.
I have no idea why I am unable to do this.
However, to try to diagnose the issue, I made a similar webpage at http://www.plingo.com.br/ogtest.php and set all the attributes of the opengraph tags the same, except for the og:url and the youtube video. Running the publish script using that URL however, works fine, and facebook even generated an administrative page for publishing to facebook.
I am wondering why this is not working with my root URL. Is there any way to get Facebook to give me an Administrative Page? Why can't I publish, even though I have associated the opengraph IDs properly?
I would GREATLY appreciate any input as I have tried countless different things, changes, etc to see where the issue lies.
Thank you

Related

How to determine why a facebook page URL will not return a facebook id?

For the most part, using the graph api, passing in a Facebook page's encoded URL returns the normal facebook id.
For instance, using the Graph API Explorer and passing in https%3A%2F%2Fwww.facebook.com%2Fkendalljenner returns
{
"name": "Kendall Jenner",
"id": "173567062703796"
}
However, for some (pretty rare) FB pages, like http%3A%2F%2Fwww.facebook.com%2Fmargotrobbie, I get
{ "id": "http://www.facebook.com/margotrobbie" }
The question, Why do some Facebook urls not return their Facebook page id through graph api?, suggests that the issue may be that the page is restricted somehow (like for alcohol content). I believe this may be the case, because the Harley Quinn videos in the posts are a bit graphic, but I searched all the info for the page and it doesn't say anything about the content being restricted. In addition, I am using a User access token that is allowed to see the page via normal FB web interface without any apparent restriction.
BTW, for anyone who hasn't seen this before, the id set to the url seems to be the result when facebook doesn't know anything about the URL. Obviously this shouldn't be the case for facebook's own URL.
Not sure what the reason for the apparent difference with the two page URLs indicated, but I did solve the underlying problem of getting the facebook id of the page!
First of all, I had tried the process described here: How to get page id of facebook page, however it wasn't working for me. In my effort to permute all options, I had changed the access token to a "user access token". Turns out, you HAVE to have an "application access token" as is well-documented in said article.
Thanks to CBroe for making me question how I was calling the API...no matter how long I was calling it this way.

Is it necessary to create pages with the recent changes to the Facebook like button?

I was reading over the changes to the Facebook Like button that are scheduled to take place in November 2012, and I'm a bit confused (and hoping someone has an answer).
I understand that the REST endpoints are being removed in favour of regular pages, but here's where I'm confused.
Previously, if I did the following...
Create a page
Add the correct OpenGraph metatags to the page
'Like' the page
... Then an OpenGraph object would be created automatically (and could be verified by visiting http://graph.facebook.com/?id=my_url). If I published to that OpenGraph object, people would receive updates.
However, with the changes, if I understand them correctly, the OpenGraph object is no longer created? Or it is created, but I still need to create a Facebook page to administer and send messages?
Any help would be appreciated.
However, with the changes, if I understand them correctly, the OpenGraph object is no longer created?
That phrasing is a little besides the point.
You create the Open Graph object, by setting up a page with appropriate OG meta tags.
And Facebook will count likes for this URL, like for every other URL.
Or it is created, but I still need to create a Facebook page to administer and send messages?
No admin pages will be created automatically any more; although you can convert existing ones to normal public Facebook pages. But then you have to point the like button to the URL of that new Facebook page instead of your OG URL to be able to publish updates to your fans. (So this will behave basically like a normal Facebook page that was set up to be one in the first place; only this step allows you to “migrate” your existing likers for your OG URL to that page, so you don’t need to have a “fresh start” with your Facebook page.)
The document further describes, what to do if you still need the ability to publish updates to the users liking your OG URL – by providing fb:app_id and fb:admins meta tags:
“This will ensure that the Like Button admin link still appears on the given Open Graph page. The admin page for a given Like Button is also accessible to administrators from https://www.facebook.com/bookmarks/pages”
But publishing updates this way will only work until the Like Button admin page is fully deprecated. From then on, you will have to use a Facebook page, if you want to be able to publish updates to the users who liked your page.

Facebook unreliably reading OpenGraph attributes when publishing to newsfeed through Graph API

We have a Facebook app that publishes URLs to a user's newsfeed via the Facebook iOS SDK. These URLs are for pages that have OpenGraph attributes defined and we've verified in the Facebook Linter that it's correctly defined.
However, periodically we are seeing that Facebook won't correctly parse the OpenGraph attributes and have less than a stellar post to Facebook:
We will most often get posts parsed correctly resulting in posts like these:
We'll periodically get posts like these:
However, you can see this later post works correctly in the FB Url Linter: https://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fchewsy.com%2Fr%2Fa%2F1bhLT.
However, sometimes the URL Linter will report a 503 but I see nothign in our logs. And even more odd, when the URL Linter reports the 503, it will shows that it can read the OpenGraph attributes defined. See this screenshot:
Since this is inconsistent, my first guess was this was a Facebook issue so I opened a bug. However, since I'm not seeing this issue rampant in the newsfeed with other apps, I'm starting to wonder if we aren't following the right steps to publishing FB content.
For example, are we supposed to post to the URL Linter first, then publish via the Graph API? This seems like a ridiculous extra step, but I'm grasping at straws here...
It's probably due to fact that in a time Facebook Linter visited your site it wasn't accessible, just couple of refreshes on a Linter Tool with URL you've provided resulted in Bad Response Code error, returning 503 status code:
http://chewsy.com/r/a/1bhLT"">
You should dig in logs of your application/site to discover the real reason why this happen and fix it.
Just a quick note that this should no longer be happening for CloudFlare users. We pushed a fix for the 503 debugger issue moments ago that appears to have fixed the problem. Please contact us if you see any other issues with the Facebook Debugger.

Actions do not appear on timeline

I'm developing an app which publishes actions to the timeline.
On the app settings, I've created the action "post" and use the built in object type "article".
Although my graph actions have not been approved by facebook, that should not be a problem, because I am logged in as the developer of the app.
My article URLs pass facebook's linter with warnings, but no errors.
When my app notifies facebook of the the post action, it appears to succeed. Facebook returns an ID representing the action.
When I use facebook's graph explorer to view that ID, the data appears to be correct, showing the correct action type and object data. (If there's a URL to browse the action on facebook, instead of the graph explorer, I do not know what it is).
Still, with all the above apparently working without errors, I never see the action on my timeline. Whether I browse my own timeline, or when logged in as a friend and another developer of the app, I never see any indication on facebook.com that the action was performed.
What am I missing to make my custom action appear on my timeline page?
I had a similar problem. I was using OG and I could post everything successfully, but the posts didn't appear in timeline, but only in the activity log in Facebook.
I just went to the settings of the action and set "Explicitly Shared: This action can specify the user explicitly shared an action." to ON.
Then in my piece of code I put "true" to the key "fb:explicitly_shared" while creating the OG object.
If no error is being returned it sounds as if there is an issue in your public page that is preventing Facebook from knowing what to post.
Have you double checked your OG: meta tags through Facebook's validation tool [ https://developers.facebook.com/tools/debug ]. While you need all of the values to be filled in, the type bit is the most overlooked and must be setup properly to link to your particular application and corresponding action.
If your OG: data is correct and validating you should also check the detail settings for your action and aggregations. If the phrase / tense bits are not filled in Facebook may be uncertain how to make your post appear back to on the timeline.
Discoverd the problem....
My article page include an article:author tag. The URL in that tag was not visible to anonymous users. So, I'm guessing, facebook visited that author URL and received a HTTP 403.
When I removed the article:author tag, the items started appearing on my timeline.
So be careful with all tags and put all urls through facebook's debug tool.
Hmmm Interesting
Was having the same issue...
Using the XFBML, fb:like with all required og meta tags validating on the linter.
Last month when I liked a 'product' on my website, the post was published on my fb timeline wall no worries. Nice, perfect!
Today after clicking Like, I noticed it wasn't publishing to my timeline wall at all... but was logged in the Activity Feed.
It did however post to my wall if I commented on the Like Button flyout comment section.
Then I found this
"Pages of type article do not have publishing rights, and will not show up on user's profiles because they are not real world objects."
https://developers.facebook.com/docs/opengraphprotocol/#types
I've been getting the same issue with a feed dialog post. The posts can be navigated to directly, but doesn't show on timeline. More details here:
Actions not appearing on timeline
I had a similar problem, but everything was actually working correctly. If you get a returned ID and your article appears in your RECENT ACTIVITY, then all should be good.
The perceived issue, your post not appearing in your timeline, is actually the correct behavior. Your post doesn't appear in your timeline because it should appear in your friends' timeline as an activity that you completed. Once they comment or like it, then it should reappear on your timeline.
For me the issue was the posts doesn't show on timeline for all users except me also it was public !, i fixed it by make turn on application as online to be available to all users

me/feed with pic from different domain

I was trying to find this on facebook's site in their documentation but so far no luck. I'm sure others must have run into this before.
I use Amazon S3 for storing images. I didn't know ahead of time that if I named my bucket as my domain name with subdomain I could link that way, so until I move all of the pictures I have to link to mybucket.s3.amazonaws.com domain. When I include a picture from there with a post to the wall the picture doesn't show up. If I change the picture to one on the server itself the picture does show up. It seems that the domain name of the picture must match my app? I looked at bugzilla and didn't see this mentioned. Facebook's forum says to post questions here.
I'm using the C# Facebook SDK from CodePlex.
My code looks like (with error handling and authentication check removed):
var client = new FacebookClient(FACEBOOK_APP_ID, FACEBOOK_SECRET);
client.AccessToken = facebook.AccessToken;
var parameters = new Dictionary<string, object>();
parameters.Add("name", name);
parameters.Add("caption", title);
parameters.Add("message", message);
parameters.Add("link", link);
parameters.Add("source", link);
parameters.Add("picture", imageUrl);
client.Post("me/feed", parameters);
I verified that imageUrl does indeed have a correct picture, the domain name just doesn't match. The picture on amazon s3 has public read access. I can view it from my browser so I don't think it's a permission problem. I've tried a few different pictures with the same problem. Only time it's worked so far is when the picture was on the server itself.
So, my question is, is it a problem with me, or does facebook block images that don't match the domain name specified on the app?
You can upload the picture from that url, then add its object id in the post.
Refer to: http://developers.facebook.com/blog/post/526/?ref=nf
Uploading Photos to the Graph API via a URL
Earlier this year, we released support for uploading photos directly
via the Graph API. This requires sending the photo as a MIME-encoded
form field. We are now enhancing our photo upload capability by
introducing the ability to upload photos simply by providing a URL to
the image. This simplifies photo management for a number of use cases:
App developers who host their images on Amazon S3 or a similar
service can pass the S3 URL directly to Facebook without having to
download the file to their application servers only to upload it
again to Facebook. This improves performance and reduces costs for
developers.
Apps written on platforms that don't have good support for
multipart file uploads can create new photos more easily.
To upload a photo via a URL, simply issue an HTTP POST to
ALBUM_ID/photos with the url field set to the URL of the photo you
wish to upload. You need the publish_stream permission to perform this
operation. You can also include an optional message parameter to set a
caption for the photo.
I'am facing the same issue as well. Based on my observations it seems that facebook does not like it when the picture url has more than one sub-domain.
I tried the below 2 URL variations for the same image..
mybucket.s3.amazonaws.com - throws an error
s3.amazonaws.com/mybucket - works fine
:picture => 'http://mybucket.s3.amazonaws.com/footprints/15/coverimgs/medium.jpg'
OAuthException: (#100) picture URL is not properly formatted
:picture => 'http://s3.amazonaws.com/mybucket/footprints/15/coverimgs/medium.jpg'
{"id"=>"587472956_10150280873767957"}
Now i have to figure out how to change the URL structure for the image while passing it to the FB graph API.
I would log it as a bug. If this is really the case, which I kinda doubt, you could create a 301 redirect on your own domain for each image that redirects to the Amazon url.