Unqork’s Internal API: Update APIs

Overview

Unqork's Internal Update API call is one of the available create, read, update, and delete (CRUD CRUD refers to the four critical operations for creating and managing data elements in your applications. It stands for create, read, update, and delete.) operations. Update The Update operation modifies existing data in a database. It allows users to change data entries to keep the database accurate and up to date. API operations modify existing data in a database. For example, using an update API call to change an end-user's End-users, also known as Express Users, are the individuals accessing an application through Express View. In most cases, end-users are the customers using the product. existing phone number in a client database.

In this article, you'll explore Unqork's internal Update Module Submission API call.

Update Module Submission API

The Update Module Submission API call functions like the Create Module Submission(s) call. But, instead of a POST The HTTP POST method is used to send data to a server to create or update a resource, typically including the data in the body of the request. call, this API is a PUT The PUT method is an HTTP request method used in REST APIs to update an existing resource or create a new resource if it does not already exist. call. A PUT call updates existing data on the server. This API call supports partial data updates. So, the data object does not have to include all the submission data. That way, you can use the call to update specific fields in a submission data entry.

Review the Update Module Submission API Configuration

To help explain how the Update Module Submission API APIs (application programming interfaces) are a set of protocols and definitions developers use to build and integrate application software. APIs act as the connective tissue between products and services. works, we've configured a module and Plug-In component that uses this API call. The following sections explore the configuration and lets you test the API.

Feel free to use the configuration created here for your own builds. But, please do not reconfigure the modules. If you want to use the configuration, make a copy of the module and paste it in your application.

Review the initNewSubmission Initializer Component

First, let's open the preconfigured module and look at the Initializer component configuration.

1. Open the preconfigured module in the Module Builder by clicking the following link: https://training.unqork.io/#/form/64cbebe31ad85439c6380675/edit.
2. Hover over the initNewSubmission  Initializer component.

A 4-button toolbar displays above the component on hover-over.

3. Using the toolbar, click the (Settings) button.
4. Review the following settings:

You can see the Trigger Type is set to New Submission, firing the Initializer component on page load. In the Outputs table, the component outputs values from a schema module and stores them in the moduleId Hidden component.

A static image displaying the initNewSubmission Intializer component's configuration with the New Submission Trigger Type and outputs to the schema module.

Review the submissionIdUpdate Text Field Component

This Text Field component lets your enter a submission ID in Express View Express View is how your end-user views your application. Express View also lets you preview your applications to test your configuration and view the styling. This is also the view your end-users will see when interacting with your application. After configuring a module, click Preview in the Module Builder to interact with the module in Express View.. After entering the submission ID, you can update the first name, last name, joke question, and joke answer of that submission.

To learn how to retrieve a submission ID to update, view our Unqork's Internal API: Read APIs article.

A static image displaying the SubmissionId to Update Text Field in Express View.

Review the pluginUpdateModuleSubmission Plug-In Component

Let's take a closer look at the necessary Plug-In component configuration and settings to make the API work.

1. Hover over the pluginUpdateModuleSubmission Plug-In component.

A 4-button toolbar displays above the component on hover-over.

2. Using the toolbar, click the (Settings) button.
3. Review the following settings:

Internal Services

From the Internal Services drop-down, you'll see that the Update Module Submission API is selected. Once selected, the Data Source URL auto-populates with /fbu/uapi/modules/{moduleId}/submissions/{submissionId}. As you can see, the {moduleId} placeholder text in the URL was adjusted to {{data.moduleId}}. That way, you can update the specific data fields stored in the moduleId Hidden component. These fields are first name, last name, joke question, and joke answer.

The {submissionId} placeholder text in the URL was adjusted to {{data.submissionIdUpdate}}. This references a specified submission ID entered into the submissionIdUpdate  Text Field component in Express View Express View is how your end-user views your application. Express View also lets you preview your applications to test your configuration and view the styling. This is also the view your end-users will see when interacting with your application. After configuring a module, click Preview in the Module Builder to interact with the module in Express View..

To learn more about the Update Module Submission API, click the Learn More button in the Plug-In component's configuration window.

A static image displaying the Update Module Submisson Internal Service selection in the Plug-In component.

Request Type

The Request Type is also set to PUT. The PUT The PUT method is an HTTP request method used in REST APIs to update an existing resource or create a new resource if it does not already exist. type is used to overwrite data.

Inputs

Lastly, the Inputs table specifies the schema module components that store the data to be updated. The module contains four Text Field components with Property IDs A Property ID is the unique field ID used by Unqork to track and link components in your module. of firstNameUpdate, lastNameUpdate, jokeAnswerUpdate, and jokeQuestionUpdate. To properly map the updated submission, we use the {{data.propertyId}} syntax.

By default, any fields sent with the API APIs (application programming interfaces) are a set of protocols and definitions developers use to build and integrate application software. APIs act as the connective tissue between products and services. call can update that submission even if they are blank. But, if you mark fields as optional, the fields only update submission data if they have values.

A static image displaying the Put Request Type and the data field mapping of the Plug-In component.

After updating a submission, you can confirm the change using the Get Module Submission API. To learn more about the Get Module Submission API, view our Unqork's Internal API: Read APIs article.

Resources