REST API to get a list of active subscriptions in Google Workspace - google-workspace

Looking for an API to get list of all subscriptions in Google workspace (not the detailed info about available licenses count etc). It's the same information which is available on Admin console under Billing-> Subscriptions
Billing/Subscriptions

If you're a reseller
You can use subscriptions.list The list can be all subscriptions, all of a customer's subscriptions, or all of a customer's transferable subscriptions.
If you're a regular Google Workspace customer
You can use licenseAssignment.list. It doesn't display the list itself, but you can filter the elements within the items property and loop over productId, skuID and skuName

Related

Retrieve Data via Facebook webhooks on individual level

We create campaigns in our application and attach customers that we are marketing to. The dealerships may choose snail mail, ringless voice-mail, email, or social media. If the dealership chooses to do a facebook ad campaign, we then create a campaign on business.facebook and upload a list of the customers that we want the add distributed to.
What I am wondering is if there is a way to receive data via the FB webhooks event when the customer views/clicks/likes/etc the ad, that will include the data on the individual level so that we can update the record in our local database that the customer has performed an action, and what that action was?
I have scoured their documentation and cannot seem to find this information.

Cancelling a user's subscription through the backend

I have a game created in Unity wherein we have subscriptions enabled for various prized packs. We are storing the details of this subscription in a DB in the backend. I wanted to check if it's possible to cancel the subscriptions through the backend itself - if a particular API exists for Google and Apple stores to do the same for all users belonging to a particular prized pack. Changing the status in our DB for the subscriptions is straightforward, but how do we stop the Google and Apple stores from charging these players on a monthly basis? Or does there exist some way to mark a particular subscription pack as obsolete?
On Google, you have an API to cancel a subscription
On Apple, such API doesn't exist and the only thing you can do for now, is explaining to your users the different steps to cancel their subscriptions. You can help them with this deeplink: https://apps.apple.com/account/subscriptions
Opening this URL launches iTunes or iTunes Store and displays the Manage Subscriptions page where the user can upgrade, downgrade, or cancel their subscription by disabling auto-renew

Azure DevOps and Teams - one Group group to control membership to both

I have been trawling the internet and clicking myself blue in the face! Hopefully someone has a definitive answer.
I want to have one Group (in either of Azure AD, Microsoft Teams or Azure DevOps). This group must have access to a DevOps project and a Team site. When I change the membership of the group, the membership must change for both the Team and the DevOps project. I want to avoid the overhead of managing the groups for both separately.
Is this at all possible? Thanks.
This is a really good question, and the answer is not obvious at all. Ironically we had the same exact problem in Microsoft Teams - when a user was added or deleted from the underlying Office 365 Group (which is mastered in Azure AD), it would take up to an hour, sometimes more, to be reflected in Teams, which has its own copy of the member list.
There is a way to do it, and it's how Teams does it: it relies on a relatively new feature in Microsoft Graph called subscriptions. You can find the documentation for it here: https://learn.microsoft.com/en-us/graph/api/resources/subscription?view=graph-rest-1.0.
Essentially what you want to do is create a subscription to the group: POST https://graph.microsoft.com/v1.0/subscriptions with the right message body and your endpoint will be called whenever there's a membership change in the group. Your endpoint won't know what changed, just the event and some IDs - you will likely have to make a separate call to retrieve the actual data (unless the IDs alone are sufficient).
There's a sample on GitHub that illustrates how to use Microsoft Graph subscriptions including more details on how to subscribe to group notifications specifically.
One thing to be aware of is that to use these APIs, your application will require fairly elevated permissions: Group.Read.All which means it has the ability to read not only the team/group members, but all of its messages too (among other things), for every group in your Office 365 tenant. We are working with the MS Graph team to support a less-privileged, per-group permission approach, but even after that's released for Teams Graph APIs, support for that will have to be added to the subscriptions APIs I just mentioned and that may not happen for a while.

Microsoft Teams : REST APIs

I'm interested in getting data (metadata and content of files) out of Microsoft Teams into my application using REST APIs. I have looked at Office 365 APIs and Graph APIs but, I could not find supporting documentation for Microsoft Teams.
Teams API is now added to beta endpoint in Microsoft Graph. In documentation, you can find it together with Groups. Post, Channel and Chat Thread are available.
For example, documentation for "channel" resource is here:
https://developer.microsoft.com/en-us/graph/docs/api-reference/beta/resources/channel
Microsoft Teams REST API is now included into MS Graph API
https://learn.microsoft.com/en-us/graph/api/resources/team?view=graph-rest-1.0
At the time of writing this answer there are not too many APIs around Teams. However more are being added and they are in Beta (sending messages, adding apps to team, uploading team image, and more).
https://learn.microsoft.com/en-us/graph/api/resources/team?view=graph-rest-beta
It is not recommended to use Beta APIs in production environment as they might change.
It is also worth of mentioning that Teams are actually Office365 Groups.
Please take a look at Graph API
https://learn.microsoft.com/en-us/graph/api/resources/team?view=graph-rest-1.0
https://learn.microsoft.com/en-us/graph/api/resources/team?view=graph-rest-beta
Expand "Teamwork" at left side, you can get all Teams related API
We do not have Teams APIs available at this time. Our extensibility options are limited to experiences within the Teams application.
The Microsoft Graph API is constantly changing and we're currently using the following to monitor/interact with our Microsoft Teams application:
https://learn.microsoft.com/en-us/graph/api/resources/teams-api-overview
It gives access to the following (at the time of writing this):
We also monitor the general usage via the reports section in the Graph API:
This gives access to:
Device Usage:
Get details about Microsoft Teams device usage by user.
Get the number of daily unique users by device type.
Get the number of unique users by device type over the selected time period.
User Usage:
Get details about Microsoft Teams user activity by user.
Get the number of Microsoft Teams activities by activity type. The activities are performed by Microsoft Teams licensed users.
Get the number of users by activity type. The activity types are number of teams chat messages, private chat messages, calls, or meetings.
https://learn.microsoft.com/en-us/graph/api/resources/microsoft-teams-device-usage-reports?view=graph-rest-1.0

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.