Inviting users to an event - notification - facebook

I have an exsiting event which I'm trying to invite users to using this method:
https://api.facebook.com/method/events.invite
?eid=EID
&uids=UIDS
&access_token=ACCESS_TOKEN
...this sort of works, in that the invited user gets a post to their wall like this:
Test Event — 19 March at 14:08.
User invited you · View · Join
But my problem is, the invited user DOESN'T get a notification.
The code is taken from here:
http://developers.facebook.com/docs/reference/rest/events.invite/
But when I run if from there, which is identical to my above code, the invited user DOES get a notification.
What am I doing wrong / missing?
Thanks

You are using a deprecated method and should switch to using graph api requests.
In this case, you can use the Event object in the graph.
Doing the same thing with the graph api should look something like:
https://graph.facebook.com/EVENT_ID/invited/USER_ID
or
https://graph.facebook.com/EVENT_ID/invited?users=USER_ID1,USER_ID2,USER_ID3
(You should have the create_event permission and an active access token of course)
This is copied from the document, under the invited section. You might also might want to check the attending, maybe and declined sections.
You can use the Graph API Explorer tool to test graph calls.
Edit
I'm sorry for not including this with my original answer:
The invitation made by the graph api (or the deprecated REST) does not result in notifications in the users' side.
You can find a few more threads about this subject here:
Invite user(s) to event with notification - works manually but not with Graph API
Facebook: No Notification when App sends event Invites via Open Graph
invite for an event by graph api doesn't send notification
But the best indication for this being the case can be found in this bug ticket: Bugs - No Notifications on Event invites via Graph API.
Notice the response from facebook:
event invites do not currently render an on-site notification, this is
a deliberate limitation of the API Event invites made this way will
still increment the counter in the 'events' bookmark and add the event
to the user's events list
Hope this clarify things.

Related

How to send any actions to my API by facebook-messenger API if the person isn't available?

When a user blocks my facebook bot account I can't handle any query about this action, but I need this information on my API. I try to write to an unavailable person from Facebook Page, but I just get an error "this person isn't available right now" in front and without query to my API
How I can handle, find and check unavailables users?
I thought to handle actions from chat on application's Facebook page (Mark as Done, Delete chat, etc), but I don't know how I can to get this on my API.
Facebook actions
There is no specific event for such an action (user blocking the conversation), so your only option is to handle the person-not-avail error response and mark those users on your end.

Facebook realtime API: do removed friends trigger an update call?

Naturally the documentation doesn't make this distinction, which makes me think it doesn't. So very succinctly - does anyone know whether a user losing a friend triggers a realtime update callback? If so, is it the same if the user removed said friend or if the user was 'unfriended'?
If I've missed something in the documentation about this then I apologise, but I assure you I have looked.
The Facebook Realtime API does seem to be providing notifications about certain user fields and connections for the User object. Connections to which you can subscribe include for User object include: feed, friends, likes, checkins, location, events.
And when you have successfully subscribe for user object subscription, everytime users friends is updated, your callback server will be notified.

How can a Facebook application notify a user of something?

The example is a website allowing users (who are associated with Facebook users) to create a blog post. The commenting system is the fb:comments social plugin.
When someone leaves a comment, the writer of the blog post should be notified that there is something new to read.
What I would expect as a writer is that I would get a notification (ie. "x has commented on your blog post."). There doesn't seem to be a way to generate those notifications though.
What methods are there in the Graph API for the writer to learn about the new comment? Which is the "best"?
Do one or both of the following:
Send App-to-User Requests. They won't generate notifications, but
they will increment some app counters. Among other places, the user will see the counter at the top-right corner of her wall.
Use the email permission to get the user's e-mail address. Store the address on your server and send the user an email whenever she needs to be notified.

Create a group related event with Facebook Graph API

I've learnt how to create an Event on Facebook with the new Graph API.
Since I'm the administrator of a Facebook Group with about a thousand members, my aim is to invite all the group's members to the event.
But I've found out that I can only invite just those who are my friends (and I don't even know if there's a limit), while with the old system you could create a group related event - the old URL looked like this
http://www.facebook.com/groups/123456789/events
that allowed you to invite all the members of the group, even those who are not your friends.
Does anybody know if this is possible with the Graph API, or if there is a workaround to do such thing?
Thanks
If the event you create is not a Public event (event with "Anyone can view and RSVP") in Facebook, you can invite only your friends using Graph API. If it is a public event then you can RSVP the event on behalf of the user by providing his access token and with RSVP_event extended permission.
RSVP ing is not invitation. It is setting a status (Attending, maybe attending, declined) on behalf of a Facebook user. For that you have to use the access token of the person whom you want to participate in the event. Here no invitation is sent but instead you are directly setting the status of that user. For this you have to sent a POST request to graph.facebook.com/EVENT_ID/STATUS where status is attending/maybe/declined . Refer STATUSES section in developers.facebook.com/docs/reference/api/event
If you want to RSVP 2 users (userid1 with accesstoken1 and userid2 with accesstoken2) to an event "event1" you have to issue 2 requests in the following format
https://graph.facebook.com/event1/attending?access_token=accesstoken1
and
https://graph.facebook.com/event1/attending?access_token=accesstoken2
Request one will set the status of user(userid1) as attending and request two will set the same for user(userid2)
SUMMARY
In public events anyone can participate. With an application you can rsvp the user(your friend or not doesn't matter,but must have authorized your app with rsvp_event permission) to that event with his/her user accesstoken(not yours) or invite your friends with your user access token
In private and closed events you can invite or rsvp, but only those who are your friends.
Hope I made myself clear. If you need further clarification let me know.

Check feed/post update from user's wall without calling (pulling) graph api periodically

I know how to use graph api - https://graph.facebook.com/{id}/feed|posts to get user's and page's feed.
I also know that facebook provides an subscription API. But I can not use it to check feeds of users i am interested but not our application users (ex: A super idol I am interested but who is not our application users. I want to check not only posts by him but also messages posted by his fans)
Is there a notification service to notify me (callback) the updating of user's feed, such that I don't need to pull graph api periodically to check the updating?.
Thanks.
"I want to check not only posts by him but also messages posted by his fans" and "but not our application users"
This sounds like a stalker app. http://developers.facebook.com/policy/ Facebook says you are not allowed to do that.