Granted there is a lot of info on how to accomplish a lot of different things on Facebook. Resources are not what is missing, but I am missing some sort of information. I feel there is confusion with the Open Graph and Graph API.
I am writing an app that will post a message to a users wall.
User grants access to the app
App gathers this user information
Program (in this case Java) posts to users wall
In theory this is simple enough.
To get #3 to work, I've used the Graph API publishing call. Works great.
But after getting all of this to work, I see on the same page that the /PROFILE_ID/feed call states:
Publish a new post on the given profile's feed/wall. Note that this
feature will be removed soon.
Great! I've tried finding the equivalent using the Open Graph, but cannot seem to find anything similar. I've seen that for an app to post to a wall without user authorization (I only want the user to authorize the app once, then the app can post many times - the user cannot be involved in every post) it had to use Action and Objects, but only Facebook pre-defined... Can this still be done via HTTP request?
To top off on the confusion, in the Open Graph advanced topics How-To: Use an app Access token it refers back to use
curl -X POST \
-F 'message=Post%20with%20app%20access%20token' \
-F 'access_token=YOUR_APP_ACCESS_TOKEN' \
https://graph.facebook.com/4804827/feed
Which is back to the original method I found using the Graph API that will be removed soon.
I wish someone could help me make sense of this. I don't need code. There is too many posts already with just code and a bug fix. I beleive I need understanding.
Thanks in advance.
Lets start with your request 3: Program (in this case Java) posts to users wall
To accomplish this
1. you need to know what you are going to post on user's wall.
As per Facebook-Opengraph, this information is segregated as user + action + object.
Now you need to define what are the actions you wanted. Refer here
Then define your objects
Publish your story or message on to the user's wall.
Related
Using the latest version (2.12) of the Facebook API I'm trying to get (public) events for a page, using the Graph API Explorer.
However, I can't seem to get it working:
When I hover over the greyed out "id" or "name" on the left, it says "Field is empty or disallowed by the access token".
Now the page I'm using as an exmple here is Techcrunch, and they have plenty of events coming up. So "empty" doesn't seem to be the issue.
On the "disallowed" side I've checked the API reference on https://developers.facebook.com/docs/graph-api/reference/page/events/.
However, I can't seem to find any issue here either. It says "Reading Page events requires a valid Page access token or User access token with basic permissions.".
What am I missing here? Any hints are greatly appreciated!
Visit https://developers.facebook.com/docs/graph-api/changelog/breaking-changes#pages-4-4
Currently Facebook is not returning events for pages using Pages API unless you use an user accesss token and that user has been invited to any of the events of the page or is attending/interested in any of the events of the page.
As unknow_b said :
currently to access events you can also use a user endpoint such as ‘/me/events’ or ‘/me/events/not-replied’ using an access token valid for that user. you can get the events that the user was invited to or is going/interested
But the access token user, is only working for 1 hour !
Does someone have another better idea?
I'm trying to do the same thing: getting public events from a page. Related to the above suggestions:
I tried the short-lived user access token two weeks ago, which worked for a short time. Now it does not anymore. Does it for any of you?
Both the long-lived user token, a page token generated with either a short- or long-lived user token do also not return any events.
At https://developers.facebook.com/docs/apps/review/#platforms, Facebook states:
Beginning April 4, 2018, all apps, including those formerly approved, must undergo App Review in order to gain access to the Events API, Groups API, and Pages API. Apps accessing the Events API and Groups API will lose access and require review once App Review resumes.
So being reviewed might help. I will report further.
Update 1: an answer on this related bug reports states it more clearly:
App review required to use the following edges: GET /page/events and GET /me/events
Meanwhile they cancelled all pending review requests for the Graph API 3.0 changes, so I have to resubmit.
Update 2: My project got rejected & I'm not bothering to continue it now.
Yep. Facebook has taken down the Graph API for page access tokens. I had this code in production for 2 years and it worked great. The only way to retrieve data (or was a week or so ago), was a temporary user token that lasts about 2 hours. It's totally broken my band's schedule page. I've been through every avenue and even spoke with a facebook ad team employee on the phone that was aware of it. She seemed to empathize but had no solution for me. I would count on it being down for a while.
I just created a python script, you can see here. It queries the given facebook page and it's events, and puts the data into a mysql table.
It looks like it won't be working anymore due to the scandal with Facebook Analytics (see Why does Facebook Graph API say my account is non-active?).
In the popular plugin facebook-events-by-location-core, you can take a look into the issue#29 discussion. It's well explained there, and I don't think so there's a way we'll get the data in a public API available anymore.
There were also some rumours it was a competition for their (dead?) Facebook Local app, but not sure about this.
I have finally figured out a work around for this. On your fb application, you have to disable the secret key requirement. This can be found under the advance settings of your fb application console. It's called " Require App Secret".
Once you generate a fb PAGE access token, you get a fb page token, and then extend it. here is the token debugger: https://developers.facebook.com/tools/explorer/
You can extend the access token programmatically as explained here: https://developers.facebook.com/docs/facebook-login/access-tokens/expiration-and-extension
AND
https://developers.facebook.com/docs/facebook-login/access-tokens/#pagetokens
OR
There is also an extend tool in the access token debugger (just click on the debug and the extend button is bottom left): https://developers.facebook.com/tools/accesstoken/
Yes , we had a working product back in 2016 ( almost like it's successor Fb Local ) . We were monetised and ready and selling events tickets on the messenger chatbot.
Idea was to solve discovery + booking for hyperlocal events. We went out of business and now its a heart ache to see Fb local.
enter image description here
Let's say I am user A and there is a user B. Is there some way to use the Facebook API or anything else and post on wall of user B using programming in such a way that the post appears to be by me?
I can get any permission I want because we are close friends. I would just like to post some jokes on the user's wall automatically at regular intervals. I have gone over a few questions asked related to this topic and they suggest that it is not possible by any means. However, they are all very old and I would like to know if there have been some new developments in the API or are there any other techniques that I can use?
I have successfully posted status updates on my page using PHP but the process seems to be a bit different for posting on a user's wall. There are a lot of question like, who do I need to get permissions from? Could anyone point me in the right direction by providing link to some tutorial or the part of documentation that I need to read to get started?
You can´t post to the wall of a friend. You can only post to your own wall with the API (with the publish_actions permission and the /me/feed endpoint). This will most likely never change, as it would be considered spam in most cases.
I would just like to post some jokes on the user's wall automatically at regular intervals.
...and that would not only be spam by definition, but also not allowed even if it would be possible. Autoposting is never allowed, and the message always must be 100% user generated.
I'm new on working with Facebook and honestly I found it very confusing, terminology and documentation seems to be very ambiguous in many cases. Can somebody please help me out with a plain english explanation on how I can achive the following?
Post and image to Facebook (on the user page) and then check the stats (insights) of that post.
Till now I have managed to:
1) Create an app
2) Post the image on the user page with the desired message
I'm not able to understand how I can retrieve information about the particular image which was uploaded through my app. I want to know how many people have viewed that image, how many likes did it get, how many times it was re-shared.
Is it possible at all?
I'm posting to /photo not too /feed and I will like to keep it this way if it is possible.
Sorry if this was answered already but I spent a few hours trying to find an appropriate answer but wasn't able to get the right documentation.
UPDATE 1
After having a couple of days off from this topic and receiving the first 2 answers, I took another dive into this. Now I have tried the Graph API Explorer as suggested, and using the ID of a POST I can get some details about the POST, but the insights aren't showing anything, just next and previous.
My goal is to be able to gatther some stats about the pictures uploaded through the app. If this is not possible directly what should be the approach I need to take?
I don't believe a personal /photo has /insights attached to it - the Insights Object documentation page suggests that they do not - but you should be able to get likes, shares, and comments via the API.
It would appear FB has launched a redesign/reorganization of its documentation in the last couple of weeks, but the documentation for the /photo graph object is here -- you will need the user's Access Token, and the API endpoints you're looking for each have links to their own documentation pages there, including example code for each type of request.
Edit (summarizing discussion in comments):
There is no method via the Facebook API to gather insights for all photos posted to individual user timelines via an app. The app can gather likes, shares, and comments for each of those objects individually via API requests, and can make API requests for insights for photos posted to its own timeline. Neither of those options solves the intended use case here.
I'd recommend a solution that uses Sharing rather than an app integration, as this allows for better access to insights on the photos being shared. This is also a much simpler integration, and less brittle wrt future Platform changes. The main tradeoff is that the original photos being shared are expected to expire after a couple of months -- if this is unavoidable, I'd suggest implementing a redirect for requests for expired objects on the site.
We are able to get different kind of photos or picture Using Graph API
like as below:
1.Page Photos
Photos for a Facebook Page.A Page Access Token is required for all methods.Find here
2.Page Picture
Picture belonging to a Facebook Page. Find here
3.Photo
Represents an individual photo on Facebook. Find here
4.User Photos
Photos for a person.Find here
I hope it's helps you.
How can I get the actual Facebook IDs of all people who liked, commented (+replied to comments or liked comments) or shared a post (e.g. a post by a person or a FB page).
Looking for a programmatic solution in PHP.
(I am not familiar with programming for Facebook and their API)
I would advise you to try to dive in a topic yourself before asking help. These kind of questions are all over internet and are easy to find.
That said; you can use the /sharedposts edge on Graph Objects. Starting from there, you can dive into the documentation of the Graph API.
edit: To be more explicit, you can't just get all of the people. You have to use the /sharedposts endpoint to get the posts. You will only receive the posts that are accessible to your app; e.g. specific user (privacy) settings are taken into account.
If you have the ID of a post, say 1234_5678, you can get these by calling:
https://graph.facebook.com/1234_5678/sharedposts?access_token=[access_token]
If you are unfamiliar with the Facebook Graph API, asking for just the code won't help; it's not a single call and you would need to implement authentication / app access token. So that's why you need to dive in yourself; the documentation is pretty good resource to get started.
How can i show the wall (feed) of my page to app on facebook? As i see in the page
www.facebook.com/kesha?sk=app_178091127385 and
www.facebook.com/pages/Khanduna-Yengu-Nangsu-Amuktang/187317137978077
I want show the wall(feed) of my page to my app of facebook. Please Help me.
I also try and see graph api as below
graph.facebook.com//feed
But Fail,
Please Help any one.
As I understand your question, you want to take the wall of your page and show the content of that on another page controlled by an app you have made, so that is the question I will answer.
There are a couple of things you need to do.
Facebook now requires you to have an access_token to get that information. You can get this in two different ways. Either you get your users permission to grab an access_token for them, or you create an access_token for one of the admin users with offline_access and manage_pages permissions.
There are problems with both cases:
1: Getting an access_token per user requires people to give permissions to your app which is quite annoying if they just gain access to the contents of the feed.
2: Having one access_token is also a problem seeing as Facebook puts a limit on how many requests you can make per access_token in a given time.
You need to balance these things out if you want the feed to be shown. Which case would you most likely use? If you don't have many users the second case might be the best, but if you go over the request limit no content will be shown and that could confuse your users.
Anyways.. Once you are past the access_token problem, you can access the information by getting the content from the page:
https://graph.facebook.com/YOUR_PAGE_ID/feed?access_token=YOUR_ACCESS_TOKEN.
You then get a nice json output you can use. If you are using the Javascript API you can simply use the information here:
http://developers.facebook.com/docs/reference/javascript/FB.api/
If you are ever unsure how to get the information you need there is a nice tool for that developed by Facebook called Graph API Explorer which you can find here:
http://developers.facebook.com/tools/explorer/