I have an application using the Graph API. I have it creating events for the user, but would like to let the user invite their friends from our site instead of having to go to the events Facebook page. Does anyone know of the request I have to send the friends' IDs too to invite them like with the old API? Or if it even exists? I am finding a lot of the finer details in the API documentation are vague. Thank you!
Also, side question, can you send an event photo with the create POST? I see no mention on how to submit a photo with the event creation. Thanks.
Tap in the top right of Facebook, then tap Groups and select your group. Tap Events, then tap to select the event. Tap Invite, then select the people you want to invite.
Enter the email addresses of guests with whom you are not Facebook friends in the "Invite by E-Mail Address" field just below your list of friends. Separate each email address by a comma.
Yes, you can share using the graph2 api. The way you do it is to use /feed edge and pass the post's url that you want to share as the link. Standard Fb permissions to the post you are sharing do apply. This was done today, in a local rails app, using FbGraph2 gem, with the above method.
The Graph API is the primary way to get data into and out of the Facebook platform. It's an HTTP-based API that apps can use to programmatically query data, post new stories, manage ads, upload photos, and perform a wide variety of other tasks.
I actually was able to get an answer from the Facebook team and they just told me to use the old API through the new PHP interface. They have yet to convert this functionality and don't know if it will be converted.
Edit:
Here is the code I used to invite friends after I got the IDs from the new api ($id_array). This is applied in a wrapper around the PHP Facebook object I used to hold all my Facebook specific code.
$fb = new FacebookGraph(array(
'appId' => 'xxxx',
'secret' => 'xxxx',
'cookie' => true,
));
$fb->api(array(
'method' => 'events.invite',
'eid' => $event_id,
'uids' => $id_array,
'personal_message' => $message,
));
This is actually possible with the Graph API, specifically the invited
connection of the event
's object:
POST /EVENT_ID/invited/USER_ID
Invite a user to an event. Returns true
if the request is successful.
POST /EVENT_ID/invited?users=USER_ID1,USER_ID2,USER_ID3
Invite multiple users to an event. Returns true
if the request is successful.
You'll need the create_event
permission. More info is available in this post.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With