Can we use "https://apis.google.com/js/api.js" after 31st March 2023 for google drive integration - google-drive-api

For google drive picker, examples in google doc uses this url "https://apis.google.com/js/api.js" . But in migration reference document asks us to replace apis.google.com/js/api.js with accounts.google.com/gsi/client. Can we use apis.google.com/js/api.js after 31st March for google drive integration.
I tried using just accounts.google.com/gsi/client in code and google drive integration does not work.

Related

Google Analytics Admin API in Advanced Google Services

I've seen that Google Analytics Admin API is in an is an early preview version. Is there a timeline when this is going to be avaliable on the Advance Google Services for Google Apps Script?
BR,
In the summary page of the API it says to subscribe to the Google Analytics API Notify Group for announcements. It is likely that Google does not publish dates or timelines for releases.
Google Analytics admin is currently in beta.
The beta version is now also available on Google app script.

Get app_id from google sites

I want to grant access for my sites by the script, for google docs I can get the id from the url: https://docs.google.com/document/d/<doc_id>/edit
and do this: DriveApp.getFileById('<doc_id>').addViewer(emailid);
but for google sites I get this format instead:
https://sites.google.com/d/<id_1>/p/<id_2>/edit
I tried use id_1 and id_2 but both does not work.
Can anyone help me?
Thank you
The correct File Id to be used for Google Sites is the <id_1>.
The reason why you cannot add viewers to the site is because unlike Google Docs, Google Sites doesn't have a viewer sharing option. Instead, it uses a published viewer option.
Sample: 3 Users with different access rights
(I'm using new Google Sites in this example)
Sample Code:
function myFunction() {
Logger.log(DriveApp.getFileById('id_1').getViewers());
Logger.log(DriveApp.getFileById('id_1').getEditors());
}
Logs:
[21-01-07 00:52:50:404 HKT] []
[21-01-07 00:52:50:719 HKT] [DriveUser]
If you want to set viewers for your Google Site, you can use Sites Service in Apps Script. However, you can only use Site.addViewer(emailAddress) for classic sites.
Note:
A rebuilt version of Sites was launched on November 22, 2016. Apps Script cannot currently access or modify Sites made with this version, but script can still access classic Sites.
(Update)
Currently, there is no other option to update Google Sites via Apps Script or API.
Based on this reference: When will available the API Google Site?
The new version of Google Sites does not offer an API at the moment but Google has announced that API capabilities including Google Apps Script integration will be available.
For more detailed information see Deprecation Timeline - classic Google Sites
Google doesn't offer dates for when features will be available so you won't find one.

Do I need to change my Apps Script code because Google+ Sign-in feature is being deprecated?

I got this notification saying that "On March 7, 2019, all Google+ APIs and Google+ Sign-in will be shut down completely. This will be a progressive shutdown, with API calls starting to intermittently fail as early as January 28, 2019, and OAuth requests for Google+ scopes starting to intermittently fail as early as February 15, 2019."
I am asked to "Please update your projects listed below by March 7, 2019 and ensure they are no longer using Google+ APIs, or requesting Google+ OAuth scopes. The data below shows which Google+ API methods your projects have recently called, as well as Google+ OAuth scopes it has requested."
Currently, the authorization is being handled automatically by Google when a user uses a functionality defined by the script that requires access to edit Google Sheets for example.
Here is the doc that shows some migration tips: https://developers.google.com/identity/sign-in/web/quick-migration-guide
My question is do I actually need to do anything to my Apps Script code if I am working only in the Google suite like Google Sheets and Forms to ensure this authorization still works after Google moves from Google+ Sign-In to Google Sign-In. I am not doing API calls from a separate website or anything like that.
Any help would be greatly appreciated!
Do you populate a sign-in button by yourself using Google Apps Script? If so please share some code, there's probably some work to do. I think this should be the case.
When you publish a Google Apps Script you can choose to run it as the owner of the script or the user accessing the the web-app. Depending on the scopes used in Google Apps Script it will require some authorisation, this is fully handled by Google and there's nothing you should do.

what is the SLA for Google App script?

I am new to Google App scripts and I have a few questions (I've done the diligent of going thru the FAQs) that I couldn't find answers yet
I read that Google App scripts are hosted in Google Drive. Where does it actually get executed?
are there any SLA or availability figures for the Google App scripts hosting environment?
can I host the Google App scripts (we will mainly use these as Gadgets for Google Site) on other environment? such as App engine?
many thanks
I've never seen anything official that answer these questions. So the following answers are just from my experience of working with Apps Script and as a Top Contributor.
It gets executed on Google servers, under the "script" subdomain at google.com. There's no info regarding the infrastructure.
There's no SLA. AFAIK it is not even covered in Google support for "Google for Work" (new name of Apps for Business)
No, you cannot host it anywhere else. And also not embed it anywhere expect a Google Site.
Preface
First of all, Google Apps Script seems to be separate from Google Sheets/Docs/Forms/Drive as noted in HIPAA Included Functionality:
As of July 21, 2020, The following functionality is Included Functionality under the applicable HIPAA Business Associate Addendum:
Gmail, Calendar, Drive (including Docs, Sheets, Slides, and Forms), Apps Script, Keep, Sites, Jamboard, Hangouts (chat messaging feature only), Google Chat, Google Meet, Google Voice (managed users only), Google Cloud Search, Cloud Identity Management, Google Groups, Google Tasks and Vault (if applicable).
So, in official docs, Google recognises Apps Script as separate service, as seen in Google Workspace HIPAA Included Functionality terms.
Is there SLA for Apps Script
There is Google Workspace Service Level Agreement (SLA, which is a matter of question), where Apps Script is NOT included in covered services.
From Google Workspace Service Level Agreement
Last modified: July 12, 2021:
"Google Workspace Covered Services" means the Gmail, Currents, Google Calendar, Google Cloud Print, Google Cloud Search, Google Docs, Google Sheets, Google Slides, Google Forms, Google Drive, Google Groups for Business, Google Hangouts messaging and video initiation, Google Chat, Google Meet, Google Keep, Google Sites, Google Jamboard, Google Tasks, Google Vault, and Google Voice components of the Service. This does not include the Gmail Labs functionality, and Google Jamboard Hardware components of the Service.
There is also additional Google Apps Script Additional Terms which have no mention of SLA (as of January 2022).
It's not should be considered any kind of legal advice, but looks like there is no explicit Apps Script SLA.

Change acl of pdf and non-google documents (EDU domain)

I'm receiving this error when trying to change file ownership from Google Apps Script (Google Apps for Education):
GDataServiceExceptionYou can't yet change the owner of this item. (We're working on it.)
The same code works on a Google Apps for Business domain. Is there a limitation for EDU domains?
Ok, found the answer in the Google Drive support pages:
Only Google Apps customers in Premier and Government domains can
transfer ownership of a synced or uploaded file (such as a PDF or
image file). If you're using Google Drive and Google Docs with a
personal account or with a Google Apps for Education account, you
can't transfer ownership of a synced or uploaded file.
http://support.google.com/drive/bin/answer.py?hl=en&answer=2494892
Does anyone know why this limitation exists for Education accounts?
Is Google really working on it (as mentioned in the error message)?