Forum Discussion

Adria1435's avatar
Adria1435
Copper Contributor
May 11, 2022

Calling view.officeapps.live.com from an iframe

Hello,

 

We are developing an application where we want to preview documents in an iframe using view.officeapps.live.com.

 

The documents are stored within the app but to make them publically available for view.ooficeapps.live.com we have to retrieve them via a REST API endpoint.

 

In an attempt to make the endpoint more secure we want to pass an authentication token along with the document ID.

 

The iframe SRC looks like:

 

 

Where the $AbsolutePath is:

 

<application_url>/rest/previewservice/v1/preview?PreviewToken=<EncodedRandomString>&DocumentID=<id>

 

e.g:

 

"<application_URL>

%2Frest%2Fpreviewservice%2Fv1%2Fpreview%3FPreviewGUID%3D7036874417767401%26PreviewToken%3DMTIz

 

For some reason, the view.officeapps.live.com call works when we just pass the document ID as a parameter but not when we try to pass the authentication token too.

 

I should also note that when we pass the URL to google docs it seems to work, so I'm wondering if I'm passing the url incorrectly to view.offficeapps.live.com?

 

Does anyone know where we are going wrong?

 

Any help would be very much appreciated.

 

Regards

Adrian

Resources