Set “publish to web” in Google spreadsheet using Drive python API

前端 未结 1 462
感动是毒
感动是毒 2021-01-12 00:44

I\'m trying to simulate clicking \"publish to web\" -> \"start publishing now\" in Google docs using the Python version of the Google Drive API. Based on my vague understand

相关标签:
1条回答
  • 2021-01-12 01:01

    Turns out the response object that's returned by the code snippet above needs to call execute():

    service.revisions().update(fileId = newfile['id'], revisionId='head',
        body={'published':True, 'publishAuto': True}).execute()
    

    This returns a revision object and sets the publish properties on the document.

    0 讨论(0)
提交回复
热议问题