Filter signed in user in Firebase Analytics Dashboard - firebase-analytics

Firebase analytics dashboard offers teh posibility of filter by signed in users. I added the sign_up event to my app and I already have activity for this kind event. Unfortunelly, when I use the filter, there is not information. What do I have to do tell to Firebase that the user is signed id and use the filter.

Related

Programmatically fetch user's last login date to G Suite

On a user's page on the G Suite admin console, an admin can see the last login of a user. For example, one user I can see has a "last login" date of two years ago.
I'm trying to pull this date programatically. However, the Reports API that provides information on login events only goes back 180 days. How is Google getting this login date, and can it be fetched via API?
Google has this information because they are logging the event when it happens and storing that to present in the admin console. If you start to build an application now and start storing those events as time passes you too will have a date that goes back years. G Suite Enterprise customers can seamlessly do this if they Set up BigQuery logs in the Admin console.
You should be able to get this information now though. Look at the following APIs used in GAMADV-XTD you can get this info with this command for example.
gam report users parameters accounts:last_login_time filters "accounts:last_login_time<#filtertime#" filtertime -5y
https://developers.google.com/admin-sdk/reports/v1/reference/activities
https://developers.google.com/admin-sdk/reports/v1/reference/customerUsageReports
https://developers.google.com/admin-sdk/reports/v1/reference/userUsageReport
I somehow missed this before, but you can get the last login date/time with the User Usage Report (rather than the Login Activity report).
API docs are here and the App Script example I'm using is here. I realized that if GAM was pulling the information there had to be an API for it.

Project with Google APi with self user auth

I was able to create a project to connect an app to google data, for a specific account (followed Google People API)
But now I would like that each customer log in hisself to his account and manage his data.
I can' t create project in the Google API Console for each customer, my app needs to read auth from each user who will use my app and "auto" create auth to read google contact data of the logged user.
Is possible?
Could you suggest me articles about how to do?
It sounds like you are trying to do exactly what OAuth 2.0 (see the page you linked to) gives you: authenticating users. This differs from using an API key, which is only authorizing your project and has nothing to do with a user's credentials.
OAuth 2.0 combines a Client ID (associated with your Google Developers Console project) and a user's login (specific to the user who is accessing your app/site) to give you an authorization token. This token will let your app act on behalf of that user when calling that API. Just make sure to request the necessary scopes as part of the OAuth 2.0 authorization prompt given to the user.
How to give this prompt varies by environment, but many common options are listed on that link.
Note that you always use the same Client ID, so you only need one Google Developers Console project, but you are given a unique token specific to that user's login when they authorize your app, so this lets you act as any user which grants your app access to their account.

Can Trello Webhooks be dynamically registered in Google Apps Script

I am constructing a web app in Google Apps Script that updates a card in Trello when a checkbox is checked on a different card. My question is, if along with this functionality, I also wanted to construct a new card with a checkbox that performs the same function, is this possible with Google Apps Script? This would require (I think) registering a new webhook dynamically to the new card.
Currently I am using http://www.littlebluemonkey.com/blog/pimp-your-trello-cards as a tutorial. He states this cannot be done as the web app must be deployed with the settings of:
Execute the app as: User accessing the web app
Who has access to the app: Anyone
to register the webhooks because Trello sends back a HEAD request to complete the handshake. And the app must be updated as:
Execute the app as: Me
Who has access to the app: Anyone, even anonymous
to receive POST responses from the webhooks. If this is the case then I don't think I can do what I want as I need to toggle the permissions each time the webhooks are registered. I have attempted using each set of permissions for both registering the webhooks and receiving the POST responses but either the hooks will not register or the responses will not be received.
You can not change the permissions of Google Apps Script programmatically.
[Alternative solutions]
If idModel of webhook is set to idMember instead of card id, all actions can be received comprehensively. You can combine Label and action type to create the function you want.
Use a Google Cloud Functions (GCF) paid plan.
GCF can use res.status (200) so you do not need to change permissions.
GCF Spark Plan (Free Plan)'s outbound networking
is restricted to Google services only. That is, you can receive Webhook from Trello but can not send a request to Trello.
In case of Flame Plan ($ 25 / month), you can receive a webhook and set a webhook on another card with one function.
If you do not use webhook any more with the registered card, there is a way to update idModel with the id of the next card.

What is the intended use case for app auth and app users?

I am trying to understand what is the intended use case for app auth and app users. Im basically thinking about building an app that would use Box to store data of users that would subscribe to our service. Our service would allow each user to access and view their data.
If I have an account that basically owns the data of all the subscribed users, can I use the enterprise access token as a base for authentication while using the user account token to restrict the user to only viewing the data from their specific sub directory. Or do I have to have a unique account with its own api key for every user?
I hope this makes sense. Any assistance would be appreciated.
Thanks.
App Auth and App Users -- which is officially called Box Platform -- is essentially a white-labeled version of Box. I think of it this way: "Box" as we know it is software-as-a-service. It offers a web app, mobile apps, and all the trimmings. Box Platform is the platform layer upon which the SaaS is built, providing API-based management of users/content/comments/collaborations/etc. With Box Platform you have a walled garden in which you can build apps that leverage all the features of the APIs, but are not otherwise "Box apps."
I'm basically thinking about building an app that would use Box to store data of users that would subscribe to our service. Our service would allow each user to access and view their data.
This is an appropriate use case. With Box Platform you will be the owner and administrator of a Box enterprise and all the accounts and data contained within.
If I have an account that basically owns the data of all the subscribed users, can I use the enterprise access token as a base for authentication while using the user account token to restrict the user to only viewing the data from their specific sub directory. Or do I have to have a unique account with its own api key for every user?
I think it's generally cleanest to create unique accounts for each user as opposed to giving users a special subdirectory in the admin account. From there you can use the App Auth workflow to get an access token specific to that user.

Remove Resource (e.g. conference room) from an Event using Google Calendar API

I'm looking to write an app that will use Google Calendar API's to remove a resource (e.g. a conference room) from an event, if it's discovered that the room does not end up being needed. Obviously the call to the API will be with administrative permissions, but we won't have access to individual user accounts to remove the resource from the event / invite.
Does anyone know of any way to use Google Calendar API's to update / alter the resources that are assigned to a meeting?
Thanks!
Rooms are added to events as attendees and a copy is created on their calendar. You will just need to find the right event and delete it from the room's calendar (using Calendar API). Administrative permissions should give you all the access you need.
You can also remove a Room from an event as the Room if you have the Room's authentication credentials. You use the Rooms credentials and the https://www.googleapis.com/calendar/v3/calendars/{calendarId}/events/{eventId} endpoint on the Room's primary calendar. This will not delete the event from the organizer's calendar.
Note: Regardless of the sendNotifications flag, Google will send a notification to the organizer when room delete/removes itself from an event (i.e. each time the endpoint is called). There is no workaround. If the organizer has all notifications turned off then they will not see these emails but it's still sent.
I think removing resources from an event can be done by using Google Apps Calendar Resource API. This API allows admin of the domain to add resources that users in the domain will be able to schedule on their calendars.
To delete a calendar resource, send a DELETE request to a resource ID's feed URL.
DELETE https://apps-apis.google.com/a/feeds/calendar/resource/2.0/{domain name}/{resourceId}