I have an application that creates Google spreadsheets through Java code. I have looked through the permissions section in Google Drive API and I'm going to give edit access to anyone with the link.
In certain sheets I need to make only one tab 'view only', i.e. protect that tab. Is it possible to do this via Drive API?
Is it possible to give a name to the current version of the file via Drive API?
Related
I want to use the user's google drive as a database to store the app-specific data in his drive. To use it as a backup drive.
Now there is this documentation which is suppose to help how to implement it as the google says we can achieve this using google drive apis.
But there is not a single article that can help me to integrate it completely from a to z.
Some post i found but they are not again specific to the this use case i.e. "Store application-specific data". Also they are outdated
Can someone provide an up-to-date Android guide for Google Drive REST API v3?
Integrate Google Drive REST API on Android App
Im not exactly sure I understand what your issue is, so let me try to explain the documentation page for Store application-specific data that appears to be unclear to you.
Uploading to the app data folder is done exactly the same as uploading to any other folder. With three differences.
First off when you authorize your user you will need to use the scope of DriveScopes.DRIVE_APPDATA, This scope gives you access See, create, and delete its own configuration data in your Google Drive. Which will mean that you can only edit data that your application created.
Second. When you upload the file. The file type must be .json. Configuration files are .json thats it.
Finally when you upload the file you set the parent directory to appDataFolder.
var fileMetadata = new Google.Apis.Drive.v3.Data.File()
{
Name = "config.json",
Parents = new List<string>()
{
"appDataFolder"
}
};
That's it, that is the only difference with google drive api and uploading to appDataFolder. Any google drive api upload example can be used.
I have a file ( lets say text ) on my local computer shared with some other people on network. As it is local I can't access the file from some other place via internet. So I uploaded a copy of text file on Google site. Now what I want is whenever someone edits text file, I want it get uploaded to Google site.
So that latest copy can be accessed from outside. I can't use drive or Drop-box sync. They are blocked.
Any help or alternative solution is appreciated. I am not looking for any paid alternative. I am comfortable with C++, C# or Java for solution.
I found a duplicate question.But it is 4 years old. API must have deprecated by this time.
Upload file to a Google Site from C# Code
Thanks in advance:)
why don't you use google docs/sheets for the document and then link the document or directory in the site.
given the appropriate permissions users can then do what they want
you can then edit the document, and using google drive on your pc, and that will auto-upload and be reflected in the site
I simply want to read a Google drive spreadsheet owned by a account controlled by the developer. So I don't want my users to have to login to anything. I just need to obtain this file from hard coded credentials and read it.
It used to work very easy with drive v1 but since that doesn't seem to work anymore we are forced to go to drive v2. I haven't even found where to start.
The answer to how to use a developer controlled account is documented here:
https://developers.google.com/drive/web/service-accounts
I created a public folder in google drive. Now i want to access it from my android project. To list files of the folder and to download files from it. But i am not getting any way. Search too many blogs and here in stackoverflow ansers. But none of them is working for me.
I don't need to access users google drive. Its my account google drive where i created a public folder and places files into there.
Please help if anybody have straight forward answer for my use case.
Thanks in advance.
It seems you want to access the Google Drive Files of your Account, But to get to that you can either access the files using a Android native Google Drive application or Google Drive Sponsored Api for accessing User's files (The User and the developer being yourself !). Its either of the two options you have to follow for now, as google hasn't looked into the requirement you wanted. you might leave a comment for your requirement at google discussions.
We want to develop a restlet based java web app that stores and retrieves files from Google Drive. Right now, the data files are stored on the local disk and when the user clicks on a link, the file is rendered from the local disk on the server. We want to move the files to the google drive that will automatically take care of cloud storage and disk size restrictions. What we want is that when the end user clicks on a link, the file is downloaded and / or opened directly in it's browser transparently i.e. w/o any additional authentication step or input from user. Our app should take care of authentication in the background. Does Google Drive API support that as of today ? Any relevant documentation / article / sample app ?
Thanks,
Deep
You can achieve this if the user is logged into their Google account using the webContentLink of a file resource.
There is an example on the Google Drive SDK website.