The documentation for Google Documents List API, seems to say that you can create a local document and upload it. Is there no way to actually create and edit a document on Google Docs through an API?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
While the docs call it “uploading”, everything boils down to sending an appropriately formatted
HTTP POSTrequest, so of course it can actually be a new creation rather than an actual “upload” of an otherwise existing file. (Creation throughPOSTrequests is similar to what’s normally described as aREST API, though in realRESTyou’d typically use aPUTrequest instead of course).You just need to create a blob of data representing your document in any of the formats listed here — depending on your programming language, simplest may be
text/csvfor a spreadsheet andapplication/rtffor a text-document — then put in in an appropriately formattedPOSTdata. For example, to make a spreadsheet in the simplest way (no metadata), you couldPOSTsomething like:Each specific programming language for which a dedicated API is supplied may offer help with this not-so-hard task; for example, in Python, per the docs, the API recommends using
ETagsto avoid overwriting changes when multiple clients are simultaneously “uploading” (i.e., creating or updating docs). But preparing the POST directly is always possible, since the almost-REST API is documented as the protocol underlying all language-specific APIs.