Facebook api Get users who invite members to group - facebook-graph-api

I want to get id, name of users who invite their friends to Facebook group. I tried this api to get users who requested to join groups
https://graph.facebook.com/v2.10/group_id/member_requests?access_token=[token]
but it only shows the list of requested users without inviters info
Anyone have any solution?

Related

Using facebook graph api to read photo tags

I am building a website using React and Redux to search facebook photos through tags like my Friends name or by location. User needs to login with facebook so that the application can read its pictures. A user simply puts in the search filters like Tagged users or the location of the picture and my app will show results based on the filters. This will help to find old photos with friends which sometimes get lost on social media due to a large number of photos present(Uploaded or Tagged)
I am trying to fetch mutual photos of me and my friends using my access token and trying to read the tags present in the photos through API but the Response contains only my name in the tags and not other people who are tagged in that photo.
Is there any way to fetch the users who are tagged on a photo uploaded? Any help is appreciated.
Graph api link
Access to any data involving your friends is only possible if those friends specifically authorized your App too. You cannot even get an ID of a friend if he did not authorize your App.
Yes, in order to access involving your friend to authorize your app. But from the details i can see that,
"A user access token may read a photo that the current user is tagged in if they have granted the user_photos or user_posts permission. However, in some cases the photo's owner's privacy settings may not allow your application to access it."
Note: Just need to verify users privacy setting once again.

Accessing user_ID via messenger bot

I'm using the Graph API, but I can't figure out how to get a logged-in users ID address.
The intro to Graph states "The Graph API can provide access to all of the basic account registration data you would typically request in a sign-up form for your site, including name, email address, profile picture, and birthday" but to access them i need user_ID so how could i get it ?
https://developers.facebook.com/tools/explorer/?method=GET&path=me%3Ffields%3Did%2Cname&version=v3.0
You need to have a token from the user, check out the given link. You can see what informations you can access if you give permission to your own profile.
This ID is unique to each app and cannot be used across different apps.

How can I add users to a Facebook group automatically?

The flow I'm going for is:
User signs in with Facebook to our site.
User pays a fee using PayPal or some similar service.
User is allowed access to a particular Facebook group.
I'm not particularly fussy about how the process works, but I'd like to avoid a manual step if possible.
I know I can't invite them using the Graph API (as they're not an admin, developer or tester of the app). But is there some other way round? A button that allows them to request access that I then confirm using the API? An automatic way of emailing an invite?
Or is there a way of making it easier to do the manual step? Some way of listing the new users with an "invite to group" button? A friend request button for the user to press?
With facebook API you can't do this with a normal group, but you can use app groups instead. To create an app group, you have to do a POST request to this url:
http://graph.facebook.com/{your-app-id}/groups
with the following informations:
valid app access token
name: the name of the group
description: the description of the group
privacy: enum, it can be open or closed
admin: admin's user id
Then you will recive a gropu ID. You can get info about your group ith a GET request to this URL:
http://graph.facebook.com/{group-id}
EDITED: You can no longer add members with POST request, but there is an another way.
New solution
You can use a client-side dialog to add members to groups. You can find the documentation here: https://developers.facebook.com/docs/games/app-game-groups/v2.0#add_user
I tested it with a user who wasn't a tester, andd it works fine.
Old solution (no longer available)
You can add members to this group with a POST request to this URL:
http://graph.facebook.com/{group-id}/members
You have to post:
valid app access token
member: user ID of the person to invite
The person will recive something like this image:
(source: edemmester.hu)
I tested it, it works fine.
More info about app groups: https://developers.facebook.com/docs/graph-api/reference/v2.0/app/groups
IMPORTANT! You have to use app access tokens here, not user access tokens.
I don't think it's possible to invite people without writing a browser extension that has access to the cookies etc. of the logged-in group admin.
Anyway, you cannot simply add people to a group if you're not friends with them, but need to invite them by email. So probably it's easiest if you ask them for their email-address and then invite them by email.

Facebook Graph API `/me/accounts` returns empty list if the account itself is a page

I have a website where users can manage their restaurants. They can connect each restaurant to the corresponding fb page, if any.
This works perfectly well if the user has a normal Facebook account and is administrator of these pages. I ask for manage_pages and publish_stream and after the user gave access to our service, I present them a list of pages to choose from using the /me/accounts endpoint.
But, now one of our users doesn't have a private Facebook account. He signed up on Facebook as a page, with no personal information. The /me/accounts call returns an empty list. And afaik Facebook doesn't allow developers to create these kind of test users (only normal, private fb accounts), which makes it impossible to debug.
So did anyone of you already come across this and know how to solve it?

Facebook Graph API To Fetch Activity Feed

I am trying to implement same feature ( Your friend's Activity ) in an application
I am able to fetch the list of my all friends and his profile pictures Through Facebook Grap API by using javascript SDK.
FB.api('me/friends?fields=name,picture.width(80).height(80)', function(response){
.........
})
But i just want to fetch the list of those friend who are associated with an app id in other words those who have joined my website through facebook. Also is there any way to fetch activity feed of a particular user on the basis of user id and app id ?
But i just want to fetch the list of those friend who are associated with an app id in other words those who have joined my website through facebook.
Facebook open graph, filtering friends list array
Also is there any way to fetch activity feed of a particular user on the basis of user id and app id ?
You can read everything that is public using just your app access token. To get stuff that has limited visibility (for friends only f.e.), you should use the access token of the current user.