Sharing a calendar with a service account - google-calendar-api

Subject:
Description:
We are trying to share a calendar with a service account.
We created a project and a Service Account (for said project) on the Google Developers Console. Then we tried sharing a calendar with this Service Account ID email
I noticed google service accounts have a domain of the form iam.gserviceaccount.com so we can't share a calendar from one of our company's account
Our company's policy dictates we shouldn't set the 'external sharing options' to other than 'sharing busy/free' but we need more data. As stated in the previous paragraph, we can't share the calendar with our internal service account because of the domain mismatch
Is there a way to accomplish this?

I found a workaround:
First create a calendar in the service account (with the API)
Then share the calendar with the organization (with the API)
Export/Import the events of the existing calendar (remove old)
Now you can access the calendar through the API, and edit it in the organization's accounts

Related

Calendar App is blocked when users try to sync their calendar

Thank you in advance for your help!
We have a CRM system that allows users to sync their Calendars using the Calendar API. The application ID of the Calendar project is not associated with our GSuite organization and we have not been able to troubleshoot the account. The calendar application was created using a non-company email address through GSuite and we no longer have access to the application. Our company is approved by Google for the Restricted Scope after an audit by Leviathan.
We are trying to receive help from Google Support and submitted a ticket through https://support.google.com/googleone/contact/googleone_chat but are not getting anywhere and were told to come to Stackoverflow.
This is an access issue with the project being assigned to a non-organization user and we need to have the Calendar project moved to our existing GSuite organization with the help of the proper department.
There's a 2-step solution that we need assistance with. The first step is to ask for Google's help to identify which email the Calendar API project is part of. The second step is for Google to move the project to our GSuite Organization.
Our users are seeing this message when syncing their CRM Calendar
Our users are currently unable to sync their calendars. This is very important that our clients are able to sync their calendar without seeing an error.
Thank you,
Dimitri

How to change owner of site on Google Analytics?

How to change owner of site on Google Analyics?
My site was maintained before by some company (Company A) that created site, targets in Google Analytics. But now my site maintain another company (Company B) that havent access to Google Analytics.
Can I transfer site, data, targets from old account GA to new account (Company B)? I havent access to old account (bcs owner is another company (Company A), I dont collaborate with them).
You will need to gain access to the old account and follow the account transfer process: https://support.google.com/google-ads/answer/44500?hl=en
If you don't have access or can't gain access, the best you can do is create a new account with this property and add the new code to your website, thus losing your past data.
The process to move a Google Analytics property is a bit clunky, but pretty slick once you've had to do it a few times.
A user will need Admin access to the Google Analytics ACCOUNT where the Property is currently, AND Admin access to another Google Analytics Account (create a new one if you need to) where you want to move the Analytics Property to.
Once you have Admin access to both, head in to the Property Settings and click, "move account".
On completion, you can update the access rights to your Google Account, removing access as necessary.
Your Analytics Property will be complete with all of the historic data, configuration and user access rights.
There's a video showing the process here too: https://youtu.be/m_F3qmSTIl0

Can Management API be used to create a Google Analytics Account?

Suppose that a user has a Google account (say a Gmail account), but he does Not have a Google Analytics account.
Can we have a 3rd party application use the Management API (when the user is willing to authenticate it via OAuth2 using his Google account) to reach the stage of creating Tracking Code ?
I am asking this because, in https://developers.google.com/analytics/devguides/config/mgmt/v3/mgmtReference/ , only 'list' is the method that is available for Accounts.
It doesn't appear that you can create a fresh GA account from the Management API. You can, however, list, create, edit, and delete users from an existing GA account:
User Permissions in the Management API allows you to list, create, edit, and delete users from your Google Analytics account. This is useful if you want to automate adding new users to Google Analytics, or removing a set of users.
User Permissions - Developer Guide
Add a Single User

How to write to our own calendar via the Google Calendar API (v3)

I need to write to a Google Calendar from data in our datastore (App Engine app).
I want to access via OAuth 2.
Reading is no problem - the calendar is public and I just use the simple API access method.
Writing is a "problem" - obviously I need to authenticate. However, the calendar is owned by the app administrators, and we want to write to the calendar as a background task - no user interaction is required.
I have gone through all Google's documentation, but I feel none the wiser - how can I do a one -time setup for permanent write access to a Google Calendar, via the V3 API?
To make calls on behalf of your App Engine app without user interaction you should make use of the App Identity module:
https://developers.google.com/appengine/docs/python/appidentity/
If you are using the Google API Client Libraries, using the AppAssertionCredentials object will do this automatically for you:
https://developers.google.com/api-client-library/python/guide/google_app_engine#ServiceAccounts
Note the following:
You will probably still need to supply the simple key in order to attribute quota usage to the right project.
The App Identity module won't work during local App Engine development - you will need to deploy into production in order to obtain valid credentials.
You will need to share the calendar you are writing to with the email address associated with the service account for the App Engine app. To find this email address go to the App Engine Administration Console -> "Application settings" and look for the service account email.
Finally, I'm not 100% sure that the Calendar API allows service accounts direct access, but you should give this a try. If that doesn't work for you an alternative may be to generate a refresh token for a real user that has access to the calendar, and look at embedding that into your application - the service account method is preferable, so I would try that first.

How to retrieve Google Analytics account owner email address using API

I'm accessing the Google Analytics API v3.0 with the .NET client adapter.
This is all working very good, but I'd like to get the account owner e-mail address for a given account that I have access to.
The resource description only has Id, Name, create- and update date.
Is there a way to get more detailed data for this account? Ideally the owner e-mail address or user data would be great. I couldn't find anything in the Analytics API docs, also nothing declaring that this information is NOT possible to get...
Google Analytics account doesn't really have an "owner" per se. Each account can have multiple users with different permissions.
Recently, Google Analytics launched a new permissions model (see this blogpost for more info), and it'll be rolled out to all the users in the coming weeks. Currently, this information is not available though the Analytics API, but feel free to file a feature request here.

Resources