Some accounts return a blank response - facebook

Really odd situation that just started to occur. I have an App Token that's valid and can receive data on certain accounts. The problem is that it's not always consistent, some account work perfectly, but some are returning blank responses. I've never seen anything like it.
Does anyone have any ideas? If I fudge my access token a bit, it'll respond with the correct errors, but it seems like everything correct and I get nothing.
My endpoint is /account_id/posts?access_token=xxxxxXXXXxxxxXXXxXxxx

This might be related to the page having some type of demographic restrictions enabled. When this happens a user token is required to pull some information so FB can check to see if the restriction is applicable.

Related

Product ID for uber connect in nairobi

I'm only actually trying to use deeplinks, not even the api, but I can't find any way to get the product ID (uber connect) that I need without it, so I am attempting to get products.
https://sandbox-api.uber.com/v1.2/products
I am getting an the error "This endpoint requires at least one of the following scopes: ride_request.estimate" which I understand is because I have not gained scope access from uber.
(I did include that scope in the 0Auth request.)
It has been absolutely impossible to reach them. I filled out a form and it said they'd get back to me sometime but they are very busy.
An entire project is held up for hours over this detail and I'm really struggling for how to solve this. Is there a way to gain access or even make a sandbox request without that scope?
Or would someone be kind enough enough to run the call and let me know the response for [latitude]=-1.2741798[longitude]=36.791785
Thanks everyone.

/me/events - Events API

So, I've read conflicting information about this bit. But we've received complaints that users are unable to import their events in our application, although we have an approved App that has the "user_events" permission.
In short, the response when querying me/events using a user access token of the mentioned app is empty:
Edge: me/events
{
"data": []
}
Now, the funny part is, if you are a developer of the application in question, the endpoint will happily send you your own events over the API.
Is this intended behavior according to https://developers.facebook.com/docs/graph-api/reference/user/events/?
This edge is only available to a limited number of approved apps. Unapproved apps querying this edge will receive an empty data set in response. You cannot request access to this edge at this time.
Was there any communication about this? We have updated our application after they restricted the public access in May to use the user_events permission, but it looks like this access is now disabled as well, and even in a very sneaky way that makes it very hard to detect? Also, I did not read anything about this in any breaking change logs?
I'm just searching for clarification, because there is no way to properly contact Facebook regarding this issue.

Can only access sharedposts for some Graph API objects?

I have an access token for a page on Facebook. I can view that page’s feed, and individual posts in that feed. But for some reason, I can only request the /sharedposts endpoint for some of them using v2.2 of the Graph API.
The access token has the user_posts and read_stream insights. When I request the shares field I can see more than one post with shares, but when I request [POST_ID]/sharedposts for some of them, I just get an empty data array in response.
Why is this? Are there some gotchas I should be aware of? It’s a tad frustrating that the /sharedposts edge will return returns for some posts but not others using the same access token and API version.
This is a know bug, which still seems to be unsolved.
Basically it should work like you expected, but even with all necessary permission (and even for public posts) it does not return the object with each of the shares.
You probably want to subscribe to the bug here to be noticed once it has been solved:
https://developers.facebook.com/bugs/1404733043148335/
I just posted my insight/workaround for this bug on the bug report that lars.schwarz linked to, but I'll paste it here as well:
/sharedposts will only retrieve public posts or posts from users who have granted your app access. HOWEVER, the endpoint does not seem to query for this intelligently. I'm not sure, but I think the endpoint has a default limit of 25 results. What appears to be happening is that the endpoint queries Facebook's database for 25 posts, then filters that set based on your app's permissions.
What this means is that if the most recent sharedpost your app is allowed to access is 30 posts deep, the endpoint will return an empty data set. If your app is allowed to access one post which is 15 deep, and one that is 30 deep, it will only return the post that is 15 deep.
In order to get around this, you can set a really high limit (I've been using 2000). The problem with this is that if your post has more than 2000 shares, you will still miss stuff. You can't make the limit insanely high, unfortunately, because the endpoint will return an error telling you to query for less data (even if the query would only actually return a handful of posts). Therefore, I've been setting a limit of 2000 and using the "until" parameter to move through the sharedposts chronologically.
Hopefully that helps clear things up. This is a major pain, and an imperfect solution (although it gets 99% of the job done I think). I encourage everyone to file a bug report on this here: https://developers.facebook.com/bugs
It appears that this bug has been around for years, and I was told yesterday that they have no short-term plans to fix it. If we file enough complaints, maybe they'll prioritize it higher.

Cannot access application using the specified access_token

I am using Facebook long time tokens(2 months), but FB starts to be nondeterminic and gives me sometimes this return
{
"error": {
"message": "Cannot access application using the specified access_token",
"type": "OAuthException",
"code": 1
}
}
I am using PHP SDK.
I am using this link to get 2 months token
https://graph.facebook.com/oauth/access_token?client_id=APP_ID&client_secret=APP_SECRETgrant_type=fb_exchange_token&fb_exchange_token=SHORT_TIME_TOKEN
Any ideas?
I was experiencing this issue, and got some support direct from FB staff. The most likely cause of this error is "demographic checks" for the user.
Our app had an age-gate as it was alcohol related. Certain users' profiles did not contain enough information for FB to ensure they were above the drinking age for their location, so the session creation failed. Why this only happened on this call and not on earlier ones, I don't know.
Does your app have an age-gate, or anything similar?
You have the missing & between APP_SECRET and grant_type.
Also, there seem to be a Fb bug on this issue - http://developers.facebook.com/bugs/536272816386515?browse=search_50a37bb1c333b4253892226
Be sure that you extend the tokens immediately after you get the "SHORT_TIME_TOKEN". You can extend user tokens only ( not page tokens ). Be sure that you get a correct "Short time token" before you extend it.
Also, check for "sandbox mode " in your app. It may cause problems when extending tokens. Try switching it to "false".
Hope that helps.
Your query is missing an & after APP_SECRET, before grant_type. It should read:
https://graph.facebook.com/oauth/access_token?
client_id=APP_ID&
client_secret=APP_SECRET&
grant_type=fb_exchange_token&
fb_exchange_token=SHORT_LIVED_ACCESS_TOKEN
Source: Extending Access Tokens on Facebook Developers.
Edit: If the OP means that out of the current app user base, some users experienced expired sessions and reported the issue, the wrong query string is a possible explanation.
The error would result in the access_token not being extended, but log-in will be still be granted with the shorter-lived access token. In this case the faulty query string was in the code base all along, but was only discovered when live users' access_tokens expired earlier than expected, coinciding with "the app [..] used by many people".
If the OP means that using the correct query (and not the one stated in the question) out of many calls from the same client a subset returns with error, then my explanation isn't valid.
It sounds as if some of your users are erroneously being issued tokens that have a short lifespan instead of the extended ones you ask for.
It is possible you have stumbled upon a known bug with the extended access tokens. Check this bug report on facebook for more information about it as well as this question, although to my knowledge there's no real workaround.

Graph api /inbox has missing data

I have an application that goes and gets a users messages from their facebook account, but I've hit an error.
The user in question has a thread between him and me in his inbox, however it doesn't show up in his API call to /me/inbox with his specific access_token.
I do have a valid token (it works for all other calls), and I know it should be working fine (I am opening it in my browser directly to debug, and the data just does not exist).
There is no second page to view, no limit or timestamp imposed upon it, just missing data.
For testing, we do have every single API permission offered, so I know it is not a permissions problem.
Does anyone have any idea why this could be happening, and how to fix it?
I was struggling with the same problem. I found that using the `/me/threads' endpoint delivers much more complete data.
Update:
However I found out that this endpoint is not available to non-developers for the time being:
https://developers.facebook.com/docs/reference/api/thread/