Posting using App Access Token - facebook

I am trying to publish a feed using graph API using application access token. I am trying to achieve a result similar to the one in the URL below:
Sample Image
I am able to create a feed but following two things I am still unable to figure out:
1) Linking the text in the feed to my application. Currently by clicking on the picture tag or name tag the user is redirected to the external link of the image (used in picture tag)
2) As you will notice in the image there is custom link button next to Comment. One says "Bonus Cash" and other says "Get Simoleons". How to do that?
I am currently using following graph api code. And in order to test it I am currently using Graph Api Explorer.
http://graph.facebook.com/myfbid/feed?&picture=http://www.link.com/linktoimage.jpg&name=Name Tag&caption=Caption Tag&description=Description Tag
If I add link tag to the above code than the type of feed changes from "via Application Name" to "shared a link via Application Name" and that is not what I want to achieve. I want it to say "via Application Name" like it is for other applications like i shared in the image above.

1) Linking the text in the feed to my application. Currently by clicking on the picture tag or name tag the user is redirected to the external link of the image (used in picture tag)
If you want a post to link somewhere – then actually post a link (parameter), and not only a picture.
Edit:
The “posts” in your screenshot might be Open Graph actions published for the user, though. That’s a completely different concept altogether; start reading about it here: https://developers.facebook.com/docs/opengraph/
2) As you will notice in the image there is custom link button next to Comment. One says "Bonus Cash" and other says "Get Simoleons". How to do that?
Use the actions parameter.
Both are explained in the docs: https://developers.facebook.com/docs/reference/api/user/#posts

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

Show app name next to the icon in news feed

When I post is published using the application on facebook, there is a small icon below, next to the like button. I want to add application name or some custom text right next to that icon. Below is a screenshot of twitter app that does what I mean. Posts are published using open graph api. Any ideas?
Those are called actions, and you can add them by sending an array of JSON objects as a parameter to your post call.
Example:
actions=[{'name':'#JemalaTony on Twitter', 'link':'http://twitter.com/#!/JemalaTony'}]
Source: Graph API > Post

What part of the Facebook Graph API should I use to post content with custom actions?

I am looking to publish similar content to the following snippet from my application:
The most important tidbits here are the following:
a photo
a link
a text blurb
I'm not entirely sure where in the Graph API it makes sense for me to explore to do this. I'd like for it to show up in people's newsfeed that approve the action.
The SocialCam example in your picture is using the Open Graph part of the Facebook API. Open Graph allows you to define custom actions and custom objects for your app. The idea is to allow the user to express more specific, high-level actions beyond like, comment and share. In your example, "watch" is the Open Graph action, which is a build-in Action Type. Video is the Open Graph object, a built-in Object Type. Note that "Object" in this context is a type not an instance.
It is possible to define your app's own actions e.g. "review" and link it to custom objects e.g. "Action Movie", "Comedy" etc. You can also define properties for your actions e.g. "Rating" for a review action.
However, if all you require is a "photo, link and a text blurb" you don't have to use the Open Graph but can use the Graph API. You can post a link to a video or image by issuing a POST to:
graph.facebook.com/USER_ID/feed
with params
message
name (sender's name)
caption
link (your url)
description
picture (url to picture)
where USER_ID is the user who's wall you want to post to.
I'm pretty sure they are have set up a a facebook application and defined an action called "watch" and an object called "video". they then publish it by making a post to facebook's graph api.
Facebook walks you through some of the basics while in the management menus, once you've set up a developer account and created an application
Go through links one by one and having step by step guide from official sources. You will be able to achieve your goal.
https://developers.facebook.com/docs/opengraph/tutorial/
https://developers.facebook.com/docs/customopengraph/walkthrough/
http://developers.facebook.com/docs/opengraph/objects/

Publish app wall share option

I have read a guide for publish link to my wall or my fan page. Here is the guide: net.tutsplus.com/tutorials/php/wrangling-with-the-facebook-graph-api/
This is my application test:
http://www.onlyimagination.com/mytest/source/
The application works, but i don't want GENERATE the link manually, i want only SHARE.
This is the screenshot of the publish of this app
Instead I would just put the link and my application AUTOMATICALLY extracts all the links like this sharing of information here in this screenshot.
The info presented in the 2nd screenshot is just the info of the picture that facebook has.
In order to tell facebook how to present your links you need to use the Open Graph protocol (you can also use the Open Graph docs).
With this protocol you define properties which facebook knows how to extract, such as title, type, image and more.
This means that the response for every link you want people to share on facebook should contain the og meta tags.
Edit
Sorry, did not think about adding this before:
You can use the Debugger tool to see how facebook "sees" urls.
You see, what happens when a user shares a link is that facebook has a program that send a request for the shared link, it then parses the response and search for specific tags to extract the data which is then presented to the user.
For example, try the Debugger for google.com and see what info was extracted, then try to share it and see that it uses the same info.
Also, at the bottom of the Debugger result, there's a link Scraped URL: See exactly what our scraper sees for your URL if you click that you see the actual response.
Hope this clarifies it.
2nd Edit
I don't know how you publish your posts in your app (next time it could be easier if you just add the code you use), but it doesn't matter how you publish it (js sdk or from the server side) you always have two options:
Post a link that has the og meta tags in it, those will tell facebook how to display the link
Add the link, picture, name, caption and description fields when posting (js sdk for client and graph api for server)