Facebook Opengraph Console error - facebook-graph-api

Hello people i am trying new action to post picture on facebook and during posting i am facing a error which i cant able to make it work properly
The action you're trying to publish is invalid because it does not specify any reference objects. At least one of the following properties must be specified:

for posting your action, with Javascript SDK for posting image you should try something like:
FB.api('/me/bhlolzspot:laugh_out_loud', 'post',
{ funniest_picture : 'OBJECT_URL',image[0][url]=http://www.yourdomain.com/images/image.jpg,image[0][user_generated]=true });
I am assuming laugh_out_loud is your action name and funniest_picture is your object name.
at OBJECT_URL, all your meta tags should be in place and i can see there is a missing og:image tag, there you should put the image you want to post with action on facebook.
hope it helps.

Related

Missing Posts when Accessing /me/feed via Graph API

I am currently attempting to retrieve all the posts on my Timeline via Facebook's Graph API. My Likes and Links and Posts appear to retrieve just fine, but posts from friends do not appear to be displaying.
For instance, a friend shared a link on my timeline, and that is currently not displaying in the returned data in my request to /me/feed.
I've tried turning on all permissions, but can't seem to get that particular post in my return data. Is there something obvious I'm overlooking?
Thank you for any assistance,
Michael
If a users permissions for a post are set to anything other than public if could be omitted from the result set.
Check the privacy for that missing post.
refer to: https://developers.facebook.com/docs/reference/api/privacy-parameter/
me/feed privacy: https://developers.facebook.com/tools/explorer/145634995501895/?method=GET&path=me%2Ffeed%3Ffields%3Dprivacy
Please test with Graph API explorer, https://developers.facebook.com/tools/explorer/?method=GET&path=me%2Ffeed, click "Get access token" button and tick "read_stream" check box under "Extended Permissions" tab. Then submit and proceed authentication process.
After authentication dialog done, click "Submit" and try to test to get the link shared by your friend. I've no problem to see this kind of feed. Of course, you can create a new account and behave as your friend for easier to test, otherwise you need go through pagination to get the target feed.

Facebook graph api post using "/me/feed" vs "/me/links"

I've recently switch my code to post to facebook from
https://graph.facebook.com/[profile_id]/feed
to
https://graph.facebook.com/[profile_id]/links
Now i'm getting this problem, can anyone help?
- my picture that i accompany with the post is not showing, it look like facebook is defaulting to the first image it find on the link page
http://developers.facebook.com/docs/reference/api/post/
http://developers.facebook.com/docs/reference/api/link/
both of these document allow me to specify a picture, but somehow the "links" one isn't displaying the image.
Thanks in advance
Set correct Open Graph meta tags, especially og:image.
I just resolved similar issue, posted news on website and posted via /links to fanpage resolved in post with wrong image content and "site not found" title.
The issue was related to wrong code sequence. We hooked posting news via fb api in not-so-good place. The post should have been already available but it wasn't and posting to fb api results in immediate request from facebookexternalhit bot to check if it exists. Detailed log analysis shown that ping from facebook was before POST to add news finished, that's why we had messed content there.
Sample content we post, if what I described above is not your case:
content_dict =
{
'picture': 'http://www.czerwonysmok.pl/static/media/uploads/blog/pb_reddragon_all2_poprawiony_czerwony.jpg/',
'message': 'Title \n\n contentcontentcontentcontentcontentcontentcontentcontent ',
'link': 'http://www.czerwony-smok.pl/klub/aktualnosci/rashguard-ze-strony/'}
try:
logger.info("Publishing to facebook: " + str(content_dict))
graph.post(path="%s/links" % settings.FAN_PAGE_ID, **content_dict)
About sharing on my Android app i'm using this code:
Bundle postParams = new Bundle();
postParams.putString("message", "User's custom message above share content");
postParams.putString("name", "The name of the link attachment.");
postParams.putString("description", "The description of the link (appears beneath the link caption). If not specified, this field is automatically populated by information scraped from the link, typically the title of the page.");
postParams.putString("caption","The caption of the link (appears beneath the link name). If not specified, this field is automatically populated with the URL of the link.");
postParams.putString("picture","The URL of a picture attached to this post. The picture must be at least 200px by 200px. See our documentation on sharing best practices for more information on sizes.");
postParams.putString("link", "The link attached to this post");
Refer to the document for detail: https://developers.facebook.com/docs/sharing/reference/feed-dialog/v2.3

Unable to publish to facebook feed

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

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

Re-sharing posts from an app

When I am posting to my wall directly, then my friends have an option to "re-share" the post by clicking on "Share" link (last one in the list of actions: Like * Comment * Share). However, when I post from an application, there is no "Share" link and only Like and Comment actions are available.
Is there a way to change application or application preferences to enable direct re-sharing for posts from applications?
You can post a "Link" to User's wall with a "link"-field to the Original post like "http://www.facebook.com/{{$fb_id}}" and you can add a "message" to that as well.
UPD: for reSharing a "Picture" you either "generate" a link like "http://www.facebook.com/photo.php?fbid={{$fb_id}}" or request Picture via GraphAPI and use it's "link" field. this is valid for other FB-Graph-Types.
Here is how it is done In Graph API do this..
post me/feed
message : YOUR_MESSAGE
link : link to share
actions : {name: "share", link: "linktoshare"}
Refer these
https://developers.facebook.com/docs/reference/api/user/#posts
http://developers.facebook.com/docs/guides/mobile/#android