Facebook Graph Api Events Ordering - facebook-graph-api

Can I order Facebook page events based on the closes to farthest. Right Now I only see FQL option which I don not want to use. By default events are ordered on created time descending order.

Related

Facebook Graph API does not return Page Events

This looks a kind of duplicate question but actually NOT.
So the problem is https://www.facebook.com/julytalk/ has events, for sure.
But when I tried on Facebook Group API toolkit, it returns empty array.
https://developers.facebook.com/tools/explorer/145634995501895?method=GET&path=204859706228731%2Fevents&version=v2.12
Why is this happening?
I could not find any Facebook API endpoint modification notice, at all.
It was working okay before.
Please help me.
https://developers.facebook.com/blog/post/2018/04/04/facebook-api-platform-product-changes
Access to the Events API is not possible at the moment:
...apps currently accessing Events and Groups APIs will lose access today
Update: After Facebook did a lot of changes, it seems to be possible to get events again. You can get events from Pages you manage easily in dev mode. If you want to get public events, you may want to read the answer in this thread: Facebook pages API: "Page Public Content Access" review screencast
The above answer was misleading for me, not because its wrong but because so many things have changed on Facebook's side and I needed further clarification.
This is the current state based on my research (25.08.2020.).
There are several types of events available based on where the event destination is:
User events
Documentation terminology: "Events on User"
API endpoint:
me/events
Page Events
Documentation terminology: "Events on Groups"
API endpoints:
me/groups
group_id/events
Group Events
Documentation terminology: "Events on Pages"
API endpoint:
me/accounts
page_id/events
App Events
Documentation terminology: "Events on an App"
API endpoint:
{application-id}/events
About app events.
The list is taken mostly from Facebooks API event endpoint.
The documentation is wrong on event limitations:
Access to Events on Users and Pages is only available to Facebook
Marketing Partners.
The current state is that "Access to Events on Users and Pages is available to":
A) App Admins (verified with testing)
B) App Developers (verified with testing)
C) App Testers (not verified)
D) Facebook Marketing Partners (not verified)
What does this mean?
This means if your query the "me/accounts" endpoint which will give you a list of page ids.
When you select a page id and then query "your_selected_page_id/events" you will receive:
An empty list if you are not A-D)
A list of events which is not the same as your users.
A lot of confusion and frustration because there is no error message thrown.
I have tested this with different API versions 4.0 - 8.0 and the results were the same.
I have also tested this with a different but similar set of permissions, resulting in the same empty array response.
SOLUTION(S):
TODO: UPDATE: Clarify who needs to become FMP.
To query for page events "someone" needs to be a Facebook Marketing Partner.
https://developers.facebook.com/support/bugs/352704275741601/
Invite your users to become testers.
Helpful links:
Read more on Facebook Marketing Partners.
Officially on Facebook Marketing Partners.
Facebook Graph Explorer.
Facebook Batch Requests.
Additional notes:
Page event fetching has the same requirements as user events fetching.
Group event fetching works for all users (ignores A-D).
Creating batch requests with no FMP will result in response sections that only have empty arrays.

How to return keywords for a Facebook event with Graph API

I am using Facebook's Graph API to pull Events into a website. There is a category field available in the API request (see https://developers.facebook.com/docs/graph-api/reference/v2.11/event) but for every event I have queried it has been blank. I can't even see a way for users to even add a category when creating an event so it's not surprising they're blank.
Facebook does have a keywords field when you create an event. Is there a way to return this in the Graph API request? I can't find anything in the documentation about it.

Querying for Facebook Page's Messages without getting all messages ever

I'm developing an application that directs messages from a Facebook page to a proprietary chat queue, however, I only want to get new messages (since the last time I retrieved messages). I cannot find anywhere on the Internet that explains how to filter a Graph API query, and I am not able to figure out how to query for page messages using FQL.

How to get all facebook events?

I'm building a django app and I'm interested if there is a way to get all the newest/popular events from facebook.
I want to get their title, location, description etc.
EDIT:
For the solution in the answer bellow to be successful i'll need the access token. It can't be done with the app token. Also I don't need to search through events but retrieve them sorted by popularity.
Since i'm using django facebook for now i can get my users friends events (in which they are participating). Is there another way to retrieve them through the API?
https://developers.facebook.com/docs/reference/api/
Look for the headline "Searching":
https://graph.facebook.com/search?q=conference&type=event
You need an access token for it, but i guess an app access token will do:
$app_access_token = APPID . '|' . APPSECRET;
The app access token is valid as long as you donĀ“t change the id and secret of the app (will most likely never happen).
EDIT:
If you take a look at the FQL table of the events, there is no field for the "popularity":
https://developers.facebook.com/docs/reference/fql/event/
...so i guess you mean sorting by "most attending people". But you wrote "all the newest/popular events from facebook", so that means all events and not only those of the logged in user and his friends. The only way to get the events in that case is the solution i presented above.
If you want to get the Events of the user, FQL would be the correct way, i guess:
SELECT name,description,location,attending_count from event WHERE eid in (SELECT eid FROM event_member WHERE uid = me()) ORDER BY attending_count DESC
This gives you all events of the user, sorted by the number of attending people.

How do users control permissions of Timeline actions that are published?

According to https://developers.facebook.com/docs/beta/authentication/, the 'Default Activity Privacy' field in the Auth Dialogue can only have four values: None, Friends, Me only, or Public.
I think this is either a huge oversight in the API or I cannot find out how to implement what I think is the right way to do this. For example, if I am a user of Spotify, I want to Add to Timeline but I want those stories to be visible to certain lists. In the Activity Log (which is private to me) I can control the visibility of all the previous posts from Apps and their visibility in terms of lists, but not for these new Timeline updates from Spotify. I tried going back to some activities posted by YouTube and I can control which lists its visible for in the dropdown on the right during hover.
I want to give the users of my App the option to control which lists their actions show to by default. The new API seems to have taken a feature away because I can't see where that control is!
Users can control who can see Timeline activity on a per app basis directly from the new authentication dialog (See the control next to: This activity is visible to:) This setting includes Friend Lists. You can also guide your app users to change this setting at any time by going to their App Settings on Facebook (https://www.facebook.com/settings/?tab=applications), and setting the visibility of App activity privacy: for your application.