Create event from the facebook Graph API - facebook

According to the FB graph API documentation: https://developers.facebook.com/docs/graph-api/reference/event/#Creating
Creating
Permissions
An access token of an Admin of the Event if required.
You can make a POST request to live_videos edge from the following paths:
/{event_id}/live_videos
When posting to this edge, an Event will be created.
However this is ambiguous - it seems like its referring to live videos, not creating an event itself.
So my question is, in 2018 after all the Cambridge Analytica API shutdowns and permissions changes, how do I programatically create a Facebook event in Javascript having access to the admin page token?
Thanks

Hitting /me/events, I get this return:
(#12) events management API is deprecated for versions v2.0 and higher"
Similar post here: OAuthException: (#12) events management API is deprecated for versions v2.0 and higher
Live videos can be created on existing events (as you have pointed out). But not the ability to create/manage events.

Related

Facebook Graph Api Get Event By Id

I am trying to receive an event from the Facebook Graph Api By Id with following request:
https://graph.facebook.com/{eventid}?access_token={app_accesstoken}
I am using an app-accesstoken. The Event is a public event and according to the Graph Api docs I should be able to receive public events with any access token: https://developers.facebook.com/docs/graph-api/reference/event/
Nevertheless I receive following error-response:
Unsupported get request. Object with ID '{eventid}' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api
I have tried with multiple events with the same results
In April 2018, following the Cambridge Analytics scandal, Facebook decided to greatly reduce the information available through Facebook API.
In particular regarding Events API, here the official statement.
Events API: Until today, people could grant an app permission to get information about events they host or attend, including private
events. This made it easy to add Facebook Events to calendar,
ticketing or other apps. But Facebook Events have information about
other people’s attendance as well as posts on the event wall, so it’s
important that we ensure apps use their access appropriately. Starting
today, apps using the API will no longer be able to access the guest
list or posts on the event wall. And in the future, only apps we
approve that agree to strict requirements will be allowed to use the
Events API.
After that change you will not be able to get events of Facebook Pages, using the Facebook API like in the old days.
You could be able to get the data of a page you own if you have user_event permission (https://developers.facebook.com/docs/graph-api/reference/user/events/) but your app need to pass the App Review process.
Source: https://newsroom.fb.com/news/2018/04/restricting-data-access/

Facebook Graph API return empty Page Events (7th May 2018) [duplicate]

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.

Is it possible to publish Events to Facebook via the SDKs or API still? [duplicate]

I have gotten the access token with the correct permissions to manage events etc. However, the following:
https://graph.facebook.com/{pageID}/events?access_token=xxxx&name%3Dtest%26description%3Dtest%2520description
(I have not included the credentials here)
Upon testing the above does not create a name value or description for the event - the page just returns a blank data object.
Is it possible to create some test data for an event through the browser address bar and if so what is the correct syntax?
As per Facebook's documentation in: https://developers.facebook.com/docs/graph-api/reference/v2.0/event#publish
Publishing
You cannot create events via the Graph API.
Use Facebook SDK instead: https://developers.facebook.com/docs/javascript/reference/FB.api
I spent a long time battling this too.
TL;DR - graph v1.0 allows event creation, graph v2.0 does not.
Facebook Graph API 1.0 "events" allows you to create events (all CRUD actions) and is fully described in the docs. Graph version 2.0 does not allow you to CRUD event data. This is where the other answer came from.
Graph version 1.0 will be depricated April 30, 2015 (official changelog).

Can you create an event using the Facebook API?

I would like to be able to use the Facebook APIs to create events for facebook pages. From this link it seems to not be allowed: https://developers.facebook.com/docs/graph-api/reference/v2.0/event
Am I missing something? It seems like this was available in the past and I have no idea why it would not be available now.
Creating events via the API was allowed in v1.0, but has been removed in the newer Graph API v2.0. Facebook has removed several permission permissions from various end-points, including events, to prevent abuse.

Creating Facebook Event - Graph API

I have gotten the access token with the correct permissions to manage events etc. However, the following:
https://graph.facebook.com/{pageID}/events?access_token=xxxx&name%3Dtest%26description%3Dtest%2520description
(I have not included the credentials here)
Upon testing the above does not create a name value or description for the event - the page just returns a blank data object.
Is it possible to create some test data for an event through the browser address bar and if so what is the correct syntax?
As per Facebook's documentation in: https://developers.facebook.com/docs/graph-api/reference/v2.0/event#publish
Publishing
You cannot create events via the Graph API.
Use Facebook SDK instead: https://developers.facebook.com/docs/javascript/reference/FB.api
I spent a long time battling this too.
TL;DR - graph v1.0 allows event creation, graph v2.0 does not.
Facebook Graph API 1.0 "events" allows you to create events (all CRUD actions) and is fully described in the docs. Graph version 2.0 does not allow you to CRUD event data. This is where the other answer came from.
Graph version 1.0 will be depricated April 30, 2015 (official changelog).