Group add request using facebook graph api? - php

Are there any built-in "Group add request" actions that come with the facebook graph API? Like the built-in Like action? That happens with a users request. I would like to do this from an external website, just like the Like action works
For example the user is active in a forum, where different categories have their own facebook group page, and they would like to access the group without having to actually log on facebook and make the request.

From the docs:
Invite User
Applications can invite users to a group by issuing a POST request to /GROUP_ID/members/USER_ID with an app access_token.
Note that user being invited must be a user of the application. The user will be sent a notification saying that they have been invited to the group. The notification will take them to the group page. Users can only be invited once. Subsequent invites will fail.
So you the user will have to authorize your app, and then you can do it.

Related

facebook php graph api me/friend reture nothing

hi I'm a facebook api php developer. I developed some apps with me/friend . now this return friends only for my admin account. when another user use this app, it retune nothing.
why this return friends only for my admin account.
if should I get special permission how can I get it.
could you any one please help me.
Make app live
You need to make the app and all its live features available to the general public. This can be done by making the app live by going to https://developers.facebook.com, select Apps --> Your App Name --> 'Status & Review'.
Login Review
You might need to do a Login review.
Review is not required to ask for the three basic permissions: public_profile, user_friends and email. In order to use Facebook Login in your app and access additional elements of a person's Facebook profile, you will need to submit your app for review. If your app is not approved or you don't submit for review, people will not be able to use Facebook Login in your app.
https://developers.facebook.com/docs/facebook-login/review
According to Facebook Graph API for Friends you need user_friends permissions which states that:
Only friends who installed this app are returned in API v2.0 and higher. total_count in summary represents the total number of friends, including those who haven't installed the app.
Friend list now only returns friends who also use your app: The list of friends returned via the /me/friends endpoint is now limited to the list of friends that have authorized your app.
Read change log
You can debug me/friends endpoint as well.

Is is possible to join FB group / Invite Friends using api

I am working on facebook api using php. I did a functionality to get the search feature in facebook (i.e) by user, group, etc.
Now i am in need to invite the search result user and join that search result group.
I tried more in google but i am not getting any source to join a group.. Is it possible to do that using facebook api?
Please help me on this..
Yes you can send invites to the users to join a group. Here's the documentation.
But the condition is that:
An app access token can invite any app users to a group created by that app.
The request must be made with an app access token and this same app must have created that group. So, you cannot send request to the friends if that group was not created using an app.
Edit:
If you are asking that a user can join the group with Graph API, it's (of course) not possible!

Subscribe Gate Implementation | Facebook Graph API

I have a facebook app for which user grant me permission to access user_subscriptions to make my app able to access https://graph.facebook.com/me/subscribedto?access_token=#
It let me access all the persons app user is subscribed to.
I use this data let my app know that the user is subscribed to a particular person and let him/her access the site furter, I call this process a Subscribe Gate.
But I'm running into a problem now, that suppose a user is subscribed to about 1K or even 5-10K, then in such case think about the amount of data will be transferred and the load on the php server, facebook will consider my app spam and might block me
I want to know is there a way through which I could search for the person whom user is subscribed to instead of asking for all the persons user is subscribed to and check manually by php script
If I understand correctly, you want to know if a particular person is subscribed to the user of the app. Supposing the person in question's user id is XXXXXXXX, do...
via Graph:
https://graph.facebook.com/fql?q=select subscriber_id from subscription where subscribed_id = me() and subscriber_id='XXXXXXXX'
or via FQL:
select subscriber_id from subscription where subscribed_id = me() and subscriber_id='XXXXXXXX'
-
Note: while in theory the above solutions should work equally well, when I tested the Graph-based solution with the Facebook Graph explorer, the query processed for an unusually long time. FQL worked fine.
Update: To find out if the user of the app is subscribed to a particular person:
select subscriber_id from subscription where subscribed_id = 'XXXXXXXXX' and subscriber_id = me()

How to make a user subscribe to another users using Graph API?

I would like to users when added to this website they automatically subscribe to another users in facebook. I know I can list users, which the authenticated user is subscribed to, but can I make a new subscription?
thanks.
Looking at docs,
http://developers.facebook.com/docs/reference/api/user/#subscribedto
Graph api gives only 'read' action for both subscribers and subscribedto
However, you can use the Subscribe Button plugin

Foursquare style facebook invite over Graph API

I want to allow newly signed up users to be able to do a facebook connect and select some of their friends and dispatch an invite to them for my website.
I saw this in action when I signed up for foursquare, I believe they are using the Graph API in a particular way to achieve this.
What approach should I take to get to similar results?
I am using PHP and Javascript.
You are not allowed to send messages to friends of a user who authorized you via Facebook.
The Graph API does not allow this.
Foursquare only allows linking between people who are buddies on Facebook AND already have authorized the Foursquare application.
The process is :
A and B are Facebook friends.
A authorized foursquare (FS for short) app - FS has their email and facebook ID.
B authorized foursquare (without any relation to A) - FS has their email and facebook ID.
FS looks up B's contacts, and cross-references the list of those facebook ID's with ID's of all the people who signed up to FB via facebook.
Result : list of people who are Facebook buddies of B AND have authorized FS app on facebook.
Since FS already has A's email - they can send the request via email.

Categories