1. Home
  2. Knowledge Base
  3. Articles
  4. Using Hubway Connect & Postman to unleash the power of data in your OutSystems ecosystem

Using Hubway Connect & Postman to unleash the power of data in your OutSystems ecosystem

Hubway Connect can allow Business Analysts, Quality Assurance and Support Teams securely access OutSystems data. This opens up a plethora of opportunities to explore and analyse data, which can massively simplify the process of testing and troubleshooting. Hubway Connect also allows you to secure your data for Read and Write based on users’ roles and permissions and their business-need-to-know level.

Let’s see how this works

In this step-by-step guide, we will show you how to use Hubway Connect to read and write data from an OutSystems Database through Postman, in a no-code style, with no need to go through a development lifecycle.

For this demonstration, we will use the Order Management sample app, available in OutSystems Forge. The Order Management application is a mini CRM that can be used to control the process of receiving, tracking and fulfilling customer orders. We are assuming this Forge application has been installed in your OutSystems environment, including all the Entities listed within. By the end of this demonstration, we will have set up a Postman request to read data from the OrderItem table and update the Discount for a specific OrderItem Id.

Setup Hubway Connect project to support Read and Write

To enable a Hubway service to allow writing data into an Entity, go to the security tab of the Project Details page and ensure that the Authorisation type is “Read and Write”.

Using Hubway Connect & Postman to unleash the power of data in your OutSystems ecosystem
security tab of the Project Details page

GET OutSystems Entity data using Hubway Connect within Postman

From Hubway Builder, you can get either the Generic URL or the Version specific URL for the GET requests.

Create a new request in Postman. Select the GET method from the dropdown and paste the service link in. Suffix the URL with the name of the Entity from which you want to fetch data.

Taking Order Management as an example, Let us assume that we want to fetch all the OrderItem.
Example: <Test or Production service link of the service>/OrderItem

https://yourdomain.outsystemsenterprise.com/HW/rest/odata/sales-order/OrderItem

 

Using Hubway Connect & Postman to unleash the power of data in your OutSystems ecosystem
Hubway Builder

 

Go to the Authorisation tab, select Type = Basic Auth and enter your OutSystems credentials. Hit the send button.

Postman will connect to Hubway service, fetch the OrderItem items and display them as a JSON. You could also apply the OData methods like filter, search, expand, etc. to refine the data output further.

Using Hubway Connect & Postman to unleash the power of data in your OutSystems ecosystem
Postman will connect to Hubway service

Insert data into OutSystems Entity using Hubway Connect and Postman

Find the EntityType

First step is to note down the EntityType of the Entity to which you are going to insert data. You can get this by launching the metadata URL in a new Postman request.

Metadata URL: <Test or Production service link>/$metadata

For example: https://yourdomain.outsystemsenterprise.com/HW/rest/odata/sales-order/$metadata

The first section in the response will give the EntityType for each Entity.

Using Hubway Connect & Postman to unleash the power of data in your OutSystems ecosystem
Find the EntityType

 

How to construct the POST request

Next step is to construct your POST request in Postman.

To create a new request in Postman, select the POST method from the dropdown and paste the Hubway service link. Suffix the URL with the name of the Entity into which you want to write data.

Taking Order Management as an example, let us assume that you want to insert a record into the OrderItem Entity. The URL will be for example: <Test or Production service link>/OrderItem

For example: https://yourdomain.outsystemsenterprise.com/HW/rest/odata/sales-order/OrderItem

Go to the Authorisation tab, select Type = Basic Auth and enter your OutSystems credentials.

Using Hubway Connect & Postman to unleash the power of data in your OutSystems ecosystem
Go to the Authorisation tab

 

Go to the Body tab and type the attributes and values in JSON format, to insert a record into the Entity. See the example below:

{
    "@odata.type":"OrderManagement_CS.OrderItem",
    "OrderId": 2,
    "ProductId": 1,
    "Quantity": 10,
    "Discount": 20,
    "Amount": 500.00,
    "CreatedBy": 16,
    "CreatedOn": "2021-11-27T08:21:11+00:00",
    "UpdatedBy": 16,
    "UpdatedOn": "2021-11-27T08:21:11+00:00",
    "IsActive": true
}

Note that in the first line of the JSON statement above, we have prefixed the EntityType “OrderManagement_CS” to OrderItem. Then hit the Send button.

Postman will connect to Hubway service and insert the record into the OrderItem Entity. The response will give you the Id of the newly inserted record.

Using Hubway Connect & Postman to unleash the power of data in your OutSystems ecosystem
Postman will connect to Hubway service

You could verify if your insert went through fine by doing a GET request on the OrderItem Entity.

Update data in an OutSystems Entity using Hubway Connect and Postman

First step is to note down the EntityType of the Entity to which you are going to insert data. Refer Find the EntityType.

Construct the PUT request

Next step is to construct your PUT request in Postman.

Create a new request in Postman. Select the PUT method from the dropdown and paste the Test or Production service link from Hubway. Suffix the URL with the name of the Entity in which you want to update a record along with the Id of that record.

Taking Order Management as an example, let us assume that you want to update a record into the OrderItem Entity.

The URL will be: <Test or Production service link>/OrderItem(<Id of the OrderItem that needs to be updated>)

For example: https://yourdomain.outsystemsenterprise.com/HW/rest/odata/sales-order/OrderItem(1)

Go to the Authorisation tab, select Type = Basic Auth and enter your OutSystems credentials.

Using Hubway Connect & Postman to unleash the power of data in your OutSystems ecosystem
Authorisation tab

 

Go to the Body tab and type the JSON to update record values into the Entity. See example below:

{
    "@odata.type":"OrderManagement_CS.OrderItem",
    "Discount": 20,
    "IsActive": true
}

Note that in the first line of the JSON statement above, we have prefixed the EntityType “OrderManagement_CS” to OrderItem.

Then hit the Send button.

Using Hubway Connect & Postman to unleash the power of data in your OutSystems ecosystem
JSON statement

Postman will connect to Hubway service and update the record in the OrderItem Entity. You could verify if your update went through by doing a GET request on the OrderItem Entity.

Using Hubway Connect & Postman to unleash the power of data in your OutSystems ecosystem
Postman

 

Delete data from an OutSystems Entity using Hubway Connect within Postman

Create a new request in Postman. Select the DELETE method from the dropdown and paste the Test or Production service link from Hubway. Suffix the URL with the name of the Entity from which you want to delete data along with the Id of the record.

Taking Order Management as an example, let us assume that you want to delete a record into the OrderItem Entity.

The URL will be: <Test or Production service link>/OrderItem(<Id of the OrderItem that needs to be deleted>)

For example: https://yourdomain.outsystemsenterprise.com/HW/rest/odata/sales-order/OrderItem(1)

Go to the Authorisation tab, select Type = Basic Auth and enter your OutSystems credentials

Using Hubway Connect & Postman to unleash the power of data in your OutSystems ecosystem
Authorisation tab

 

Then hit the Send button.

Using Hubway Connect & Postman to unleash the power of data in your OutSystems ecosystem
hit the Send button

 

Postman will connect to Hubway service and delete the record from the OrderItem Entity. You could verify if your delete went through fine by doing a GET request on the OrderItem Entity. No record will be returned as the record was deleted from the Entity.

 

Unlimited possibilities

Similar to Postman, we can use several alternative tools that are available to send requests to the Hubway OData service. Hubway Connect enables quick and easy access to data for troubleshooting, testing and quick data correction… all without the need to write one line of code.

Was this article helpful?

Related Articles