google-docs-api

Insert image into a specified location

谁说胖子不能爱 提交于 2019-11-30 16:12:53
问题 I have a Google Apps script which replaces placeholders in a copy of a template document with some text by calling body.replaceText('TextA', 'TextB');. Now I want to extend it to contain images. Does anybody have idea how to do this? Thank you, Andrey EDIT: Just to make it clear what my script does. I have a Google form created in a spreadsheet. I've created a script which runs upon form submission, traverses a sheet corresponding to the form, find unprocessed rows, takes values from

Google Drive SDK Update (delete/insert) Owner Permission 500 Error in Try It Demo

时光怂恿深爱的人放手 提交于 2019-11-30 15:28:11
I am developing an app that should provide a Google Apps Admin the ability to reassign ownership on files. Currently I am using the Google Drive SDK for .NET with C# code. When I authenticate in the Google Drive SDK test demo at https://developers.google.com/drive/v2/reference/permissions/insert and fill in the FileId of a file belonging to the Admin and try to insert another owner from the same Google Apps domain I get a 500 internal server error. I'm using these values: POST https://www.googleapis.com/drive/v2/files/0B1Y4_hVm0vbESlZuZHhBemtjcXM/permissions?key={YOUR_API_KEY} Content-Type:

Google Drive Links URL format and query parameters

拥有回忆 提交于 2019-11-30 14:04:47
问题 I'm desperately trying to find where the google drive and google docs urls scheme and query parameters are documented. For example what is the usp= parameter which seems to have several possible values ? Also, why a link like this https://drive.google.com/drive/u/2/#folders/ will open a folder in Safari and Chrome without new authentication while a link like https://drive.google.com/drive/#folders/ will only work correctly in chrome. What is the meaning of u/2/ ? etc. Anyone knows how to find

OAuth - Invalid token: Request token used when not allowed

烈酒焚心 提交于 2019-11-30 05:35:53
问题 I'm trying to access Google's Documents List API 3.0 with OAuth 2.0 but I'm having some troubles with a 401 Error. After user have accepted, my code is the following: GoogleOAuthParameters oauthParameters = new GoogleOAuthParameters(); oauthParameters.setOAuthConsumerKey(CLIENT_ID); oauthParameters.setOAuthConsumerSecret(CLIENT_SECRET); oauthParameters.setOAuthToken(token); oauthParameters.setOAuthTokenSecret(tokenSecret); oauthParameters.setScope("https://docs.google.com/feeds/"); service =

How can I add a Google apps script to a spreadsheet created using the API?

别说谁变了你拦得住时间么 提交于 2019-11-30 05:20:11
After reading up a lot on the Google Spreadsheet API I have come to the conclusion that formatting (such as merging cells, changing fonts etc) is only available throught the Apps scripts. Since we need to create and fill the spreadsheets with data programatically using Java on the back-end I guess I need to somehow either; link the new sheet to a Apps script that trigger on-load or create a Apps script that creates the spreadsheet for me. Anyone knows? If you want to just "create" the spreadsheet, you don't need a script to load whenever it spreadsheet is opened. It's probably easier to

How to programmatically create a Google Docs spreadsheet WITH CONTENT?

六月ゝ 毕业季﹏ 提交于 2019-11-30 03:26:14
问题 I have found multiple StackOverflow questions dealing with how to create or edit Google Doc spreadsheets using the Google Spreadsheets API, or older API's. However, this Spreadsheets API seems to be part of the "gdata" library, which to my understanding is deprecated. Newer StackOverflow answers show how to create an empty spreadsheet using the Drive API, which seems more current. However, from looking at the documentation and examples for that API, it seems to only let you create new EMPTY

Google Sheets & Docs Script fails to create add-on menu when add-on is installed from Chrome store

依然范特西╮ 提交于 2019-11-29 17:39:13
Possible cause is the following: Usually this is caused by a problem with the Authorization Lifecycle, specifically the opening stage. The most common culprit is a global variable in the code that tries to access Google services without authorization, like: var doc = DocumentApp.getActiveDocument(); See the documentation: Warning: When your onOpen(e) function runs, the entire script is loaded and any global statements are executed. These statements execute under the same authorization mode as onOpen(e) and will fail if the mode prohibits them. This preventsonOpen(e) from running. If your

Google Drive Api not returning results by descending order of number of occurrences of word

拜拜、爱过 提交于 2019-11-29 17:37:56
I am using Google Documents List API for searching within documents. Searching on the google drive ui returns results with most number of occurences of words first. But with api it returns the results with last uploaded date first. This is the URL which i am using https://docs.google.com/feeds/default/private/full?q=search+term I also tried with https://docs.google.com/feeds/default/private/full?q=search+term&desc=true but this gave the same results that we were getting earlier i.e. by last uploaded date first. Can someone guide me with what additional parameters i should be adding to the url

Getting 401 Unauthorized from Google API Resumable Update

有些话、适合烂在心里 提交于 2019-11-29 16:14:06
I am trying to integrate upload of arbitrary files to Google Docs into an existing application. This used to work before using resumable upload became mandatory. I am using Java client libraries. The application is doing the upload in 2 steps: - get the resourceId of the file - upload the data To get the resourceId I am uploading a 0-size file (i.e. Content-Length=0). I am passing ?convert=false in the resumable URL (i.e. https://docs.google.com/feeds/upload/create-session/default/private/full?convert=false ). I am passing "application/octet-stream" as content-type. This seems to work, though

Download a Google Docs Spreadsheet as HTML

余生长醉 提交于 2019-11-29 15:49:07
Im using the Google Drive api with php to do all sorts of wonderful things but getting stuck with downloading a Spreadsheet in HTML format. I can use the getExportLinks() method to download it in its various formats, but all i want is the text from the sheet and not a formatted file in docx or ods. This was possible with the google docs api by using the /feeds/download/spreadsheets/Export?exportFormat=html&format=html&key=ID url. But currently being redirected when I use it. Is it possible to download a spreadsheet as html using the drive api? @Andre J's answer works, the code: Drive