Facebook PHP API, posting events on the page

I’m looking for a few days, and I still have not found a way to post events on the page on which I am the administrator, so I decided to ask you. Can you do it in any way?

http://pastebin.com/WSHCDLdr

I tried on the "me / events" page and it works fine (although the distribution delay is huge), but it is a user account. I want to post events on the page that I created in the same account, or on the page on which I am the administrator.

This is my code. If you know that this is possible, and I want to say what I am doing wrong, or if the method is different, how to do it, I would be very grateful.

Chris

0
source share
2 answers

It seems to me that you need the access_token page, and here is how you get it:

 $page_id = "XXXXXXXXX"; $page_access_token = ""; $result = $facebook->api("/me/accounts"); foreach($result["data"] as $page) { if($page["id"] == $page_id) { $page_access_token = $page["access_token"]; break; } } 

Make sure you grant manage_pages permission and add access_token to the $event_info .

+2
source

This API is deprecated on Facebook: /

 events management API is deprecated for versions v2.0 and higher 
0
source

Source: https://habr.com/ru/post/1413586/


All Articles