I am building a website that will require the user to provide permission for us to post a story back to the users wall when the user takes an action on my website. I would like the story to include a link back to my website so that friends can see the actions taken.
I am not sure of the correct permissions because I cannot get a link back to my website from the story post. I saw publish_stream, but that appears to be old now. Any pointers to FB policy and documentation would be appreciated. I
Instead of making stream posts, you should instead use Open Graph actions, which will give you a much better result and feel less 'spammy' to your users. I can't post code that will do this for you as it would need to fit into your existing setup, however it is a relatively simple process, which is well documented (https://developers.facebook.com/docs/opengraph/actions/):
Auth users by prompting them to give publish_actions permission and any other permissions your app might need.
Store the users access token in your database (not necessary if you're using the client-side Javascript SDK, but you might want to do it anyway)
Setup your Open Graph Actions and Objects in the Developer Dashboard.
When a user performs a relevant action in your app, make a simple Graph API call to the following endpoint:
https://graph.facebook.com/me/YOUR_APP_NAMESPACE:YOUR_ACTION? YOUR_OBJECT_TYPE=YOUR_OBJECT_URL&access_token=YOUR_ACCESS_TOKEN
Done.
You can add extra elements to the action, such as action links, however the basics are outlined above. Once you've performed those steps, the user will see something like this on their Timeline:
The part that says 'on NYCCookbook' is customisable and clicking on most parts of this story will bring Facebook users back to your site. There are many benefits you can get if you implement this all correctly.
Related
I have a FB page that is a member of about 10 groups (all related to the same topic), and sometimes when I post I share the post to these groups.
Since it's so tedious to manually share the post to each group, I thought maybe using the API could be a better way to share my post into these specific groups my page is a member of. But FB seems to require that I enter some business details for a business that doesn't exist.
I don't own a business, this is a page to share educational tips and such. So I created an app (kept it in dev mode) and I'm the only administrator. I don't plan to make my app public, create an interface or have anyone else use it, and I don't intend to use it with any pages other than mine. Plus, I've already provided my personal ID so I am verified as an individual:
But still, if I want to get manage_pages permission I'm required to go through some business verification and show FB how I'll use the API in a video, when I don't have any of this. In the verification page I'm requested to upload an icon, a privacy policy link and confirm commercial use:
Should I just make up some fake business information so I can give them what they want? Is there not a way to use the API for personal use?
I'd be happy with just being able to send a couple cURLs to share my post through a terminal instead of having to do it via the FB GUI.
The only requirement to complete review by business verification is to manage more than 3 pages per user, otherwise you can complete via individual verification. However you say pages and groups so it's not clear if you refer to publishing to a page feed or to a group (which requires additional permissions/features besides only manage_pages). And no, you shouldn't fake official documents just to complete business verification if you don't have a business...
I'm currently toying with the Facebook Graph Api and have been able to get some interesting results, I would like to be able to post to one of my Facebook App users pages. They have authenticated the app and confirmed the ability for my app to be able to post on there wall. I know there is the can_post check using FQL, but I haven't seen any information on this using the Graph API. Is there a possible check to make so I can see if I have the ability to post on there wall?
can_post
https://developers.facebook.com/docs/reference/fql/user/
This settings is actually a setting of the timeline:
This setting only affects the viewers of the specific timeline and does not apply to the owner of the timeline.
can_post - bool - Whether or not the viewer can post to the user's Wall
Beyond this settings, by authenticating an application and giving it certain publishing permissions, the application, using it's per-user per-app access token will be able to perform actions on behalf the actual user. Actions will be attributed to the user even though it is the application that initiated and published these stories.
To answer what I assume is your underlying question - your application, given the appropriate permissions, will always be able able to publish a story to the users timeline. The act of giving an application any permissions is the same as allowing the application to act as you and access everything you would be able to access. This includes posting a story to your own timeline (even if no other user would be able to).
OK, I need some help understanding the process behind Facebook's website integration process and how I can integrate it into my web app....
In its most basic form, my site stores and displays users' comments about products (there's more to it than that, but that's all that's relevant for this question). What I'd like to do is allow them to post that comment, together with the name of the product (and my site), to their Facebook wall by clicking a button.
I do not need the users to log in to my site at all, either with Facebook or any other authentication system and the Post to Facebook part is optional.
Obviously if they decide they do want to post their comment to Facebook, then they'll need to login, but I'd rather temporarily take them away from the page to login, post and then be brought back to my site.
What I need to know is how much of Facebook's APIs, Open Graph and Auth systems do I actually need to integrate?
I had hoped that I might be able to generate a simple link to Facebook with their comment embedded as a POST element...?
I'd be really grateful if someone could point me in the right direction!!
(P.S. I need a similar solution for Twitter, but I think that's easier!?!)
The Feed Dialog doesn’t allow including of a pre-set message any more, so you’d have to make that post via the Graph API if you want to pre-fill the message (and even then, you should only do so, if you’ve given the user the possibility to edit the pre-filled message first).
See here for how to make a post on a user’s behalf via Graph API, https://developers.facebook.com/docs/reference/api/user/#posts
You can do that all client-side, if you embed the JavaScript SDK into your page.
You need to set up an app on FB, then have the user connect to it (using FB.login), ask for the necessary permission (publish_stream) while doing so, and after successful login use FB.api to make the Graph API call.
This question has been asked many times before, but they all seem to relate to problems before the Open Graph was 'opened'. As a new user, I also can't make this question useful, i.e no images or links. If you want to see the images I've posted, you'll have to copy and paste.
First of all, my Action is approved.
http://i.stack.imgur.com/hAFHr.png
Additionally, the action shows as being available to all users.
http://i.stack.imgur.com/IrrWW.png
publish_actions has been added to the Auth.
http://i.stack.imgur.com/PdJiA.png
I also have objects and aggregations setup correctly.
The auth preview also shows the correct settings (although the dialog currently doesn't stay open to see it, it used to).
When I try and connect with FB to the site, I don't see publish_actions. Instead I see the second stage of the dialog, for publish_stream. I set this by mistake the first time I saved the app, but quickly changed it.
http://i.stack.imgur.com/n819f.png
http://i.stack.imgur.com/gkXfg.png
This is where I think it gets even stranger. If I take a look at the FB profile for one of the app developers, and click through too the app from there, while not registered, I see the correct permissions.
http://i.stack.imgur.com/SsOVI.png
Yet another twist to the tale, which makes it even harder for me to debug, is that it seems since playing with the aggregations, I can't even get publish_actions permissions despite being listed as an app admin. (I've read that every action needs an aggregation before FB will process any actions sent by the server.)
/**/ FB.ApiServer._callbacks.ff2f1615c({"error":{"message":"(#200) Requires extended permission: publish_actions or App must be on whitelist","type":"OAuthException","code":200}});
That's the error I get when I complete the action on the site, http://purple.fr/boutique
Have I missed a setting somewhere? Have I done something I shouldn't? Should any of this be controlled in the code on the site?
When a user connects to your site, you should be asking for the publish_actions permission instead of the publish_stream permission. The referral dialog settings (where you already ask for publish_actions) only works when a user clicks on the action from within Facebook. It won't work for users already on your website.
In your login function (FB.login), make sure you add the permission publish_actions.
That aside, it looks like it's all working now.
http://i.stack.imgur.com/jAosv.png
http://i.stack.imgur.com/Wbgf5.png
I recently put a django project of mine into its beta stages and would really like to integrate more with social media, particularly facebook.
Now there are so many facebook integrations out there... I don't know where to start but, I'll tell you what I am after.
My sites publishes content with photos and also user related data (which site doesn't)
on each individual page I already have a facebook like button that basically has the absolute url of that page
so for instance:
http://my-site.com/url-1
http://my-site.com/url-345345
http://my-site.com/url-456456456
When a user likes this particular url I would like them to become a Fan on my facebook site/page as well.
I also added the FB opengraph tool which is a bit more informative once a user likes it. But it still does not publish any statistics to my page.
Can someone give me a bit of an understanding on what the best option is for this type of integration?
As a security option for the user, Facebook has never allowed third party access to "become a fan."
If you want to record locally when someone presses the "Like" button, you'll have to implement it locally (copy the presentation, and query Facebook yourself), so you can intercept the event. I've done that; it's not too hard.
I suggest you review the Connect Terms of Service to see what it is you're allowed to do: http://developers.facebook.com/policy/