This guide will walk you through how you can put a custom form on a public or internal website for generating and downloading LiveDocs.
Below are just a few examples of that you can do:
- Put a lead gen form on your website and providing the prospect with instantly personalized content
- Add a watermark to documents requested from an internal or external site
This example, like many examples we provide (or will provide) is hosted on the popular collaboration and hosting platform glitch.com. If you aren't familiar with Glitch, it is a cloud platform co-founded by the people behind Trello and Stack Overflow. Check out some of the links below to learn more.
The example provided is a "stock ticker" LiveDoc that generates 2 slides: A title slide with the "contact" name on it and a slide with a summary of a given stock and its price history. This is just provided as a simple example so you can try it out and has little to no bearing on you using this example, but if you want to try it out, feel free to go to https://seismic-embedded-livedoc.glitch.me/ and enter a stock ticker such as intc, aapl, msft, etc.. and contact in the inputs and click Generate.
After you click Generate, your browser will download a PPTX file with 2 slides that look similar to below:
The code for this example is available on the glitch.com platform. You can get a remix-able copy of the code at https://glitch.com/edit/#!/seismic-embedded-livedoc.
The README.md in the code walks you through all of the steps to update the code and get it working for your LiveDocs, the basic steps are outlined below:
- Update the .env file with your tenant, client_id, client_secret, username, and password. See Authentication Overview for more information on getting set up with a password flow client.
- Update ui.js with the libraryContentId and teamsiteId of the LiveDoc you want to have on the webpage
- Open your glitch to see the form and generate your LiveDoc
AdHoc Inputs Only!
The LiveDoc APIs (and this example) only support LiveDocs that only require adHoc inputs. If your LiveDoc requires more complex section selection, it is not a good candidate and should be re-worked to only require adHoc inputs!
Updated 8 months ago