How to download / upload the JSON representation of a Google doc?
<p>Is it possible to download, modify, and upload the JSON representation of a Google doc via an API?</p>

<p>I'm trying to write a server side app to do this. By Google doc, I mean files underlying the rich-text editing features as per <a href="https://docs.google.com" rel="nofollow noreferrer">https://docs.google.com</a>.</p>

<p>As far as I've understood, the RealTime API should allow me to download the json representation of a doc with a GET request, and upload a new JSON file with a PUT request. From the documentation it sounds ideal. However, responses from GET requests contain <code>null</code> in the data field. I understand that this is because my OAuth2.0 <a href="https://stackoverflow.com/questions/19641496/how-to-work-with-realtime-get-and-update-api-requests">app is not the same app that created the document</a>. I'm not sure if/how I could fix this if I want the files to be treated the same as any other Google doc (as defined above).</p>

<p>The Drive API allows me to download a file with a <a href="https://developers.google.com/drive/v2/reference/files/export" rel="nofollow noreferrer">GET request</a>, however, the supported mime-types do not include JSON. I am aware that I could try and convert them (e.g. via a library like the excellent pandoc) but this require lossy and unpredictable processing to try to guess at what Google's document representation might be via e.g. parsing MS Word documents (ew).</p>

<p>Is there a way to directly import &amp; export docs in Google's own JSON representation?</p>