I'm writing a Windows Phone 7 app where I'm posting comments to the users feed on their behalf. I get the user to auth in the usual way (browser) and get an access token. All standard stuff that's been working for the last week. But today the posts have stopped working. I just get a "Remote Server not found" back from my web call. Here's the url that I'm using to post (this used to work perfectly before today):
https://graph.facebook.com/me/feed
Then I add these two form parameters: access_token=...&message=...
I pretty sure the server is up and the access token is good since I can successfully query the users basic profile info using a url like this:
https://graph.facebook.com/me?access_token=...
I have been debugging this flow a bit so my hunch is that Facebook is thinking I'm a spammer and has turned off programmatic posting. Does this happen? If y, what's the limit and what's the remedy? If n, any debugging pointers would be helpful, the new facebook docs are very sparse.
Thanks!
Found it, hoping others don't waste as much time as I did on this... So while I was debugging my app (that posts to a users feed) I was sending the SAME MESSAGE over and over again. Looks like facebook doesn't let you do that - which makes sense I guess. The "Remote server not found message" strangely enough is actually part of the OAuth 2.0 spec. I get the error but the "Remote Server not found" is pretty confusing...
Related
I am using Facebook's PHP SDK (because it still works, even though it's deprecated, and there's no proper PHP alternative in place), and I've somewhat recently received messages from Facebook about my login app being deactivated because it "has too many errors". I decided to debug it and find out what seemed to be the problem, and it turned out that at the /debug_token step it receives an empty response from Facebook, which is, of course, invalid.
According to https://developers.facebook.com/docs/graph-api/reference/v15.0/debug_token,
this API endpoint should return information about an access token that I received from /oauth/access_token. I tried requesting for this debug information in Facebook's own Graph API Explorer, but the response I got was {"data":[]}. There were various errors if I provided the wrong data, so I would assume if the access token was wrong, I would have also received an error, but nope.
Commenting out the bit of code that does the access token debugging/validation fixes the whole thing, but that hardly seems like the right fix, although it counts for the end users.
The PHP SDK github repo is archived, I can't ask questions here, so I have no other choice but to ask here - 1) does anyone know if the debug_token step is required, and if yes, then 2) for what reasons, and 3) what could possibly be the problem here? At the moment it absolutely seems that the fault is at Facebook's end, I went through all the server requests and all of them work except this one.
I got the same issue about empty array from /debug_token endpoint. After investigations, it seems to be only on development applications. With live applications, /debug_token returns data ... Another weird behaviour from Facebook Graph API 🤷🏻♂️
I know there have already been a lot of questions asked about replicating the users home feed and using me/home, but my question is slightly different.
A few months ago I wrote code to authenticate with Facebook (get user access token) and then retrieve their home feed with me/home. This worked fine at the time as far as I can recall. I've just gone back to the code today, and it doesn't appear to work. The result I get back looks almost the same as me/feed, which is to say it is almost entirely posts from the same account and not posts from 'friends'. Just one post from someone else, a change to their profile pic, shows up but the rest are all 'self posts'.
This only happens with tokens for my own app. If I use graph explorer using the same token, I get the same result. If I use graph explorer with it's own token then it shows me something much more like the actual home feed on the Facebook site. Generating new tokens doesn't help. I have checked the permissions on the tokens used are the same, in fact I even copied the permission list from the generated graph token into my app and re-authenticated, but it didn't help. If my app does the request, then I get almost nothing from other people from me/home. This is the same if I use myuserid/home. Makes no difference.
So my question is, why? Have Facebook changed something and is there a way to change my app so it gets a better version of the home feed?
Secondly, while researching this I've discovered posts saying read_stream won't be granted by Facebook to any app on any platform that has an 'official facebook app'. Does this mean I'm out of luck anyway, even if I get this working for testing purposes using the account that owns the app, I won't actually be able to publish it so others can use it?
Thanks.
Starting on July 30th, and every 3 days since, we've been getting this alert for our Facebook app, which is used on our site for Facebook Login and social posting:
In the last three hours 100% of the calls to the method plugin:post
resulted in errors.
Error Code 100
Error Description Invalid parameter
Error Count 5,971
Thing is, I have no idea what "plugin:post" is. Google and stackoverflow don't seem to know either, for that matter :) And 5,971 instances of it in 3 hours is more traffic than I would expect on our site.
Our codebase does not contain any references to "plugin:post", so I'm assuming "plugin:post" is an alias for some other functionality within the Graph API. I just don't know what. Anyone have an idea?
I did see there there is social plugin which uses an "fb:post" FBML style tag (https://developers.facebook.com/docs/plugins/embedded-posts/) that sounds like it could be related, but we don't use that plugin.
Any insight would be appreciated, thanks!
[Edit 9/13 for Azhar's question:]
I checked the July 2013 Breaking Changes, and nothing seemed like it would impact us.
[Edit 9/13 for Tobi's question:]
We're using:
- Open Graph API for social posting via the Feed dialog to either the user's news feed or a friend's news feed
- Facebook Login API to allow users to log into our site,
- Facebook Javascript api for geting user info (e.g. FB.api('/me'...), F.api('/me/friends'...), etc. ), and other data via FQL FB.api("/fql"...). I've verified that none of the FQL statements are impacted by the July 2013 changes.
I would post some code, but we have a fair amount of FB-related Javascript on the site, and I'm not sure which is the one causing the problem.
My Facebook app is receiving the exact same error message alerts from Facebook. I have exhausted all possible solutions and investigated every aspect of my logic, and I have concluded this is a bug on Facebook's side until someone can prove otherwise.
I have ignored these alerts so far and there has been no impact to my website or my users. Every integration point with Facebook works flawlessly using my personal Facebook account, test Facebook users and other non-admin users across all major browsers. Nothing appears wrong or broken.
When I investigate my Facebook app's insights and look at the developer view for activity and errors, I see plugin:post failures for the current month but when I go back one month there are absolutely zero API errors and it says "No API Errors". This is obviously wrong because I was getting alerts last month and this helps support my theory that the issue is on Facebook's side.
Turns out this was all due to a naming conflict in the HTML of our page. We had a page element with a class name of "fb-post". Facebook apparently treats this a "fb:post". Since our "fb-post" was not an actual FBML tag, it does not have the other parameters Facebook looks for in a post. So Facebook started giving alerts.
I suspect this is due to a change on Facebook's part, as we've had these "fb-post" elements in place for years now, without issue.
Incidentally, this is also the case for any elements with a class name of "fb-name", as Facebook treats that as "fb:name".
I got "The question you're asking appears subjective and is likely to be closed." when I started to write my this and a lot of similar titles popped up.
So I've browsed them all and only two might actually help me solve the problem, but they weren't answered.
So... I will continue to ask my question and hope that it wont be closed.
Here it goes:
All I want is to show the feed of a facebook page on a separate website. I.e. status updates, photos, videos, events, comments and likes, all public.
I've googled and also looked at some docs on the facebook developer pages, but all I found was about how to make the visitor grant my fb-app rights to do stuff. Then I would get an access_token which I could use, BUT this token expires.
Never mind... I DONT want to make the visitor grant stuff, I only want to show MY stuff, which is already public.
Preferably I would like to do it with javascript and ajax. PHP might not be supported where I have my site. So if you have an answer for me please say it in javascript first :)
Although ALL answers are more than welcome.
Please, pretty please, with sugar on top, help me with this one.
Getting public data of a facebook page is easy, you don't even have to own the page for that.
You will need a facebook application for that, once you have that you can then authenticate against facebook as the application (from your servers) as explained in the Authenticating as an App guide. You can try it with a simple curl request to:
https://graph.facebook.com/oauth/access_token?
client_id=YOUR_APP_ID
&client_secret=YOUR_APP_SECRET
&grant_type=client_credentials
After you authenticate you receive an app access token and you can use it to make api requests for public data.
For example, try the South Park page object, feed connection, photos connection and events connection.
The token used in the graph explorer is a user token, but you can paste there the access token you got from the curl request for example and it will work.
Prior to the may updates (we were using the offline tokens because they did not expire), I was able to send a delete request to facebook and remove the user's facebook link from within our software, after turning the disable offline access to enabled (disabled the old functionality), this no longer works. I am trying to figure out what may have changed. There are no current posts on the subject and all the posts I do find are VERY conflicting in answers.
i.e.
Remove the application from a user using graph API
vs
Facebook account delink or deauthorize facebook app and check status of linking from facebook app
This is also documented on the graph documentation as saying this command should work, I have tried a few different syntaxes (its not actually stated which syntax to use in the documentation - nice job Facebook, it just says "send a delete request").
Long story short, does this work? I keep getting the 400 error "bad request" when attempting to fix this feature.
I have tried the following two urls:
https://graph.facebook.com/userId/permissions?access_token=someToken&method=delete
https://graph.facebook.com/me/permissions?access_token=someToken&method=delete
Those questions aren't inconsistent, one of them was answered before the Graph API had support for this
https://developers.facebook.com/docs/reference/api/user/#permissions is the documentation, the example is:
(javascript)
FB.api("/me/permissions","DELETE",function callback());
I've done this many times and it definitely works
Sorry for having answered my own question:
Apparently I was actually getting random errors rather than actual errors.
I am unsure if /me/ works, because I did not go back to re-test it, but I am certain now that using the format:
https://graph.facebook.com/userId/permissions&access_token=someToken
Does indeed work correctly for deauthorizing your own application in facebook.