Documentation
Apps
Quickstarts
REST API

Quick Start - REST API

This guide introduces building an internal management interface for a company, implementing the following functionalities:

  • Display a list of users in a table.
  • Retrieve and select notification templates from a list.
  • Display the title and content of the selected template in a select.
  • Send the selected template notification to the chosen user.

Data Integration

We will be using [Onboarding RestAPI] which is already connected, so no setup for connection is required.

If you need to connect your own data source, please see here.

Displaying a List of Users in a Table

  1. Drag & drop [Text] from the right [Components] onto the canvas.
  2. Enter User List in [Text] on the right [Inspect].
  3. Drag & drop [Table] from the right [Components] below the [Text] you placed.
  4. Click [Create] in [Dataflows].
  5. Change the dataflow name to listUsers.
  6. Select [Onboarding RestAPI].
  7. Enter /v1/users in [Path].
  8. Click [Run].
  9. Select the [Table] and enter {{ listUsers.data.users }} in [Data] in the [Inspect].

Retrieving and Selecting Notification Templates

  1. Drag & drop [Column] onto the canvas from the right [Components].
  2. Place the already existing [Table] on the left side of the [Column], and place [Select], [Input], [Text Area], and [Button] on the right side.
  3. Enter Select Template, Title, Notification Content, Send in the [Label] of each [Select], [Input], [Text Area], and [Button] respectively in the [Inspect].
  4. Click [Create] in [Dataflows].
  5. Change the dataflow name to listTemplates.
  6. Select [Onboarding RestAPI].
  7. Enter /v1/templates in [Path].
  8. Click [Run].
  9. Open the [Inspect] of [Select] and enter {{ listTemplates.data.templates.map(d => d.id) }} in [Values] and {{ listTemplates.data.templates.map(d => d.name) }} in [Labels].
  10. Enter {{ listTemplates.data.templates[0].id }} in [Default value].

Displaying Selected Template's Title and Notification Content

  1. Click [Create] in [Dataflows].
  2. Change the dataflow name to getTemplate.
  3. Select [Onboarding RestAPI].
  4. Enter /v1/templates/{{ select1.value ? select1.value : 1 }} in [Path].
  5. Click [Run].
  6. Click [input1], and in the [Inspect], enter {{ getTemplate.data.title }} in [Default value].
  7. Click [textarea1], and in the [Inspect], enter {{ getTemplate.data.body }} in [Default value].
  8. Check [Run automatically on inputs change] for [getTemplate].

Sending Selected Template Notification to a Chosen User

  1. Click [Create] in [Dataflows].
  2. Change the dataflow name to sendNotice.
  3. Select [Onboarding RestAPI].
  4. Select POST in [Method] and enter /v1/notices/send in [Path].
  5. Write the following JSON in [Data]:
{
  "title":  {{ input1.value }},
  "body":   {{ textarea1.value }},
  "userId": {{ table1.selectedRow.data.id }}
}
  1. Select [button1], click [Add Event] in the [Inspect].
  2. Select sendNotice in [Dataflow].
  3. Confirm that the notification is sent to the user selected from the table with the content from the selected notification.