Checking if a user is a member of a specific facebook group (2016) - facebook

It appears there was a big update to the facebook api a year ago and a lot of the info online is inaccurate because of it. I'm trying to create a website that provides additional function for members of a specific facebook group; if a user is not part of a specific group I don't want them in it. Some groups may have more than 5k users but if I have to settle for less, so be it. I'm using the php sdk and have successfully made an initial api call with general user information.
Administrators of the group WILL be able to log in, but apparently Facebook isn't approving the "user_groups" permission (?) https://stackoverflow.com/questions/31171082/check-if-user-is-a-member-of-a-specific-group-using-facebooks-javascript-sdk
I found this but I'm not sure how to make it work. Facebook Graph - Possible To Check If A User Is A Member Of A Group w/o user_groups?
I'm using the graph api explorer and I can get a partial list of the groups I'm in but it's nowhere near complete (it displays 4 out of like 20). My thought was that if I can get a full list of members in a group that I could just do an [if user is in userlist then]
What would you do here?

As far as I understand there is no way to do this without some caveat where it won't work (when you have more then 5k members). It also causes you to create a copy of the members list, instead of when a user wants to access the group.

Related

Missing group members when retrieving group members via Facebook API

I am trying to retrieve the list of members of a group via the Facebook API. It works in principle, but it seems that there's a discrepancy between the number of members as stated on the group page (when accessed via the browser) and the number of members retrieved via the Facebook API.
Steps to reproduce:
Consider for instance the following group: https://www.facebook.com/groups/141499479690556
As of right now, Facebook states that there are 1165 members in that group.
Now, go to the Graph API explorer (https://developers.facebook.com/tools/explorer) and access /v2.10/141499479690556/members?limit=1500 (I set the limit well above the number of group members here to make sure they are all in there).
As of right now, the returned data array only contains 1139 members.
Where are the missing 26 members?
And yes, I am absolutely sure noone "blocked" me or anything. Anyway, I tested this on several groups, even some I have never interacted with. There always appears to be a discrepancy, and the bigger the group, the bigger the discrepancy. In groups with over 5000 members, I have seen discrepancies of 100-200 people.
At first I thought there was a problem with paging (I originally used a smaller limit and used paging), but as you can see, the same problem appears even when the limit is high enough for all members to be returned at once.
https://www.facebook.com/help/186433704739124
If you're seeing a total number of members that's different from the real number, it's possible that some people in the group now have inactive accounts.
When someone's account is inactive, it means that person can't be seen or found on Facebook. Even though he or she is still counted as a group member, they won't appear in the group anymore. An account can become inactive if someone chooses to deactivate it or if the account is disabled by Facebook.

Facebook Graph API pre-defined messages, but with the ability to edit

I am currently building a site for a University study that aims to encourage a select few young people (peer supporters) to share messages around health and wellbeing in a private Facebook group.
I have used the Feed/Share dialog to share relevant links/images, however there are a few bits of content that are just pure text. I am aware that Facebook allows to post a status to a group using the Graph API, however you are not allowed to pre-fill what a user is going to say.
Would it be possible to have the ability to generate the content in a text box allowing the users to edit it as they wish before posting to the group or is this still prohibited?
...allowing the users to edit it as they wish...
No, that is not allowed, it´s prefilling. You would only be allowed to present an EMPTY textbox, where users can write the message. The message always must be 100% user generated.

How do I query the Exchange Online REST API for a list of users, mailboxes and/or calendars?

Background
I'm able to query outlook.office365.com/api/v1.0/me/ for the current user that is logged in. But I'm unable to find a query that would give me a list of users. Below are the following queries I've tried without any luck.
outlook.office365.com/api/v1.0/users/
outlook.office365.com/api/v1.0/me/users/
This is the error I receive when I'm doing either of the queries.
https://www.dropbox.com/s/64o0mwj1w3uigk8/Screenshot%202015-07-09%2013.07.22.png?dl=0
Goal
I would like help finding the correct REST API queries for a list of users, mailboxes, and calendars.
Extra Findings
Note that while I was referring to https://msdn.microsoft.com/en-us/office/office365/api/complex-types-for-mail-contacts-calendar#RESTAPIResourcesUser I received the error listed above for the query'../me/users/$count' when trying to count the number of users.
We don't allow enumerating the list of users in a tenant using the outlook endpoint. you can however do this using the AAD graph api. For example:
https://graph.windows.net/contoso.com/users?api-version=2013-04-05
For calendars, you can see all calendars of a given user by enumerating those from ../me/calendars
Thanks for mentioning the $count issue, it was a bug which has been fixed. You should see it rolled out soon worldwide. But note that this will still not allow you to get a count of users as that collection is not enumerable. The $count will help with queries like ../me/messages/$count

Facebook Application Group Limitations

I am investigating building an application that will heavily leverage Facebook's app/game groups. During my prototyping I noticed the following limitations:
1) Number of Groups - There seems to be a limit on the number of groups an application may have, that limit seems to be tied to the number of users participating in the application. For example with 1 user participating in the application, I can only create one group. If I add a few more user I can add several more groups. Does anyone know if the specific limitations are documented. I cannot seem to find them and it would be good to know what they are so I can develop my application around these constraints.
2) Number of Groups a User can be invited to - When I try to add a user to more than 5 groups (through consecutive API calls), I get the following error:
OAuthException: (#4002) The attempt to invite the user to the group failed.
Does anyone know if there is a limitation with how many groups a user can be a member of within a given application? Is the limitation based on time, for example can a user join up to 5 groups every hour, etc?? If there is such a limitation are the constraints documented somewhere?
Thanks in advance for the help.
--Steve

Using GA Data Export API to Get All UA's

I am using the GA Data Export API to interact with Google Analytics and I'm making a lot of progress, I am using this URL Endpoint initially to pull all the profiles under an account:
https://www.google.com/analytics/feeds/accounts/default
This URL retrieves each GA ID (profile) and each UA. One thing I've realized is one account can contain multiple UAs and when this happens, this request pulls all profiles. We have a client who has about 115 profiles under like 10 different UAs, and the request takes about 30 seconds for the initial request (and then I believe it must be cached, because it speeds up considerably after this, but then the next day the same thing occurs).
Is there a way to get a list of UA's without pulling the profiles? This way I can query the UA specifically for the profiles instead of pulling each one.
Any advice on this would be really helpful!
Thanks
UPDATE: Here's some documentation on the specific call I am using right now:
http://code.google.com/apis/analytics/docs/gdata/gdataReferenceAccountFeed.html
UPDATE 1: I have found some interesting information in the docs
Once your application has verified
that the user has Analytics access,
its next step is to find out which
Analytics accounts the user has access
to. Remember, users can have access to
many different accounts, and within
them, many different profiles. For
this reason, your application cannot
access any report information without
first requesting the list of accounts
available to the user. The resulting
accounts feed returns that list, but
most importantly, the list also
contains the account profiles that the
user can view.
So this means that you have to use the default accounts call to get these back? Surely, somebody has had this issue before?
So apparently, you can query the account if you know the UA-ID, however there is no way to get back a list of only UA IDs.
One way you can do it is have the user enter their own UA ID instead of having them choose one; not as user-friendly as it could be but better than making the user wait 30 seconds!