I have a problem uploading information using the Google Document API. The task is to upload a document, then publish it right after the upload. The first part I have solved, get a DocsService
client, authenticate myself with client.setUserCredentials(userName, password)
method, and then upload the content with client.insert(URL, newDocument)
.
At this point the document appears in my Google folder. My problem is I can't figure out how too publish it. I tried to emulate the POST method (what Google creates when I click publish), but it didn't work. I also tried to use this methodology, but I could not figure out how should I authenticate myself (using client.setUserCredentials
).
Is there any simple way, or best practice for publishing via the API?
Sharing is done by modifying the document's ACL, more information can be found in the developer's guide.
Using the Java client library, to make a document read-only for everybody, you can do: