Google drive api Export-complete syntax - google-drive-api

Google drive api provides the following code to export files. GET https://www.googleapis.com/drive/v3/files/fileId/export. However, it doesn't work by itself, it needs the mimeType. Where do I put the MimeType. I need the complete syntax. Thank you.

https://www.googleapis.com/drive/v3/files/$fileId/export?mimeType=application/vnd.openxmlformats-officedocument.wordprocessingml.document

Related

How can I use the Google Docs API to get the HTML from a Google Doc?

I am using the Google Docs API from googleapis#39 and I want to get the HTML. What I currently have is a way to get this object from the API without a problem. I can't find a way to turn that object into HTML. Can someone please assist me? I have already tried a few different approaches to this problem such as trying to get the HTML from the Google API directly and converting the object into HTML.
Thank you!
I could understand that you wanted to convert Google Document to HTML data.
In this case, your goal can be achieved with the method of "Files: export" of Drive API. Ref I think that this is the answer for your question.

What is the back end implementation of Google Drive's OCR?

I'm using Google Drive's API to extract the extract the text from a PDF file. Does anyone know if the tool being used for this is tessaract? I'd like to know what the back end is for this before I start using it more.
The call I'm referring to can be found on their API page under OCR.
Thanks for your help!
If you check the Google Drive documentation and this Google Drive Blog about OCR, the Google did not mention that they use Tesseract for this. But, if you check the Tesseract information, it is stated here that Tesseract development has been sponsored by Google since 2006. Sorry to say, but I think only a Googler that knows this OCR can answer or verify your question. Hope this piece of information can help you.

How to grab files from Google Drive with PHP?

I just need a starting place. How would you grab files from Google Drive with PHP? So, you would result in this:
<audio src='Google Drive File'></audio>
I'm just starting programming. Any help would be appreciated...
Are you manually sharing just a few specific files or do you want to fetch the file's link dynamically/using lookups, etc.?
For the first, you can use the Google Drive Direct Link Generator.
The other option is to modify the URL yourself so that something with a shared link like https://drive.google.com/file/d/FILE_ID/edit?usp=sharing becomes https://drive.google.com/uc?export=download&id=FILE_ID.
If purely non-manual and only in PHP, use the Drive SDK for PHP (beta) or via the REST API, has PHP examples.

Generate a google doc via Java

I've been swimming through searches and tutorials and guides and references for days, and I can't seem to find a good way to generate google docs via Java.
I can generate/import .txt files as regular google doc files successfully with java using the drive api, but that's only text files; I need to at least include unordered lists and links in the doc for it to be useful.
My next attempt would be to generate a .rtf or a .doc and then try to import that into google docs, but before I embark on such a project, I wanted to ask you guys first. I also see the realtime api, but it looks like it doesn't specifically deal with docs, just arbitrary data.
What's the recommended way to upload a new google doc with lists and links and stuff?
Thanks!
Probably the simplest import format would be HTML. Just set convert=true and you should be good to go.
There is no stand-alone API for creating or manipulating the contents of Google Docs files. As you've found, you can create documents in other formats and import them with the Drive API.
If you don't need to work in Java, the other option is to use Google Apps Script, which provides a service for creating and manipulating Google Docs files. More information in this guide.

Generating a PDF using Google Docs API

Is it possible to provide HTML for the Google Docs API and have it output as a PDF? As far as I can tell, it seems like it is possible to submit an HTML document to Google Docs, and then have Google Docs convert it to a PDF.
I'm checking the API documentation and it has a lot of information about dealing with PDFs already created, but I'm not seeing anything about creating them.
Also, does it accept CSS styling as well, or is it pure HTML?
Yes, it is, with two requests. You can import the file as a Google Docs, then export it to PDF. Using the Drive API.
https://developers.google.com/drive/v2/reference/files/insert https://developers.google.com/drive/v2/reference/files/get
this is what your saying right?