REST API Guide

Last published at: November 30th, 2023

1. Welcome

Welcome to the FlowWright REST API Guide.  This guide describes how to configure and use FlowWright’s REST API. 

What is a REST API?

REST API’s are web APIs hosted on a web server that can be accessed from any platform, the platform could be a tool, different technology, or even a completely different operating system. REST utilizes the HTTP or HTTPS protocol to make requests to the web server or the application server.  REST calls send a request object, the server processes the call and returns a response object.

1.1   Installation

The REST API is installed and configured automatically through the FlowWright installer, it is part of the FlowWright UI.  In previous versions of FlowWright, it used to be separate, but not its all integrated.  You can access the REST API using the following URL:

http://localhost:8080/api

The above URL also shows the Swagger documentation for the REST API.

API Security

The REST API is secured using 3 authentication mechanisms, you can use any of them, and they are:

  • Basic
  • API token
  • oAuth

Basic Authentication

If using FlowWright's authentication, then pass the username and the password.  If using other authentication like Windows, SAML, etc where FlowWright does not store a password for the user, then use the FlowWright license key as the password.  License key can be found in the FlowWright UI under Status → License.

FlowWright licensing information

Token Authentication

Reference the Token authentication document

oAuth Authentication

Reference the oAuth authentication document

REST API

The next couple of sections will show you how to access the REST API using a couple of different methods.  

Accessing using REST API Site

The REST API provides a website with documentation through swagger, here’s how to access this site.  Navigate to the following URL:

http://localhost:8080/api

The site should render as follows:

FlowWright 10 REST API swagger documentation

As you can see from the list, each call is identified with its HTTP method, GET, DELETE or POST, and the description of the call. You can expand any of the calls and test the call using the UI.

 

Calling a REST API call with authentication

Let’s test a REST API call that requires authentication.  Navigate to the class called “User/GetUser”.

Click the button to test the REST API call. The above UI is displayed, enter “admin” for the user name or id field and click the “Execute” button.  Since this call requires authentication, the following authentication dialog will appear.

Enter the following default authentication information:

Username: admin

Password: <USER PASSWORD>

If the authentication is successful, then the following response will be displayed:

If authentication was not successful, then you will see the following response.

More complex REST API calls

Depending on functionality, some REST API calls are simple, and some are more complex.  Complexity is based on input parameters and their data structure.  Here’s the REST API call to create and execute a process instance using a process definition.

Multitenant REST API

FlowWright API is also supported in Multitenant environments.

In order to make a REST API call URL is the same but with the tenant name is in the front of the URL.

http://tenant1.localhost:8080/api