I've been Googling for an answer for several days now, but most of the solution to similar questions seem to use the deprecated REST-API.
I'm trying to create an event on behalf of a group where I'm the owner, using the Facebook Graph API in PHP. I can publish an event to my own wall and even to a page using a page specific access-token, but since the group doesn't have any access-token I'm using this:
https://graph.facebook.com/{$group_id}/events?" . {$user_access_token};
But something is going wrong and the event gets published only with me as the Owner. My permissions are: "stream_publish, user_groups, create_event, manage_pages"
Any Ideas?
You need to add the undocumented:
page_id={$group_id}
parameter to your post.
(as well as posting to the groups event stream)
Related
I'm building a Facebook application that uses a webhook to read Facebook leads. The application is now working fine: every new lead in my campaigns are sent via the webhook to my script, with the needed information about the lead: ad_id, form_id, leadgen_id and so.
Now, I am trying to get some additional information with the Facebook Graph API based on the ad_id, form_id and leadgen_id and I'm having issues with this. I tried the Facebook Graph API in both PHP curl, and a direct HTTP GET call, and I'm having the same issue in both ways.
When I try to fetch the lead object using leadgen_id, it works fine, and I can get the name, email and phone that I need.
When I try to fetch the form object using form_id, it also works fine, and I manage to get the form name.
But when I try to fetch the ad object using the ad_id (since I need the name of the ad) it gives me the following error: "Unsupported get request. Object with ID '23848043174300142' does not exist, cannot be loaded due to missing permissions".
Currently I have the following permissions (advanced access): pages_read_engagement, pages_manage_ads, pages_manage_metadata, pages_show_list, leads_retrieval, public_profile, ads_management.
Is it an issue with the permissions or with my call?
I tried both PHP curl, and a direct HTTP GET call, and I'm having the same issue in both.
My HTTP GET call to retrieve the ad's name (based on ads_id) is the following:
https://graph.facebook.com/v11.0/ADS_ID?access_token=MY_LONG_TIME_APP_ACCESS_TOKEN
(when I'm replacing ads_id with leadgen_id or with form_id, it gives me the relevant object without any problem).
Thanks,
David
I am sorry if this comes up late, I just had a very similar issue and the solution was to go to the Business Manager then Business Settings > Integrations > Leads access and assign the user that we are using the token for to the corresponding brand.
Facebook explains it here under Note: https://developers.facebook.com/docs/marketing-api/guides/lead-ads/retrieving/
Hope this helps some people.
Scenario
I'm building an application that needs the ability to post to users wall (personal profile) on behalf of a user on facebook. I remember before the way that I would do it is request a permission "publish_actions" but reading through their documentation i came to this page:
https://developers.facebook.com/docs/graph-api/changelog/breaking-changes/#login-4-24
which states that that is being deprecated.
They recommended an alternative which is using their sharing product found here but this seems like it would break one of the functionalies of my current application (I dont want to share content i want users to post it to whenever they choose to on whichever account they choose to).
Question
Is there a way to get posting to a users wall and NOT an event, page or group. If i'm correct I can still post data to events, pages and groups via API as normal but to a users wall its different? I need to post on their wall via api but i can't seem to find the permission.
My facebook api graph version for my app is 3.0 and im using their PHP SDK to make the requests.
I'm trying to use the Facebook Graph API to pull a list of events friends of the user are attending, here is the API Documentation:
https://developers.facebook.com/docs/graph-api/reference/v2.3/user/events
If I put in:
me/events
it works, but if I put in 193300913/events it returns nothing.
193300913 is the id of a random friend, I've tried with several other friends with which I should have the right permissions to see all of they events they are attending, but it returns nothing for everyone.
What am I missing?
Also here are the permissions being requested:
$permissions = array(scope=>'user_events,user_friends');
That´s not possible, since friend permissions are deprecated for privacy reasons: https://developers.facebook.com/docs/apps/changelog
I would not want any App to get access to my events if i did not even authorize the App, just because a friend of mine is using it.
From various postings I know that the timestamp of a 'like' is stored by FB, notably from here:
https://developers.facebook.com/docs/reference/opengraph/action-type/og.likes/
But what I'm having trouble getting clear is how, given a photo that's been posted to an event, I would get all the picture's likes and the time each like was created (and of course, by who).
As far as I can tell it would have to go something like this:
Get each user invited to event.
Get each user's likes.
Check if any of the fbid's of the likes match any of the event photos' id's.
But surely step 2 would necessitate me logging in on behalf of each invited user and anyway, wouldn't the above really poll FB too much? So I am assuming my procedure is incorrect.
Could anyone tell me what the fql would be to get a photo of an event and then the users who like the photo and then the timestamp of the like?
Thanks in advance!
Short answer, you can't. The FQL or Graph API doesn't provide such information.
There are two things to differentiate in Facebook for developers:
The FQL or Graph API, which lets developers access the Facebook data (it means everything hosted on Facebook servers and saved in Facebook databases) like events, photos, videos, posts, etc.
Open Graph, which lets apps tell on Facebook what happened on the app side : we are talking about the app's own content and requests.
When trying to grab information from an event (content managed by Facebook), you are in the first case. As you can see here, here or here, likes are never described by a timestamp.
What you saw here deals with Open Graph, which can't be applied on Facebook events.
Given the id of an event, is there a way to get the Facebook ids of the admins of that event through one of Facebook's many API's? The event is public. I can I know you can get the creator of the event but there may be admins other than the creator and I want to get those people as well.
Nope, You can only retreive a list of current members
Facebook Developer Manual Thing
As mentioned in this post: How to get Events Admin of Facebook event using Graph Api iphone dev?
You can try this:
https://graph.facebook.com/{event_id}/admins