How To: Creating a REST Connector with Simplifier

Connectors are essential for the development of an application with Simplifier. They are used to persist data and can connect to different, external IT landscapes in order to access the required data.

Once a connector is configured, various calls can be added and tested directly. In Simplifier, there are already several preconfigured connector types such as SOAP, REST, SQL or SAP RFC and so on, which can be linked to the APIs with just a few clicks. In this example, we create a REST connector that can access the data of a to-do list API.

STEP 1: General Connectivity

Selecting “Add new connector” in the connector tile will display an input mask with the necessary information.

At this point, the name, the connector type and the service URL is relevant.

Name: REST_ToDo
Connector Type: REST
Service URL: https://simplifier.io/demo/api.php

Create Connector
Create Connector

STEP 2: Create Connector Call

When saved, we go directly to the mask to create connector calls. The marked plus on the right side opens the input mask to create a connector call.

No Connectorcalls
No Connectorcalls

In this example, the next screenshot defines some input parameters that allow us to query data – I will explain these briefly.

In this case, the parameter “pathParams[1]” sets the constant value “todos” after the target URL and can be extended by further parameters, including dynamic parameters, such as “pathParams[2]”.

All parameters specified with pathParams are separated by “/” and added to the target URL. The format for the transmission is specified with “postFormat” and sends the data, in this example in JSON format.

Using “verb” decides whether the call should read (GET), write (POST) or delete (DELETE) data.

Parameters without a constant value should be given an alias, as this could lead to complications.

Create Connectorcall
Create Connectorcall

STEP 3: Test Connector Call

As all relevant parameters are entered, let’s test the call by entering an ID via the button “Save & Test”. In the screenshot, you can see by the green-bordered box with the output values that the call with the ID 252 was successful.

Test Connectorcall
Test Connectorcall

If you enter an ID that does not exist, no values can be returned. The red-bordered box indicates that the call is incorrect in this case.

Test Connectorcall Error
Test Connectorcall Error

Conclusion

With the help of connectors, the access to different APIs is easy to manage and thus the application can be connected to different IT systems. They can also be used multiple times and have reduced maintenance requirements. This saves time and reduces errors when changes are made to the data structure.

By the way, test this example yourself and take a closer look with your own Freemium instance. This connector and a few more, as well as example applications using connectors are already included.

Kindly provided by mindsquare

Leave A Comment