Skip to content
This repository has been archived by the owner on Dec 1, 2021. It is now read-only.

Request failed with status code 400 #29

Open
vivianmauer opened this issue Mar 22, 2018 · 139 comments
Open

Request failed with status code 400 #29

vivianmauer opened this issue Mar 22, 2018 · 139 comments

Comments

@vivianmauer
Copy link

vivianmauer commented Mar 22, 2018

Everything is fine, i changed anything and start getting this error

Request failed with status code 400
    at createError (.../node_modules/axios/lib/core/createError.js:16:15)
    at settle (.../node_modules/axios/lib/core/settle.js:18:12)
    at IncomingMessage.handleStreamEnd (.../node_modules/axios/lib/adapters/http.js:192:11)
    at emitNone (events.js:111:20)
    at IncomingMessage.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1055:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)

i think could be some return that has changed in the graph api

@tobilg
Copy link
Owner

tobilg commented Mar 23, 2018

How are you using it, and are you sure you’re using an app access token?

@vivianmauer
Copy link
Author

vivianmauer commented Mar 24, 2018

Yes i'm using an app access token, as i said, everything is fine. After some tests, i find this error when the api try to get events information.

"(#200) Access to this data is temporarily disabled for non-active accounts due to changes we are making to the Facebook Platform"

Looks the Facebook restricted some information from events, but i could not find which in specific.

ps: I have all the necessary permissions

edit -----
When remove the "...event.fields..." works, but missing some informations

@tobilg
Copy link
Owner

tobilg commented Mar 24, 2018

The error message is a bit strange, because when using an app access token, no user account is involved. Removing the events.fields basically renders the tool as meaningless

@BigFoppa
Copy link

Facebook has shut down access to some data using the Graph API. This is in response to the Analytica scandal. We can only wait for more information.

https://newsroom.fb.com/news/2018/03/hard-questions-cambridge-analytica/

https://developers.facebook.com/status/issues/205942813488872/

https://stackoverflow.com/questions/49417886/why-does-facebook-graph-api-say-my-account-is-non-active

/Big

@tobilg
Copy link
Owner

tobilg commented Mar 24, 2018

Thanks @BigFoppa! The error message couldn’t suck much more tbh, and FB is making strange moves.

I can only imagine that the problem lies in the attendance/rsvp counts, because IMO these are the only things related to users. I’ll try to very that over the weekend.

@BigFoppa
Copy link

BigFoppa commented Mar 24, 2018

All data from Events is blocked for the moment. You can using the Graph Explorer see that events-data is blocked to apps. Suck, is an understatement. The error you get is:

{
"error": {
"message": "(#200) Access to this data is temporarily disabled for non-active accounts due to changes we are making to the Facebook Platform",
"type": "OAuthException",
"code": 200,
"fbtrace_id": "GSO/a25jzqP"
}
}

The "non-active accounts" meaning is a bit cryptic. But all apps are blocked for Events-data. A call like this gives the error above for an app (not for Graph Explorer):

?ids=179082445563485&fields=id,name,events.fields(id)

/Big

@tobilg
Copy link
Owner

tobilg commented Mar 24, 2018

If this is correct, then it’s one of the most stupid things ever. Event Data would have nothing to do with user data if they’d just remove the attending/maybe/declined counts.

Not very well thought out apparently. Not that this surprises me.

@tobilg
Copy link
Owner

tobilg commented Mar 26, 2018

I tested this today, and unfortunately there doesn't seem to be a way to access events data with an app access token.

I used the User Access Token from the Graph API Explorer to run the tests of this project, and it was successful. Maybe this could be an intermediate workaround?

@ghost
Copy link

ghost commented Mar 26, 2018

Hi tobilg what steps did you take to make it work through User Access Token?
In the past I made this steps:
1 - You have to activate apps in your facebook profile (https://www.facebook.com/settings?tab=applications)
2 - Register in https://developers.facebook.com/
3 - Create an app. It will generate an id.
4 - Go to https://developers.facebook.com/tools/accesstoken/ -> get the App Token

@tobilg
Copy link
Owner

tobilg commented Mar 26, 2018

@vrgomes You can go to https://developers.facebook.com/tools/explorer/145634995501895/ and just copy the access token from there.

Make sure that the original Graph Explorer is selected in the application pulldown on the right side.

@BigFoppa
Copy link

Hmm, I always use a user-token in my app, Eventmap4u, and it doesn't work now. I can only get it to work within Graph Explorer (or if token is copied from GE) . I hope you can prove me wrong.

/Big

@tobilg
Copy link
Owner

tobilg commented Mar 26, 2018

@BigFoppa that's not what I was trying to say. If you're using the (User) access token copied from the Graph Explorer, it seems to work when passing it as FEBL_ACCESS_TOKEN env var. But it won't be possible if you use User access tokens generated by your app itself, at least at the moment.

@BigFoppa
Copy link

@tobilg we were writing at the same time, read your latest post after mine. We have the same understanding. The token from GE can be used for testing, but it is short-lived and expires too soon to be used in production.

/Big

@znortr
Copy link

znortr commented Mar 26, 2018

Try to use an access token from an app that point to a real site online and not to localhost.
In my case, after this change, the api started to work again.

@ghost
Copy link

ghost commented Mar 26, 2018

@znortr can you explain how to configure that?

Greetings.

@znortr
Copy link

znortr commented Mar 26, 2018

@vrgomes If you Look in your Facebook app dashboard you can see the domain app and the site url fields.
Try to fill:
the domain app with your online site name
and the site url with your online site url
I'm not sure if in this way work, maybe you can try to create a new app.
I have two apps, one pointed to localhost (that I had used till this morning) and another one pointed to my site so I simply replaced the access token from one to another and it worked.

@tobilg
Copy link
Owner

tobilg commented Mar 26, 2018

@znortr Thanks for the hint! I just tried to verify this behavior... Unfortunately I couldn't reproduce. I also tried to create a new app with the procedure you described, but not success either.

Are you using an app access token, or a user access token?

@znortr
Copy link

znortr commented Mar 26, 2018

@tobilg I'm usig an app access token........
but, maybe I'm not in the right place, I'm referring to
"Search Facebook events by location (as a service)" with Docker
and not to "facebook-events-by-location-core"

@tobilg
Copy link
Owner

tobilg commented Mar 26, 2018

Well, you're in the wrong project then, but facebook-events-by-location uses facebook-events-by-location-core to get the events from FB. This can't be the reason why it works/doesn't work.

@znortr
Copy link

znortr commented Mar 26, 2018

I'm not a developer so I do not know what to say, but I can say that, in my case, it work, I just checked, and today, after switching the access token, I downloaded about 15,000 events.

Here my app config:
app domain : xevent.it
site url : http://xevent.it

access token: app_id|secret_key
(I use the same access token in a FB api graph to download events one by one in the online site)

Let me know if you need some more info on this.

(My guessing)
Since, the error message is "Access to this data is temporarily disabled for inactive accounts" it makes me think that apps not used in a real site are considerated inactive by the FB's "genes" blocking it, but is puzzling that even the new apps do not work. (I have not tried, I believe you on the word)

@vivianmauer
Copy link
Author

vivianmauer commented Mar 27, 2018

Has anyone managed to make it work?

I set it up as the @znortr said, but doesnt work, maybe i have placed the app domain and site url in wrong place

It makes me crazy because I see others apps using events information and can't understand what a hell is going on in Facebook

@xtebs
Copy link

xtebs commented Mar 27, 2018

I just was able to make a (very fragile) WA.
On Graph API Explorer you request a 'Page Access Token' from some page you have on facebook.
In my case, i had exactly the page of my app.
When you have it just ada it manually to the URL you use "facebook-events-by-location" service.
example: ( on a localhost running service)
http://localhost:3002/events?lat=38.687570912250685&lng=-9.354657&distance=1000&sort=venue&accessToken=<<big_huge Page_Access_Token>>
It worked for me until a better solution comes.

@tobilg
Copy link
Owner

tobilg commented Mar 27, 2018

Thanks @xtebs. I'm quite sure that you only got a short-lived page access token, which you can check at https://developers.facebook.com/tools/debug/accesstoken

As it was generated by the Graph API Explorer app, you can't exchange it for a long-lived token, because you don't know the client secret (see https://developers.facebook.com/docs/facebook-login/access-tokens/expiration-and-extension).

@xtebs
Copy link

xtebs commented Mar 27, 2018

Thanks for the heads-up @tobilg .I totally agree with you (unfortunately) . In my use-case I will need a lot of manual work until something better comes up.

@vivianmauer
Copy link
Author

Looks like everything working as well now

@JosteinKringlen
Copy link

JosteinKringlen commented Mar 27, 2018

@jonathanmauer Did you do anything special to make it work? I've tried using both app access token and user access token, but the closes I have gotten was getting an empty response when using user access token from graph explorer..

EDIT:
Somehow it started working again, but only with GE access token.. Tried different distances, lat/long and since/until, and then it just magically worked after a lot of tries. Still no luck with app token or user token

@vivianmauer
Copy link
Author

its working with both app and user access tokens. I think facebook is analising all the apps before granting permissions.

ps: Before i added domain and url from my api and it did not work, but... it may this have influenced

@aurabhi
Copy link

aurabhi commented Mar 28, 2018

@jonathanmauer @JosteinKringlen I am still not able to access the api's. I am using user access token. Any suggestions?

@ghost
Copy link

ghost commented Mar 28, 2018

Did anyone submit the App for Review?
When I click on that it show a list of permissions but all are user related. I don't see any related to Events. What permissions are needed?
screenshot capture - 2018-03-28 - 09-25-31

@lassegit
Copy link

@adf47 You could properly scrape Facebook using a HTML-crawler. Needless to say, a hassle. There are also some services that offer that as well, but haven't tried any of them.

@znortr
Copy link

znortr commented Jul 17, 2018

After more than 3 months, I get my app approved, to access the public page contents, but FOR NOTHING !!! There is no way to get the page events ........

It is obvious, at this point, that since they had launched their own app, public events are public information just for them ......!?! :(

@ghost
Copy link

ghost commented Jul 17, 2018

They removed the events from the Public Page API?

@znortr
Copy link

znortr commented Jul 17, 2018

@vrgomes The endpoint still exist but the response is empty..........

@mikestaub
Copy link

@znortr can you provide a code snippet of the curl command that returns an empty list? Perhaps your request is malformed or there are no events in that area.

@kaitoqueiroz
Copy link

What about read events from users?
We can create a base of events if you have a certain quantity of users.

@adf47
Copy link

adf47 commented Jul 17, 2018

@znortr I am having the same issue. Even on the graph explorer I can get no data on the events node to return

@znortr
Copy link

znortr commented Jul 18, 2018

@mikestaub @adf47 Tested with regular api link and also on graph explorer with no success, tested also with page id !

But it seems that they restricted the api
https://developers.facebook.com/docs/graph-api/reference/page/events/
This is a restricted edge. You cannot request access at this time
unfortunatly that's it ......

@kaitoqueiroz What do you mean ??
I have no problem to get events from my registered users, I need to found a solution to get events by area like was before that the f..g Zuckerberg decide, with no reason, to kill our websites.

@kaitoqueiroz
Copy link

@znortr You can store a event from a registered user and provide to another users. If you have a good quantity of users, maybe you can have a good database of events by area.

It's not the best solution, of course. But it's better than nothing.

@tobilg
Copy link
Owner

tobilg commented Jul 21, 2018

I don't really think it makes a lot of sense to use User Events, because the most of the "professional events" are created by pages. You'd have to have a really large user group to have a decent amount of events available.

I fear we reached a dead end with the Graph API and event data. No one I know of was able in the last months after the API changes to get access to the Event API data.

I added a hint in the README regarding this. Unfortunately, there's nothing more I can do at the moment.

@ShakeDigital
Copy link

What's everyone using as an alternative to Event API data? Is there a 'next best' available?

@hzitoun
Copy link

hzitoun commented Aug 8, 2018

Any news?

@kaitoqueiroz
Copy link

@lifeact the link is offline.

https://codecanyon.net/item/wordpress-automatic-plugin/1904470
I've found this.

@ghost
Copy link

ghost commented Aug 30, 2018

@lifeact can you explain everything?
Does it access to data using the Graph API and export events from facebook pages?

@tobilg
Copy link
Owner

tobilg commented Aug 30, 2018

@andreandev I think the comment from @lifeact has nothing to do with the actual problem. FB still hasn't opened up (and probably never will) the access to the Events via API. I highly doubt that a Wordpress plugin can actually get the data out of thin air.

@tobilg
Copy link
Owner

tobilg commented Aug 30, 2018

@lifeact this doesn't solve the original question. Please don't advertise Wordpress plugins in this issue.

@lifeact
Copy link

lifeact commented Aug 30, 2018

@tobilg ok, sory, thise is not AD. I show my way to decide problem

@ghost
Copy link

ghost commented Apr 9, 2019

A dig from the past 🚨
Any new/alternative on this?

@entin-hun
Copy link

I'm able to get events from pages I don't have a role in with {page-id}/events
Does it make a sense?

@kwstasna
Copy link

kwstasna commented May 5, 2019

I'm able to get events from pages I don't have a role in with {page-id}/events
Does it make a sense?

@entin-hun Do you have a verified app in Facebook Developers ?

@entin-hun
Copy link

I'm able to get events from pages I don't have a role in with {page-id}/events
Does it make a sense?

@entin-hun Do you have a verified app in Facebook Developers ?

Our app's status is "Live", with the following permissions only:
LOGIN PERMISSIONS
email
public_profile

@kwstasna
Copy link

kwstasna commented May 5, 2019

@entin-hun which Graph-API version ?

@entin-hun
Copy link

entin-hun commented May 5, 2019

@entin-hun which Graph-API version ?

latest, 3.3. (using the new beta and previous as well) Doesn't it work for you?

@lostpebble
Copy link

lostpebble commented May 5, 2019

Definitely does not work for me. Says your app needs to get approval.

Are you sure you are not related to the page in any way? I've made that mistake before and got excited.

Otherwise, you must just be extremely lucky.

@kwstasna
Copy link

kwstasna commented May 5, 2019

@lostpebble i don't think it as a luck. I'm sure he sees the events from his page, because i tried again now and its still a 400 😢

@estathop
Copy link

any luck folks getting somehow public events ?

@quentinhayot
Copy link

I think it's time to move on with this. With their recent "focus on privacy" announcements, there is probably zero chance that they allow access to this data ever again.

@estathop
Copy link

is there by any chance any window for research centers and researchers in general that participate in Horizon2020 projects to get access in this info ? I mean social media analytics is a study field and no one can solely rely on twitter

@lostpebble
Copy link

I think it's time to move on with this. With their recent "focus on privacy" announcements, there is probably zero chance that they allow access to this data ever again.

This is actually public data.. always was. The API provided data on publically open events. Their excuse of "privacy" for shutting this endpoint down is ridiculous.

Let's not dance around the fact that this is FB giving the middlefinger to developers of their events API in order to have a monopoly on events information for their next product iterations. I hear they have a big focus on events coming up.

In any case, I agree. This ship has sailed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests