Yammer API get list of all users in All Company - rest

https://www.yammer.com/api/v1/users/ does not work and only gives me users in the current user’s Yammer network. I need every single user.
If All Company had an ID I could use https://www.yammer.com/api/v1/users/in_group/
Moreover, https://www.yammer.com/api/v1/groups does not seem to have All Company within it

On the backend, All Company is not actually a group. It behaves kind of like a group in the UI, but with notable difference like users not being able to leave All Company. This and other difference betray the fact that the Yammer backend does not in fact treat All Company as a normal group.
Hitting the users.json endpoint will give you data about all users in the users' current network. This list of users is the same as the list of users who are "members" of the All Company group for that network.

Related

How to model users in the system?

I am working on system that will manage orders. Orders can be created via admin or via customer. Employee can take orders and change it's status.
My system should have three global types of users:
Admin - this type of users mostly uses WEB interface. Admins have different access levels, so some of them can only create orders, and others - edit core info about pricing and so on.
Customer - this type of users uses customer's mobile app. Main action is to add and cancel orders.
Employee - this type of users uses employee's mobile app. Employees can see open orders, assign themselves to orders and change order statuses.
Also, Customer and Employee can be authorised with phone number, that can be changed at some time (independently of each other). Admins can be authorised with uname + pword.
Current solution has one table for Admins, one for Customers and one for Employees.
So first part of question is how to structure database properly?
The second part is about authorising in REST api. In current solution I have three endpoints, that are authireses usertype independently.
admins/auth
customers/auth
employees/auth
And my thoughts is to keep three tables as is, because each usertype is slightly different concept and really independent. And keep authorisation as is, but add something like roles and privileges to auth token to restrict access for some resources.

How to determine if users with different home domains are part of same google apps org?

In Google Apps, there is always a base/primary organization. But Google Apps can have subdomains and suborganizations both (or combination of those).
We want to be able to identify the currently logged-in user as being part of the overall organization, whether it be the primary org/domain or some subdomain or suborg. But when you get user info or license info, it returns the home domain of the currently logged in user as the ID for their organization. No ID is consistent across all subdomains or suborgs.
I've also tried listing all orgs using the organization apis, but that doesn't seem to work when trying to get the org info of the root org: https://developers.google.com/admin-sdk/directory/v1/guides/manage-org-units
Is there a way, given a particular Google Apps user, to determine what the primary organization is?
The only alternative we have is to treat every domain/subdomain in the Google Apps org as it's own independent org. This is less than ideal because now a Google Apps admin who manages all of their sub-orgs/subdomains in one place in Google will now have to manage a separate organization in our app for each domain in their overall org. This uses up extra resources in our system for creating these additional orgs, but more importantly creates a very confusing organization/user management model.
When you look at the Users resource for the two users, compare the customerId attribute. If they match, the two users are in the same Google Apps account. If they don't they're not.
Also, don't assume two logged in users are in the same Apps account. One could be an Apps account and one could be a consumer account even though they have the same SMTP domain.

Get Google Group member's email delivery status

Within a group (using the web/gui), you can see 'bouncing', 'non-verified' etc. etc. next to a user.
Is there a way to get this info via the API?
Using python, I can use RetrieveAllMembers to ... retrieve all members. The returned GroupMemberEntry objects don't have the 'status' (for lack of a better word) of the user.
My goal is:
1) Dump all groups in my domain
2) Check group for bouncing addresses
3) Email group owner about the bad addresses/users.
I can do #1 and #3. It's #2 that I need help with.
Sorry, neither the Google Apps Provisioning API nor the Google Groups Settings API support retrieving or setting a members delivery status.

Google Groups: Retrieve list of groups for a user

Is there an API to get the list of all Google groups a user is part of (of course, with his/her permission) and vice versa (given a Google group, get all users part of that group).
The Google Apps Provisioning API lets you retrieve the current memberships for a Google Apps user as well as list all members of a Google Apps Google Group. However, there is no way to do this for consumer (#gmail.com) Google Accounts and regular (#googlegroups.com) Google Groups.
Also it need not be Google Apps Provisioning. They also have gdata Services and retrieve Groups function. For example
if you have an user example#domain.com, then you can use RetrieveGroups(String memberId, bool directOnly) where memberId is the email address and directOnly must be set to True. This works sleek.

Given a facebook ID, what metrics can I use to mark the profile as fake?

I am running a photo contest on my facebook page via a third party app (shortstack).
The grand prize is supposed to be given to the person with maximum number of Votes.
Each vote is mapped to a facebook ID, which is available to me via shortstack. The problem is that there are too many votes from fake profiles, I inferred this by manually looking at number of friends of the facebook profiles of people who had been voting (I have their facebook Ids).
I am also aware that I can extract out only the publicly shared information of these users via the opengraph.
In short, how should I go about marking all the votes in two categories "Genuine" and "Fake", after subjecting all the IDs to a certain logic that uses information out of the publicly shared user info for that Id?
As an example, let us assume number of friends a particular profile is the only metric that would be used to identify if a profile is fake or not. Now there would be that magical benchmark (number of friends) above which a profile can be considered genuine and below which all the profiles can be considered fake, although there could be some fake people above this benchmark and some genuine fellas below it. In our case, these metrics would also consist of other information a user shares via the opengraph, values and patterns of these parameters being different for genuine and fake users. The point is that I am sure that eliminating fake profiles is very common problem faced by people conducting contests,as they would like to choose the winner on basis of contestant's ability to spread the brand to genuine users. So, there must be people out there who have invested their time inthis, and it would be awesome to get some know-how on this.