0

As far as I know you cannot edit FB events through the Graph API.

What I want is to include in my page an Edit button for an event with exactly the same functionality behind as the one from Facebook. Same goes for a "Create" button.

How can I do this?

Adrian Ber
  • 20,474
  • 12
  • 67
  • 117
  • you can´t edit FB events, as you found out already. not sure what you want to achieve with an edit or create button if it´s not possible? – andyrandy Jun 29 '15 at 11:01
  • You can't edit FB events through the Graph API. I want to embed the actual FB functionality in my page. – Adrian Ber Jun 29 '15 at 11:02
  • 1
    _“I want to embed the actual FB functionality in my page”_ – and _that_ is only possible either via API, or via the social plugins Facebook offers. (And they don’t offer any such plugin for events either.) – CBroe Jun 29 '15 at 11:32

2 Answers2

3

There is no social plugin for this, and it´s not possible with the Graph API as you found out already. There is no other way. You can only go to Facebook to create/edit Events. Btw, the possibility to create events was removed with v2.0 and the upgrade process may still happen, so if some App can still create events it´s most likely because it´s still at v1.0. Sooner or later it will get upgraded though. More about the changes: https://developers.facebook.com/docs/apps/changelog#v2_0

Just to be clear about workaround solutions: Loading parts of Facebook into an iframe is not allowed and not possible. More information: Load Facebook into an iframe

Meaning, if you try to load any part of facebook.com in an iframe, you will get the following error in your console:

Load denied by X-Frame-Options: https://www.facebook.com/events/upcoming does not permit framing.

...which basically means that you are not allowed to load any part of facebook.com in an iframe.

Community
  • 1
  • 1
andyrandy
  • 72,880
  • 8
  • 113
  • 130
  • Technically there is another way, though not recommended. By loading the facebook page in an iframe. You can either do that as is and thus the user will see that you're loading facebook, or you can hide the frame and show a different interface to the user. Anyway, this second option relies on the structure of the DOM of the facebook new event page, and thus might not be sustainable longer term. But technically, it's possible :) – Stef Jun 29 '15 at 12:39
  • we only discuss legal stuff on stackoverflow. you are not allowed to load a facebook page in an iframe, and i don´t think it´s even possible. did you try it? i am pretty sure facebook prevents you from doing so. trying to load it in an iframe AND trying to hide facebook stuff is even more illegal. – andyrandy Jun 29 '15 at 12:57
  • may i ask why my answer got downvoted? it´s definitely correct. i am happy to include more information if needed, but there´s nothing more to say, to be honest. – andyrandy Jun 29 '15 at 12:57
  • the reason is that it's actually not correct. It's perfectly legal to load any page in an iframe or in another window, nobody can interdict you to do so. Also, if you see my answer (take zapier's example), it actually seems to be possible. But you probably need to sign a deal with Facebook and convince them how good it is for them to grant you that access. – Stef Jun 29 '15 at 13:01
  • 1
    i´ve added some more information to my answer, about the iframe solution. – andyrandy Jun 29 '15 at 13:14
0

Short answer: Facebook doesn't allow that anymore (as of Graph API 2.0).

Facebook has removed that functionality in Graph API 2.0 (probably to avoid spams). That's unfortunate as it was a cool integration for useful apps.

Here you can see the changelog stating that this functionality is not available anymore: https://developers.facebook.com/docs/apps/changelog

Create event Removed - Apps can no longer create events with the API.

Now, I'm thinking that they could allow such an integration for special partners. E.g. Zapier seems to have an integration that creates Facebook events for your Google events, thus I'm guessing it's possible if you can strike a deal with Facebook:

https://zapier.com/zapbook/google-calendar/facebook-pages/6308/create-facebook-page-event-from-google-calendar-event/

But at the same time, another big event provider, Eventbrite, seems not to have managed to secure such a deal (not yet at least):

http://help.eventbrite.com/customer/portal/articles/428611-how-to-publish-your-eventbrite-event-to-facebook

Thus, short answer is that Facebook doesn't want you to create events on their platform, whatever their reason is.

Technically it is possible, but it's nasty

Now, if you really want to do it, there is a way, though I wouldn't recommend it as it relies on the structure of the DOM of the Facebook page. Here how (most of the below is done in JavaScript):

  1. you use an internal frame to load the facebook events page home.
  2. you 'click' the create event button behind the scenes, using javascript
  3. you create a similar interface to capture all those fields in your application.
  4. once the user clicks 'submit' on your page, after filling in all those details, you copy those to the Facebook DOM to the corresponding fields and submit that page (using JS again).
  5. You search the newly created event (you can do this using Graph API) and show it to the user.
  6. Voila, you now have created a Facebook event and the user won't even know it.

NOTE: This is heavily relying on the structure of the Facebook DOM, thus a small change in the DOM of the Facebook Events page might break your functionality ... not the best user experience.

Stef
  • 2,603
  • 2
  • 18
  • 28
  • suggesting illegal stuff on stackoverflow is not cool. the stuff that is relevant is in my answer already. also, i assume you did not try to load the facebook events page home in an iframe, because i am pretty sure it´s not possible at all. – andyrandy Jun 29 '15 at 13:00
  • mate, it's not illegal. Show me the law that says that it's illegal to load a page in an iframe please and I'm happy to take my comments out if this is indeed illegal ... Also, it's obviously possible as well, as you can see that Zapier is doing it. So, your answer is not at all accurate, though it's correct for most people. Though, maybe Adrian works for a big company or on a product that Facebook might be willing to allow to integrate with. Thus, I believe that my answer is more complete. – Stef Jun 29 '15 at 13:07
  • it is definitely not allowed to load facebook or parts of it in an iframe. did you try zapier? are they still doing it? it´s possible that their app is still v1.0, afaik the upgrad is still happening. – andyrandy Jun 29 '15 at 13:13
  • 1
    i just tested it, and added the relevant part to my answer. it is definitely not possible, as i suspected. – andyrandy Jun 29 '15 at 13:17
  • It could be possible if you do it on server side, but I'm not recommending it :). I only mentioned it for answer completeness. Thanks for checking the iframe option. Zapier is not on API 1.0 since that's not available anymore, but I haven't checked to see if the integration is actually still working or it might be wrong info on their website. I'll vote your answer up since it's the most accurate at the moment. Cheers – Stef Jun 30 '15 at 20:37
  • as i mentioned, some apps may still be able to use v1.0, not sure if they upgraded all of them already. afaik the process is still happening. – andyrandy Jun 30 '15 at 21:57
  • According to https://developers.facebook.com/docs/apps/changelog, v1.0 is not available anymore: `v1.0 /{object} April 21, 2010 No Longer Available` – Stef Jul 02 '15 at 05:31
  • yes, for new apps. there are still messages of apps using v1.0 features in the facebook dev group on facebook and they said it can take longer to upgrade all of them. – andyrandy Jul 02 '15 at 09:24