This document explains how to load a page which renders a FormResponse.
For an un-submitted FormResponse, this page displays UI which prompts the client to answer the questions of the form and then submit.
For a FormResponse that is already submitted, this page displays the same HTML we use in our print-to-PDF process for exporting a FormResponse. No other page elements are loaded, making this useful for automated / custom PDF exports of Tellescope forms, or for embedding within an external application to show endusers their responses.
Steps (New FormResponse)
- Call the prepare-form-response endpoint using your API Key for a particular enduserId and the given formId. This creates a blank placeholder of the FormResponse to capture partial responses and to be completed eventually. The API response will include a link that can be embedded directly in your app, or you can construct a URL using the Existing FormResponse steps below.
If a new FormResponse is abandoned by the patient and needs to be completed later, see the following steps for an existing FormResponse.
Steps (Existing FormResponse)
- Get the submitted FormResponse by id, or filter with accessCode, enduserId, formId, submittedAt, etc.
- Generate an authToken for the enduser, using the enduserId from the FormResponse (GET /generate-enduser-auth-token)
- Format a URL as follows:
{{your_portal_url}}/documents/forms/{{FormResponse.accessCode}}?token={{enduser_auth_token}}&embedded=trueRedirecting Upon Submission
Provide a URL as the "redirectTo" parameter in this URL to have the form automatically redirect to the URL upon submission.
Customizing Background Color
Provide a valid CSS color code as the "bgColor" URL parameter
Comments
0 comments
Please sign in to leave a comment.