I have a question regarding the Facebook API and would like to gain some insight into nuts and bolts of the Facebook API.
I'm planning to write an App in PHP. This would be a birthday alert app. A user would visit our website, login wih their Facebook Account and done - We send them alerts as and when their friends have birthdays.
How can this app work in the background? because connections for a user keeps on changing. We cannot store all the data in a database because of two things:
1) Constantly evolving connections
2) Violates Facebook Terms.
We need to be able to store only the UID's of the users and then use that UID to somehow fetch a users connections and their corresponding date of birth on a daily basis.
Please let me know if this can be done or not, Because what i've learnt so far of the Facebook API, we'll need an Access Token to access a users personal information. And this Access Token is persistent only for the time until he/she is logged in.
I'm sure there might be some other way to achieve this that i might have overlooked.
I would highly appreciate if any of you could guide me in the right direction.
You would need to request offline_access extended permission to be able to retreive user data anytime. In order to get friends birthday there is friends_birthday permission. More about permissions here.
Related
I would like to know if there is a way to extract some informations from facebook users and pages without creating a facebook app.
In other words, I would like to know if it is possible to do on facebook what can be done on Twitter using their streaming API (facebook is more suitable for my purposes), or if is there a dataset that I can query without having to interact with every single user to get his/her permission (without using access tokens).
To be more specific, I need to know two kind of infos from users: the place where they live and their likes on page and nothing more, users can be anonymous or with a fake ID or whatever.
Thank you!
For privacy reasons, it is not possible at all. You must authorize a user with the correct permissions to get that kind of data.
Also, you would not be allowed to use the data in any way without asking the user for permission, and scraping is not allowed on Facebook. Even if it would be possible without the Graph API, it would not be allowed.
I've got a website I'm doing around a bunch of athletes.
All of these athletes have a Facebook account.
The client wants to show each of these athletes Facebook timelines on their individual profile pages using only their Facebook profile handle that they will provide.
I'm very unfamiliar with the Facebook API but am 99% sure this isn't possible as each of the athletes would have to go to the Facebook developers portal and set up an app right?
Is there any way to achieve this at all?
Nop, you're wrong. Your athletes don't have to setup an app. But, on the other hand, you or the developer responsible for that project, must setup an app at the Facebook developers website.
I'm not going to explain all the process, since the Facebook docs are quite easy to understand.
https://developers.facebook.com/docs/
After you setup your facebook app and integrate it with your website, it's time to start asking the athletes authorization you have plenty of ways to do that, you can either use Facebook Login, Dialogs or evenManually Build a Login Flow.
Keep in mind that you have different permissions, here's a full list of the permissions and a small description explaining what's their purpose.
Each athlete would have to grant permissions to your app, then after they do that, you will get an Access Token and the Facebook User ID, usually the Access Token has a short period of life (aprox. 2 hours), but you can trade this Access Token for a long one with a life time of aprox. 60 days. You can read more about Access Tokens here
After your athletes grant permissions to your app, you can access to their timelines. Keep in mind that it won't be exactly as their timeline on Facebook. To grab user info you can either use Graph API nodes, or if need a more complex and detailed info you can query it using FQL
I am very new to Facebook Ads API so some help or advices about best practices I can use in my case would be appreciated a lot.
The situation:
We have multiple clients that are running advertising campaigns on social sites and Search Engines like Facebook, LinkedId, Google Adwords, Bing and etc. They want to have information from all their campaigns in one database and use this database to run various reports in order to manage their campaigns better (move money from one campaign to another and have better results). So basically we need to perform daily (or should I say nightly) sync. Also we need to mark adds in Facebook that are part of campaigns that are running via our tool (also not a problem to do once logged in). This is done automatically.
That is not a problem in many platforms - we use Google and Microsoft API to connect to the platform, read required data on daily basis or do some changes to URLs automatically.
The question
I was a bit surprised to find out that in Facebook Ads API the only way to authenticate is via tokens that expire quite fast (long term tokens last for 60 days). I am wondering if it is possible to authenticate via API with user name and password or obtain the ticket that is not expiring. The reason - most of our processes will run on nightly basis so any interaction with user to get fresh ticket is not possible.
Asking for permission every 60 days also seems like not an option and offline_access privileges that would suit us perfectly are no longer supported as I understood correctly from the documentation.
So what are authentication options? Is the only possibility to ask user to re-confirm our access rights every 60 days? Is it possible to get access permission once and live with it until user revokes it, or this is not possible?
Thanks in advance for your answers and suggestions!
Facebook did an exception for ads api access tokens. It is still possible to get neverending access token. Reed more here https://developers.facebook.com/roadmap/offline-access-removal. Also, you can check access token type, expiration date and other params here https://developers.facebook.com/tools/debug. Our access tokens shown as Expires: Never.
I have the task to integrate some commercial sharing stuff into a website.
The idea is that the user a) logs in/registers in the website, b) the user connects his user account with his facebook account - by adding and accepting the website application.
Here comes the interesting part - is there a way of linking the facebook account with my website's account so that I can send them updates and promotions directly to their walls programatically?
In the application dialog, it's clearly noted that the user allows the application to write to the user wall so they accept and agree this. Then, for example, if I want to send them a promotion or update directly on their wall using the fb application api, how can I achieve this? All the tutorials I've read consider the user using the Facebook Login
The concrete idea is something like weekly promotion feed that my clients want to allow customers to allow being posted directly on their walls. As I don't have any experience with facebook development, I'd appreciate knowing how, if at all possible, this can be achieved?
Most of what you're suggesting is against policy, and isnt' technically possible either as users need to come back to the app once every 60 days for you to have a valid access_token for them.
The Authentication docs explain how to get access to a user's information with their permission, and the Permission documentation explains which permissions grant access to which functions or fields.
My app stores the Facebook Access Token for offline use. The main purpose of the app is to allow users to automatically posts on the walls of people within a specified number of days of their friends birthday.
My app has been blocked by Facebook due to spam (some users are sending marketing messages to their friends instead of using the app for it's purpose).
I want to find out who those users are and block their access to my application. The only problem is that my Facebook App has a few hundred access tokens (one for each user of my application). The insights dashboard does not provide me with stats per access token. I need to find out which of my users are getting their wall posts reported as spam.
Is there any way of doing this?
After appealing, Facebook has unblocked my application but I don't want it to happen again. As far as I can tell, I can find out the number of people who have reported the wall posts as spam...but I don't know which access token made those posts...and hence don't know which of my users is posting spam messages.
It's not Facebook job to keep track of your application internal activities. You should be logging every activity, at least posts ids returned when someone posts anything on their friends' wall.
And one more time... you DON'T need the offline_access permission to publish something when the user is offline!