Documentation
  • Introduction
  • Installation
    • Docker Container
      • Database
      • Deployment Modes
      • Docker Environment Variables
      • Deploy on AWS
      • Deploy on Digital Ocean
    • First Steps After Installation
      • Add New Application
      • Publish Application
      • Use Application
  • Usage
    • Send Request To Endpoint
    • Request From Web Form
    • Web Form Controls Having Multiple Values
    • Web Form With File Upload
    • HTML Snippet embedded with Java Script
    • Authentication
    • Environments
    • Debug Mode
  • Configuration
    • Application Directory Structure
      • endpoints.xml
      • security.xml
      • email-sending-configuration.xml
      • service-portal-endpoint-menu-items.xml
      • Directory: data-source-post-processing
      • Directory: data-sources
      • Directory: data-source-xslt
      • Directory: fonts
      • Directory: http-xslt
      • Directory: parameter-xslt
      • Directory: static
      • Directory: transformers
      • Directory: xml-from-application
    • Endpoint Parameter
    • Types of Endpoints
      • Endpoint to Return XSLT Transformation
      • Endpoint to Return Content From Url
      • Endpoint to Return Static File
      • Endpoint to Return OOXML
      • Endpoint to Redirect Request
      • Forwarding Between Endpoints
      • Conditional Success Action
      • Error Case
    • Data Source Transformation
      • Load Parameter Values as a Data Source
      • Load Data From a Local XML File
      • Load Data from any REST-API
      • Load Data From Databases
      • List AWS S3 keys
      • Load AWS S3 object
      • Additional Useful Data Source Types
      • Transformation Options
      • Data Source Post-Processing
      • Using Parameter Placeholders in Data Sources
      • On-Demand Incrementing Number
      • Writing Transformation Input/Output to AWS S3
    • Parameter Transformation
      • Parameter Transformation Input
      • Parameter Transformation Output
    • Tasks
      • HttpRequest Task
      • Email Task
      • Create Shortlink Task
      • Request Log Task
      • Conditional Tasks
      • Parallel or Subsequent Execution of Tasks
      • Intermediate Values
    • PDF Created With XSLT
      • Embedding Fonts
      • Embedding Images
    • OpenEndpoints XSLT Specifics
Powered by GitBook
On this page
  • What shall happen after submit?
  • Option 1: Redirect to Success-Page / Error-Page
  • Option 2: Return HTTP-Status
  • Option 3: Return Custom JSON
  • Option 4: Download Document
  • Form Inputs vs Endpoint Parameters
  • Option 1: Endpoint With Parameter Transformation
  • Option 2: Endpoint Without Parameter Transformation
Export as PDF
  1. Usage

Request From Web Form

A simple web form to send data to OpenEndpoints could look like this:

<form method="post" action="[path-to-endpoint]">
  <!-- include the "hash" param as a separate hidden field, or simply as GET parameter in the form-action -->
  <input type="hidden" name="hash" value="the-calculated-sha256-hash-code" />

  <!-- this can be "live" or "preview". If param is missing, default is "live". -->
  <input type="hidden" name="environment" value="preview" />

  <!-- only required to activate debug-mode -->
  <input type="hidden" name="debug" value="true" />

  <!-- name-attributes for web inputs = endpoint parameters -->
  <input type="..." name="firstname" /> <input type="..." name="lastname" />
  <input type="..." name="email" />

  <input type="submit" value="Send Request" />
</form>

What shall happen after submit?

The form calls your endpoint, which might for example

The behaviour of your web form after pressing the submit button depends on both the actions defined in your endpoint (success and error actions), and the html code in your web form.

Option 1: Redirect to Success-Page / Error-Page

<endpoint name="foo">
    <success>
        <redirect-to>https://myserver.com/path-to-success-page.html</redirect-to>
    </success>
    <error>
        <redirect-to>https://myserver.com/path-to-error-page.html</redirect-to>
    </error>
</endpoint>

On success (but not on error) you may use parameter placeholders. For example, you could add tracking information that is executed by your success page.

<success>
  <redirect-to>https://myserver.com/page.php?something=${foo}</redirect-to>
</success>

Option 2: Return HTTP-Status

Omitting a particular action on success or failure will simply return a status code of 200 for success or 400 for any type of failure.

<endpoint name="foo">
    <success/>
    <error/>
</endpoint>

Option 3: Return Custom JSON

{ "status": "ok", "customer-id": "12345" }
<endpoint name="foo">
    <success>
        <response-transformation name="custom-json"/>
    </success>
</endpoint>

To output JSON, the XSLT should use the output method "text":

<xsl:output method="text"/>

The transformer should explicitly define the content type "application/json":

<transformer data-source="[name-of-data-source]">
    <xslt-file name="[path-to-xslt]"/>
    <content-type type="application/json"/>
</transformer>

Option 4: Download Document

<endpoint name="foo">
    <success>
        <response-transformation name="custom-document" download-filename="my-document.doc"/>
    </success>
</endpoint>

Form Inputs vs Endpoint Parameters

Option 1: Endpoint With Parameter Transformation

  • The name attributes in the web form can be completely different from the names of the endpoint parameters.

  • The parameter-transformation-xslt may only output parameter values of parameters that are declared in the endpoints.xml file. There are no restrictions as to how inputs from the web form are mapped with this output.

  • The output generated by your XSLT requires values for any parameter not having a default value. Not doing so will raise an error.

Option 2: Endpoint Without Parameter Transformation

  • Input from the web form is passed to endpoint parameters only if the name attribute in the web form matches the name attribute of the endpoint parameter. Note that names are case sensitive.

  • Parameters without a default value must have an equivalent in the web form. Only parameters for which there is a default value are optional.

  • Inputs from web forms for which there is no corresponding parameter are silently ignored.

Potential Source of Error

OpenEndpoints parameter names are case sensitive. For example, if the name of the parameter is "firstname", then it will not match with "Firstname".

PreviousSend Request To EndpointNextWeb Form Controls Having Multiple Values

Last updated 2 years ago

use an to forward an email to your back office, and also send a custom message to the email-address submitted with the form.

use an to send data to your CRM.

Configure your endpoint to redirect the request to a success or error page - see . Note that the absolute path to your page must be used, not a relative path.

If you want to return a user-defined JSON, then use a data source transformation to create that JSON using XSLT. For example, the JSON could contain some ID returned from your CRM (see: ):

Use an :

In case you use an having a download-filename attribute, the user will stay on the form, while the document is downloaded:

The form entries are passed to the endpoint parameters. Depending on whether these parameters have a default value and whether a is used, different things must be observed:

Email Task
HttpRequest Task
Endpoint to Redirect Request
Intermediate Values
Endpoint to Return XSLT Transformation
Endpoint to Return XSLT Transformation
Parameter Transformation