1

I need to publish the Slide file to website and get the published URL, But I am not getting the published URL as a return response.

The Drive service is turned on already.

I tried with

function doGet(e) { var ppt = SlidesApp.openByUrl('https://docs.google.com/presentation/d/1fIQpQJ8QaIqt3fibTGmlAndZuvDG3ry8maAm_0CgSLE/edit#slide=id.p'); var fileId = ppt.getId(); var revisions = Drive.Revisions.list(fileId); var items = revisions.items; var revisionId =items[items.length-1].id; var resource = Drive.Revisions.get(fileId, revisionId); resource.publishAuto = true; resource.publishedOutsideDomain = true; resource.published = true; return ContentService.createTextOutput(JSON.stringify(Drive.Revisions.update(resource, fileId, revisionId).publishedLink)); } 
6
  • Debugging details? Logs? Timestamp correlation? View> executions? Commented Sep 3, 2020 at 6:20
  • Its blank output if I use the above code Commented Sep 3, 2020 at 13:15
  • How do I get publishedLink? Commented Sep 3, 2020 at 13:15
  • Edit to show output of console.log(JSON.stringify(Drive.Revisions.update(resource, fileId, revisionId).publishedLink))) Commented Sep 3, 2020 at 13:24
  • I see that the json doesn't have the property at all. But the documentation says it has. Any hopes you could replicate the issue? Commented Sep 4, 2020 at 3:15

1 Answer 1

1

This might be a bug:

The publishedLink from a published Revision (for Sheets, Docs and Slides, at least) is not populated. This seems to be the case for both V2 and V3.

This behaviour was reported some time ago in Issue Tracker:

I'd suggest you to star the issue in order to give it more visibility.

In this case, I think a workaround could be to work with one of the Revision exportLinks instead.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.