Answer the question
In order to leave comments, you need to log in
How to get Google Doc text?
The task is to get the text of the document that lies in the Google Document.
I can't figure out the Google API. English needs to be learned, but that's tomorrow. Today we need to solve the problem.
Someone worked with Google API? Tell me an adequate tutorial or throw some experience on this issue.
Answer the question
In order to leave comments, you need to log in
Probably the easiest way to get the text of a Document is to use the Google Drive API.
Method
GET https://www.googleapis.com/drive/v3/files/fileId
returns a list of possible exports{
"exportLinks": {
"application/rtf": "https://docs.google.com/feeds/download/documents/export/Export?id=ABC&exportFormat=rtf",
"application/vnd.oasis.opendocument.text": "https://docs.google.com/feeds/download/documents/export/Export?id=ABC&exportFormat=odt",
"text/html": "https://docs.google.com/feeds/download/documents/export/Export?id=ABC&exportFormat=html",
"application/pdf": "https://docs.google.com/feeds/download/documents/export/Export?id=ABC&exportFormat=pdf",
"application/epub+zip": "https://docs.google.com/feeds/download/documents/export/Export?id=ABC&exportFormat=epub",
"application/zip": "https://docs.google.com/feeds/download/documents/export/Export?id=ABC&exportFormat=zip",
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": "https://docs.google.com/feeds/download/documents/export/Export?id=ABC&exportFormat=docx",
"text/plain": "https://docs.google.com/feeds/download/documents/export/Export?id=ABC&exportFormat=txt"
}
}
https://www.googleapis.com/auth/drive.readonly
and callGET https://docs.google.com/feeds/download/documents/export/Export?id=ABC&exportFormat=txt
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question