Is it possible to protect google spreadsheet data using the web api? - google-drive-api

I would like to programmatically create google spreadsheets that have some columns marked as 'read-only'. Using the web browser client this is straight forward, but I have not found any documentation on how to do this via the API. Is it possible?

You won't be able to do this by relying on the Drive API exclusively. The good thing is, there is a Google Sheets API. This will allow you to access your Sheet file and edit its content. More information can be found on this resource: https://developers.google.com/google-apps/spreadsheets/.

Related

Using ApI is it possible to edit or open Google Sheet?

Using API to get access_token and now I need to open Google Sheet.
Step 1.
Authorization: Bearer ya29.a0AV...." together with link: "https://docs.google.com/spreadsheets/u/0/d/[DocumentFileID]/edit"
Step 2.
Now HTML document back (~200kb). I'm using libcurl for that.
The problem is - missing are some css and js files and I see document just partially. Is there any way to open/edit Google Sheet using API?
I know for the option to just open https://docs.google.com/spreadsheets/u/0/d/[DocumentFileID]/edit in the new browser tab, but in that case I need to manually login to Google and that's what I try to avoid, because I want to use API to login and to open/edit a Sheet.
I also know for the option to share a document but I also try to avoid that. I'm writing application to customers who can access they own documents once they confirmed API usage.
I think you may have misunderstood what the google sheets api can do
The Google Sheets API is a RESTful interface that lets you read and modify a spreadsheet's data.
It gives you access to the data, it does not allow you to open the google sheets web application. Your going to have to code your own google sheets type app if you want users to open sheets directly.

Create presentation with entire JSON on Google Slides API

Hello everyone (sorry for my english)
I have a problem with Google Slides API, I need to duplicate a Google Slides Document from an account to an another (so I can't use Google Drive API with the function "copy").
For that, I used Google Slides API to retrieve a JSON Object (Presentation) on client-side and send to my server (nodejs).
In my server-side application, I send the Presentation Object to anyone and the client can store it in Google Drive (always with Google Slides API).
But the problem is when the client send the Presentation Object (with all fields) to Google Slides API (presentations.create method), it just create a naked Google Slides document without properties include in my requests.
I need to store an entire Google Slides document but I can't do that and I don't know why.
I spent all day with this issue, please can you help me :) ?
Thank you !!!
The Slides API only creates empty presentations via presentations.create(), unfortunately. Only the title is taken from that input object.
For a cross-account copy, Drive's copy API is likely your best bet. If you have write access to the source presentation in Drive, one option is to share it with the destination account first using the Drive permissions.update API and then using copy. Another option is to try an export then import.

Search file in other google drives

I have a google drive where am storing few google sheets. My java web application is able to search a file that is present in my own google drive using Javascript API. Is there a way to search for a specific files in other's google drive via code? i will be getting the shareable link to the google drive am supposed to search. can this be done? As far as i checked this is not possible. Also there is no where in google document that says i can search files in other's drive. Kindly someone confirm.
This is an OAuth question, not a GDrive question.
The account that the GDrive API will apply to is determined by the Access Token that it is called with. So, if you can get an Access Token for somebody else's Drive, then you can use that to search their drive. How you would get such a token will depend very much on the details of your use case and the trust relationship.

Chrome app and connecting to google doc

I want to start looking at using chrome apps as a possible IT solution. I used this tutorial to create a quick app:
https://developer.chrome.com/apps/app_codelab_basics
My next step is to connect to an external data source, where multiple users could access (read/write) to the same source. Is it possible to read/write to the following, and if so, are there any tutorials:
Google Sheet, stored on google drive
An access db saved in google drive
An Excel file saved on google drive.
Thanks
Have you, by any chance, tried using Google Apps Script for this.
Here's a simple tutorial:
https://zapier.com/blog/google-apps-script-tutorial/
Here's the complete API documentation (small examples included):
https://developers.google.com/apps-script/reference/spreadsheet/
I have configured fairly complex workflows by just using Google Apps Script with various Google Apps.

Call Google Spreadsheet script function from external app

I have Google spreadsheet with script attached to it (with the Tools->Script Editor tool).
I want to call one of script function from external Android App. Is it possible? Should I use Spreadsheet API?
Unfortunately, you cannot directly call your script from any external application.
However, you can change it to be a web application, then invoke it via an HTTP GET or POST from almost anywhere, including an Android app.
Insert new rows into Google Spreadsheet via cURL/PHP - HOW? provides an example of a web app that you could adapt.
Should I use Spreadsheet API?
Your question doesn't actually say what it is you want to do, so the answer is "it depends". You still won't be able to invoke an embedded script using the Spreadsheet API, but you will be able to read and write spreadsheet content.
Obviously the answer depends on your usecases, but have you checked the Google Appscript API?
As stated it
provides methods to remotely execute Apps Script functions