Opening AWS-S3 documents

How to integrate Zoho Office with AWS - S3 to edit S3 Files?

 Preview or Edit AWS S3 file in your Web Application 

Web applications Office files that are hosted in AWS S3 server can use Zoho Office editors to allow view or collaborative edit of those documents from your web application. Otherwise users of your app have to download the documents to local computers.Downloading the file to local machines not only affects user experience, but also mandates installed software to open or edit those files. Integrating a third party solution will provide seamless experience to users.


 Integration With Zoho Office Editors 

Zoho Office Integrator offers an easy and secure way to integrate Office editors into your web applications and allows you to work with Office suite files inside your application. see video

Zoho Office Integrator provides an API to store your document in Zoho servers temporarily and gives you a private link to that document with which one can collaboratively view, edit or review documents. You can also control permission of each document session, like disabling print or download options using parameter configuration.

Steps to Integrate AWS: 

Prerequisites:  

  1. Create APIKey in Zoho Office Integrator dashboard

  2. Generate AWS access key and secret access key for your S3 bucket

  3. Download appropriate AWS SDK for your application.

 

 Note: In this article python language used for demo purpose. You can use language of your choice in your application. 

 Step1: Generate S3 pre-sign url to upload file to Zoho Server   


You need to generate AWS pre-signed url for your file in S3 bucket. Using this url you can upload the document to Zoho server and get a temporary private session URL in response. Use this python script to generate pre-signed get url from S3.


 In-case if you need to edit the document, in addition to above step you need to generate a pre-sign post url, using which edited content will be save back to your S3 server. This script will help you generate the presign-post url and it’s parameters. 

 Step2: Create a document session url using Zoho Office Integrator   

You need to provide the pre-sign get url(generated in step1) in the “url” parameter of the preview/edit api’s.

This API will store the document session temporarily in Zoho server and provide a session URL to edit/preview the document.

You can use the document session url inside your web application in an iframe to preview or edit the file.

 

In-case if you open the document for editing, then you have to pass the presign-post url result value in “callback_settings” parameter of Office Integrator. You need to pass presign-post response parameter values in “save_url_params” 

If you provide callback settings while creating document sessions, users will have save options in Zoho editors. Whenever users hit’s save button in the Zoho editor, the latest document content will be directly saved back to your S3 bucket.