API Path Parameters

Estimated Reading Time:  2 minutes

Overview

The most common way to display a submission is to navigate to the URL using the following syntax:

https://www.{environment}.unqork.io/#/display/{moduleId}/{submissionId}/{schemaId}

The correct data displays as long as fields exist and match those in the submission for the specified module. But, this method returns all submission details, meaning unnecessary data for large submissions. Additionally, this method does not support sending additional information to the module for deep linking. The solution for these cases is to use path parameters.

Using Path Parameters

Path parameters are data you add to a URL so you can access it in your target module. To use path parameters, start with the typical module path URL: https://www.{environment}.unqork.io/#/display/{moduleId}. Then, add a ? (question mark) to the end to denote a query. After the ? (question mark), add whatever information you want to pass along to your module so it’s accessible in a _query object.

Let’s look at an example. In the introduction, we went over how to link to a submission. If we want to identify the submission using this method, we’ll use the following URL:

https://www.{environment}.unqork.io/#/display/{moduleId}?id={submissionId}

To retrieve a submission with path parameter data, configure a submissionId Hidden component in the target module. Then, use a  Calculator component with an input of _query.id and set it equal to submissionId. Lastly, use a Plug-In component to make a List Submissions for Dashboard API call to return the fields you need.

You can store multiple pieces of data in path parameters. For example, if you want the target module to display a specific tab, the necessary path parameter might be:

https://www.{environment}.unqork.io/#/display/{moduleId}?id={submissionId}&page=2

You now have access to the page with _query.page. It is also possible to use refer strings, but refer strings have an expiration and are less flexible.

One of the most common use cases for path parameters is building a dashboard with a View button to analyze the details of a submission. To configure this dashboard, construct the URL using a  Calculator, Decisions Component icon Decisions, or Data Workflow Icon Data Workflow component to display the needed data.