Graph API: Adding Captions To User Generated Photos - facebook

I'm trying to get my application to post photos to a user's timeline using the user generated picture feature of Open Graph. Unfortunately, while I can easily get the picture to the user's timeline, I haven't found any documented way to pass along a caption.
Instagram seems to have figured it out: http://i.stack.imgur.com/TYsiX.png
Yet, if you go to the page of one of their posts, you'll notice that the caption isn't present in any of the Open Graph meta tags, so I'm guessing this is a value passed along with the POST.
Any suggestions?

There is an optional message attribute that you can pass to the action:
https://developers.facebook.com/docs/opengraph/define-actions/
Under optional arguments.
It takes special approval when you submit your action for approval

You should add "User Messages" Property in the followed image.
And then Give your caption in "message" tag.

Related

Facebook API - How to post a website link with a custom image?

My goal is to post to my FB page (/{page-id}/feed) a link to a website, choosing the image to show instead of the picture scraped automatically from the web page. The image I'd like to show is not in the web page, so I cannot use the og:image tag.
I'm using the current API (v2.9) and this is what I've tried so far in the Graph API Explorer:
the picture parameter, that does not work as expected (it doesn't replace the automatic image)
picture and link parameters both pointing to the image url, with an action button, but it must have the same url used for the link parameter
the child_attachments parameter, but I need at least 2 images and the final result is quite different, too
additional fields of the link parameter, but thy were removed in the 2.9 API
a lot of combinations between these parameters, with no luck
What am I missing?
For information regarding why it isn't working. I assume they removed it to force users to add it to their website like Twitter did with their Twitter cards and maybe to stop impersonating pages.
https://developers.facebook.com/docs/sharing/reference/feed-dialog#deprecated-params

Open graph story posted successfully using graph API but not seen neither on the timeline nor in the Activity Log

I am posting an Open Graph story using the graph API but the post is not shown anywhere on my Facebook wall and there is nothing in my Activity Log either.
I configured the story in the App dashboard. The object has one custom property and it is a self hosted object with a public URL. I used the object debugger tool https://developers.facebook.com/tools/debug to make sure that all the metatags (including the one for the custom property) are there and no errors are shown.
Then I make this call to post the story:
https://graph.facebook.com/me/namespace:action?access_token=ACCESS_TOKEN&method=POST&result=MY_OBJECT_PUBLIC_URL
and I get the post ID in the response:
{
"id": "SOME_ID"
}
I can even get all the information related to the post using the graph API with the Post ID returned.
HOWEVER, I DON'T SEE THE POST ANYWHERE ON MY FACEBOOK WALL, NEWS FEED or ACTIVITY LOG.
Any ideas of what might be happening?
I am having a related problem (I think). Let me first say that I use our own Action Types and Stories (i.e. https://graph.facebook.com/me/:).
What I noticed is that while the action does not appear on my wall, it shows up on my friends' News Feed (so even if I can't see it, they can "like" and "comment" on it), and also putting it's ID on the Open Graph Action Debugger tool, I can see the post's details.
BUT, what I also noticed is that it shows up in my activity log! (button on the right-bottom position of your cover image) Then, if you go to each activity entry, there is a small icon on the right with a pencil on it. Clicking on it, it shows that this means that the activity/action/post/whatever is "allowed" on your timeline. But, if you change that to Show to Timeline, it will actually be shown!
So, I think this is where you/we should look further (for example a setting/permission request to enable this by default -- not sure if anything like that exists though).
First at all you need to get approval for every item of your open graph story. You can test your application without approval un-publishing it and adding some user as testers in the Role settings.
Now, to see your open graph activity in your timeline after publish you should configure the Additional Capabilities for you action type. So you need to check the Explicitly Shared option in the Capabilities section for you action. After that you need to include the parameter fb:explicitly_shared=true in the open graph call.
You can take a look to the Additional Capabilities here : https://developers.facebook.com/docs/sharing/opengraph/using-actions#capabilities
Explicit shared should be added in the post parameters.
Refer this link
You may need to enable the 'explicity shared' setting for the open graph action in the Facebook Developer App Dashboard in the website.
You need to add "fb:explicitly_shared" action parameter with value 'true' while posting it.
Also you need to toggle explicitly_shared in Actions' properties configuration page.
You need to be an administer of the app otherwise you will need to get the Stories approved by Facebook.
Hope this could help.
I could totally be wrong, but you may need to submit your Open Graph action to Facebook for approval. And you'll need to set explicit sharing if you want your action to show in places other than your own timeline and activity.
I say I could be wrong because you should at least be able to see your action within your activity log. It's difficult to say without looking more closely at your Open Graph Action and Object.
I had the same issue, I could post the stories but could not see it on the timeline, issue was FBDisplayName in the app has to be same as the one configured in the FB developer console.
make sure to add the Canvas URL under the "App on Facebook" section, I hope it works for you

Facebook like button - like content

I got my facebook like button generated, and prepared it so user is able to like each post on my forum. The href attribute is set to the thread and certain post url, but when I click the like button, facebook is getting the logo, and the title of my forum for the liked post, instead I would rather want an user avatar and the post title to be posted.
Here I have pointed the element I would like to change, because it doesn't fit the post informations, but the whole page informations.
Are there any possibilities to change those?
Adding these tags should fix your problem:
http://davidwalsh.name/facebook-meta-tags

Including a link in a facebook Post from the api

I am using the restfb Java api (from Scala) to post to Facebook. I have two questions.
i) If you put a link in the message field of a post, it will automatically be rendered as a link. But what if you want to include link text instead of the href in the post message? Including Dude gets rendered as a string. But clearly there are many examples of things like "Hey, check out this car , where car is a link. How do you do this?
ii) Facebook is including the description of my company in each post. I set the description field to the empty String and its still showing up. I even removed the description from the settings page for my Facebook app and its still showing up. Any ideas?
Thanks.
Instead of putting the link in the message parameter, you can put it in the link parameter of your HTTP POST to the Graph API. Otherwise, it cannot be done with an inline link that has text (like what you can do with normal href's).
I don't know of a way to remove a description meta tag once it's been set. Try just a period instead of an empty string to see if that works.

Make Facebook _not_ automatically select a thumbnail from a page?

I'm using the Graph API to post to a user's wall via a 3rd party website. The update contains a link to said 3rd party website. (In functionality, it's kind of like just putting a Facebook "Like" button on the 3rd party page, except I want some more finely-tuned control over how the caption looks on Facebook.)
I am not specifying a picture for the post. When the post is created, Facebook's bot automatically connects to the 3rd party page specified in the link and selects an image to use as a thumbnail. Sadly, the image is almost never relavant, and I would just rather Facebook not look for a thumbnail at all.
I can probably put some Open Graph tags on the page to help out Facebook's bot, but I don't see a way to use Open Graph to specify that you'd like to have no image, and that Facebook shouldn't choose one automatically.
Any way to do this?
Although Facebook seems to ignore the picture set to an empty string in the Graph API call, setting an Open Graph tag for the picture which is an empty string seems to have done the trick.
When you publishing the the stream, include the "picture" property in the request and just set it to an empty string. This will ensure you dont have a url on the post. My other suggestion would be to put the Open Graph tags on the pages you are sharing. This will ensure that both you and others who share the url will have the correct data and images show on Facebook. http://developers.facebook.com/docs/opengraph