Can a facebook app publish on behalf of a facebook page? [duplicate] - facebook

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Post on a Facebook wall as Page, not as user
Can facebook apps publish on behalf of pages like they do with user statuses?

You most certainly can! Just be sure to use the appropriate access_token. You'll need to authenticate as a page to get this. The documentation explains it best but basically, the administrator of the page must first grant the application the manage_pages permission, once you have this permission, your application will be able to make an API call to /me/accounts to get a list of all the pages that user administers and their appropriate access tokens.
With your shiny new page access token, making calls to the API is just the same as it would be for a user -
https://graph.facebook.com/PAGE_ID/feed?access_token=PAGE_ACCESS_TOKEN&message=Hello Page World!

As effective from October 3, Facebook has changed some rules because of many "spamming" apps, phasing out some of previous privilages. Currently there are very limited resources/tutorials explaining this in detail but better you can check facebook API.
https://developers.facebook.com/roadmap/completed-changes/
https://developers.facebook.com/blog/post/2012/07/05/platform-updates--operation-developer-love/

Related

Collecting facebook user-id from website visitors [duplicate]

This question already has an answer here:
Get Facebook User Id of my website visitors w/o auth
(1 answer)
Closed 4 years ago.
Is there any way to take the facebook user-id of a website visitor and save the user-id to a text file to keep track of visitors. I know there is some ways using Facebooks API, but it seems like the user have to give permission, and that is not what we want. So any way to save the facebook user-id of a website visitor without any user interaction?
Simply put: you can't. This would be a huge privacy/security issue IMO. You need explicit permission from the user to get his ID on your own website.

Posting to a Facebook page on behalf of page using a Facebook application by anyone

I have a web page linked to a Facebook application where users can log in by their Facebook account.
I have also a Facebook page for my application where anybody can post.
What I'd like to achieve is the following:
- An ordinary user logs in to my web page using her Facebook account,
- She adds an information to my web page (for example a book name),
- That information is instantly posted to my application Facebook page under page's name (for example "this book is read by someone").
I don't want it to be posted by the user, I don't want it to be posted by myself (admin of the page).
I don't want to mention about the user, it will be anonymous information.
But I couldn't find a way to do it either as JS or PHP.
Any suggestion is welcome.
Many thanks.
You will need to get a page access token. https://developers.facebook.com/docs/facebook-login/access-tokens/
Get it, store it somewhere on your server – and then use it when making the API call to post what the user entered.

App autopost to Facebook

So, I want to build a web app that posts let say funny cat pics to a users Facebook wall. The user allows the web app to do this via the publish_actions command. Yeah, I know this sounds spammy but it isn't.
Now, on Facebook Developer documentation pages it's described as follows:
"Enables your app to post content, comments and likes to a user's
stream and requires extra permissions from a person using your app.
So, to me this sounds that it's possible for an web app to publish content without the need for the user to grant every single update?
But, reading about it in the "Login Best Practices" section I read the following sentence:
When displaying the Log in with Facebook button, emphasize that
your app will not post to Facebook without people's permission
Source:
https://developers.facebook.com/docs/facebook-login/checklist
So, my question is – is it or isn't it possible?
To my knowledge, the publish_actions permission allows your app to post to the user's wall without having facebook itself ask for permission again.
However, it is good ("best") practice to always make it explicitly clear inside your app that "by clicking here, I will post to your timeline".
Basically, this is Facebook saying that you should handle this asking inside your application, in a way that best fits your application's logic.

Facebook App, Posting to Users' Wall Concept

I created a little Facebook app that posts to people's walls when they have a birthday coming up. This is all good, but there's a concept I'm not quite understanding.
I'm using a cron job to run a script that searches through users and posts to the ones that have birthdays on that day. I've created a Facebook account for the app so the post should be under the apps account. What I'm confused on is how is the script going to know to post from the app's Facebook account? Do I need to log in through the script somehow? If so, how do I go about doing that?
You are very close to the answer! Yes - you are correct, the application needs to use a certain access_token to performa actions "on-behalf" of the application.
You should read the Facebook Authentication Documentation under the header - "App Login" to learn how to obtain the app access token. After you have this token the methods you use to publish post are identical to regular posts.

How to access Facebook from a Playframework service [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Library to Integrate Facebook login with Play Framework?
I use playframework to make Json/Rest services - no webinterface.
I want to make a service, which posts a message on a Facebook wall.
I had a look at fbconnect and fbgraph, but they seem to only support webinterface.
Am I right ?
Of course, I can just access the Facebook graph API directly, but I would like to know if there are better ways. Later I want to do a lot more with the graph api.
If you want to post to any user's wall you will need the OAuth dialog in order to FB grant access to your app on the user's wall, at least for the first time.
If you are posting to your system's wall then you can get the access token's for your application and store it somewhere.