List Google Drive files on website from GSuite users - google-drive-api

I have an organization with GSuite with various users. The organization is connected to a Google app, Google Drive API is enabled, and I have an API Key. I'm trying to list files in a particular folder on various users' Google Drives. For example, I want to list all the pdfs in a folder called "annual reports" under one email, and the Google Docs under another's, with clickable urls to everything. The folders are set to public (anyone on the web can view them), but I cannot figure out how to to do this with php on a public facing website. Basically, I want to be able to go to example.com and see a list of links to each pdf, and a list of links to each Google doc so that the public can view/download things from the organization.

Related

Rename files in Google Drive that have been collected through Google Forms

I am collecting Friends photos through a Google Form. The Form has only two fields Name (text) and Photo (upload).
The uploaded photo is stored in a folder in Google Drive and a hyperlink appears in the Google sheet to the name.
The issue I am facing is that the photo stored in Google Drive usually has a name generated while taking the photo and is not the name of the person whose photo it is. I want the photo file name to be the same as the person's name.
I don't know much of Google Scripts and would like help in using a script to rename the files in the Google Drive with the name of the uploader which is in the Google Sheet.
To rename uploaded files in Google Drive that have been collected through Google Forms you can
create your own apps script that will process all files received via Google Form, as described here or here, or
use my Google Forms add-on Form Uploads Manager that renames the uploaded files, move them to the Google Drive folders you specified and can add a description for each uploaded file, which makes it easy to find files using the built-in Google Drive search. A detailed description of the add-on settings is available on the app home page.
Disclaimer: This is my Google Forms add-on, which I created for my own purposes, and after successful use I posted it on the Google Workspace Marketplace. After a 1 week trial (which might be enough to reach your goals), a paid add-on subscription is required.

I've made a google apps script I want to share within my own domain but not publish to the web?

I've made a Google Apps Script project in one sheet that I want to easily access from multiple other Google Sheets, in Google Drive as well as Team Drive.
It would make no sense to publish this script to the Google Web Store since the functionality is based on our own files.
Can I publish it as an addon that's only accessible for users of my domain?
This should be possible by listing it as 'private' in the Developer Dashboard. In the script editor, go to Publish > Deploy as add-on. You have to follow the steps necessary to access the Developer Dashboard and create your listing.
Fill in all the details of your app (name, description, icon etc.) and set its visibility options at the bottom.

Google Drive API not shows all files from Google Drive

I am creating an application which can insert files into Google Drive and lists it. I am using Google Drive API. But my problem is that for some accounts it is not listing all files in my application. but for many account it shows all files perfectly
so i am no clear that what is the issue is it permission issue or another?
if in google drive folder i have set share setting with public then only it shows all folder
I have used below scope
I have used below scope........ var googlePlusOptions = new GoogleOAuth2AuthenticationOptions
{
ClientId = "",
ClientSecret = ""
};googlePlusOptions.Scope.Add("openid");
googlePlusOptions.Scope.Add("profile");
googlePlusOptions.Scope.Add("email");
googlePlusOptions.Scope.Add(DriveService.Scope.Drive);
googlePlusOptions.Scope.Add(DriveService.Scope.DriveAppdata);
googlePlusOptions.Scope.Add(DriveService.Scope.DriveAppsReadonly);
googlePlusOptions.Scope.Add(DriveService.Scope.DriveFile); googlePlusOptions.Scope.Add(DriveService.Scope.DriveMetadataReadonly);
googlePlusOptions.Scope.Add(DriveService.Scope.DriveReadonly);
googlePlusOptions.Scope.Add(DriveService.Scope.DriveScripts);
googlePlusOptions.Scope.Add(DriveService.Scope.DrivePhotosReadonly);
I searched the other SO ticket that is related to your problem, I found that the issue is in the setting of the scope. Make sure the scope that you use is https://www.googleapis.com/auth/drive.
You can also check this documentation for more information about the SCOPE.
This are the related SO question.
Google Drive SDK API does not lists the file uploaded by Google Drive in java
Access to all files on a user's Google Drive

Sync Google Site with Google Apps Account

I have a Google Site based on this template https://sites.google.com/site/theintranetsitetemplate/. It exists in the company's Google Apps domain account. I would like to know if there is a way to sync the documents page with Google Docs and the directory page with Google Contacts directory. If so, does this require Google Apps Script?
You can insert a Google Drive folder gadget that points to the shared folder.
In editing mode on a page, click Insert > Drive > Folder.
Browse to the folder to share (or paste the folder's URL in the box). Be sure that the folder is shared with the public, or this will not work.
Sharing out a domain's full directory is not easy (even suggesting it would make many IT depts queasy), but defintely can be done with an Apps Script (see the dev page).

Google Drive API and multiple sign in - specify user for export URLs

I'm working on an intranet Google Drive app. Users will authorize it with their corporate Google Apps account.
Everything works well, but, users that are using Google multiple sign in cannot download files using the "export URL" (https://drive.google.com/uc?export=download&id=FILE_ID), because Google Drive assumes they are using their private/default Google account instead of the corporate account. And the private account is not authorized to access the files.
I guess they can still access the files through the Google Drive interface by manually switching to the correct account, but I need to provide direct access.
Is there anything I can do?