1
votes

I am creating an webpage that allows my users to select from a list of presentations (.ppt and .pptx) I have stored in a Google Drive folder. I can query the folder and list the files easily enough and using the alternateLink property I can get a link that opens the file for editing in the Google Slides app, like so:

https://docs.google.com/file/d/<ID property of File goes here>/edit?usp=drivesdk

I want to get the link that is created when you view the presentation, like this:

https://docs.google.com/presentation/d/<some ID goes here>/edit#slide=id.p

I can create this link manually by concatenating strings, but I can't figure out where the ID value comes from. Does anyone know?

UPDATE: So, I posted this question and went into the kitchen to eat. While I was eating it occurred to me that the difference isn't in the IDs of the files, it's in the file formats. When you open a PPT file in Google Slides, (I think) Drive converts the file to the Google Slides (.gslides) format before showing it. It uses the ID of the newly created file in the presentation link (second link above). If I put a .ppt file ID in the second link I get a "this file doesn't exist" error from Drive. If I put the ID of a .gslides file in the second link it opens in the Google Slides app as expected.

1

1 Answers

2
votes

On your update, Nailed it. There is not a method to get presentation URL for a ppt or pptx document. If it was already a Google Slides document, then you would have access to the presentation URL via the metadata for that file.