The Ultimate Guide to Building a Low-code REST API (How to Guide)
Tags: devtools, restapis, softwaredevelopment, api
Published: 2021-02-04 11:36:28

---
title: The Ultimate Guide to Building a Low-code REST API (How to Guide)
published: TRUE
date: 2021-01-27 07:21:17 UTC
tags: DevTools,RESTAPIs,SoftwareDevelopment,API
canonical_url: https://linx.software/the-ultimate-guide-to-building-a-low-code-rest-api-how-to-guide/
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/816jc3yae69f8mwrd5e9.png
---

### _Build a REST API with Linx in under 15 minutes_

Twitter, YouTube, Facebook identification systems… hundreds of companies generate business thanks to REST APIs. Why? Because REST is the most logical, efficient and widespread standard in the creation of APIs for Internet services.  
  
However, REST API development has many approaches and there are 100’s of different [API development tools](https://dev.to/linxsoftware/28-tools-to-design-build-and-host-your-api-12ce) to choose from, it can be pretty easy to get lost just in the process. 

In this article, we cover how to build and host and API in [Linx,](https://linx.software/) a low-code development platform that gives us a quick and easy way to develop and host APIs.

* * *

## 1. Application Specifications

The Linx application will contain a REST API hosted on a Linx application cloud server. The web service will contain an operation to return a full list of mock ‘products’ from a SQL server cloud database as well as an operation to return a specific ‘product’ based on a parameter. The web service will be secured via the API Key authentication scheme.

### Database specification

The Linx application will connect to a SQL Server cloud database hosted on an Azure instance.

For demonstration sake, the following table exists that holds records related to mock “products”. 

These records have been imported into the database using Linx:

![SQL database](https://lh4.googleusercontent.com/Pg1pteO3MVABo3Rn5vrZBbrSML73xjpGsDjw6n-Lxx2BOyzLj4y74UzA4dp8jmQjgsXjArCPtvgHKH6VaPv46nd9HLuJ-wvQhdcM2S_Lzg6LRAUnf-r29MRI-O-0yql6uSJ0zl4)

These records will be retrieved from the database and returned in a http response by Linx, filtering for a specific ‘product’ will be achieved with SQL.

### API specification

The REST web service will contain the below operations

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/di8vr9e5puwrabt29qbw.png)

* * *

## 2. Building the Application

Building the described application in Linx and hosting it involves the following stages:

1. Create a new application
2. Add the relevant plugin libraries
3. Define the web service operations
4. Add custom processing logic
5. Deploy and activate

### Create a new application

Creating a Linx application is easy – with just a single click, the base skeleton of the application is created for you. You are then able to add services, functions and types to bring your application to life.

### Install the relevant plugin libraries

Linx is based on a [plugin architecture](https://linx.software/developer-plugins/) that can be thought of as common libraries which contain functions and data types related to that area of functionality. For my application, I need to integrate with a database and expose a REST web service:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/w3vrz4jn8vliri92nowd.png)

![Add plugins for pre-coded functionality and services](https://lh5.googleusercontent.com/8AEB1cphrkiBCRwX4BLoIxN1FgdZQ0cnUkxnLEcuoOnNRUaNjt1MFKK5G--kgocps83H6CC1gJxLph1vT50UBdx7kQctB7lvajmAB-12NHbABHHI60-_KV8NVvRhL-yliUhwAyc)

### Creating and defining a REST web service 

To add a REST web service to my Linx application, I can just make use of the SimpleRESTHost service (part of the [REST plugin](https://linx.software/docs/reference/plugins/rest/overview/)). This allows me to quickly create and configure REST operations. The service can be added to my application by dragging the SimpleRESTHost service from the plugins panel into the Solution Explorer. This will create a base skeleton of an API for me to work with.

![REST Host Service](https://lh5.googleusercontent.com/axKrJCzO9ttp72sB-KtolBS-jD2NiEh538Xg94ExfQtsiXpY77DC5zCxLMI6FL6SfunOo1cG6XcVUUBhT8TXHl6wWeinAdqGyvAcD9nZzAAlIB1ldV-RoGoyDQGcr2sv_JKMgFo)

![](https://lh3.googleusercontent.com/AHASt6XleUeMIpMIc0SlTXrImk4rVM3DXF92IwC8Ht4NVMRy3jO8phlnHRSUTZo38NX_Q3r1hbmlyGHGAktQo2ZL-OHlHKoeZavsdV2UCUDieMb5Ja6QYmLpDWQnpMlGZwnfxnc)

Next, I need to define the Base URL on which the API will be hosted on. The specific paths of each operation will be appended to this Base URL. In my case, I’m are going to initially test the web service locally by hosting it in the actual Linx Designer, this can be done by setting the Base URL to the below:

http://localhost:8080/myapi

![Properties for REST host service](https://lh3.googleusercontent.com/pMjiUzf0B-r1eT9wAcAg6VgWvBtkP7cmxq0GQhcZlKAbkWmtkj5QI7qnLVqtkabOY8VJlsZ0-gnenBHgd2y2JqdyPDsMmc-RbtNOcKEuJHfnVU0TxAIp9BFshsAHzdc2ijCfIhU)

### Defining the operations

Now that the base configuration is set up, I can now begin to add my operations to the web service. First I’m going to create the ‘GetProduct’ operation and configure it with the below properties:

![REST API wizard](https://lh6.googleusercontent.com/QL0Bg-G55hjK2q-DwogNgpRSjtM23bPK9vxACMM4HvIMLJWxuu--8s7jhWzxgesSQEHs14XRU-FgmyYYjrLZL0mOrIWNktfD5USYjKU-tDGQdW9jO0HQDq5pTYTRaP17ZDxM6nk)

For now, I’m just going to leave the ‘response body’ type as a ‘String’ to make a “Hello World” request.

The ‘GetProduct’ operation will then be created and visible in the Linx Designer. 

### Adding logic to the operation

I can now begin to add logic to return our response. To start, I am just going to return a simple message “Hello World!” to ensure I’ve set up everything correctly so far.

To do this, I can just add a SetValue function from the plugins panel onto the ‘GetProduct’ operation canvas. This function allows you to alter the value of a data reference, in my case I am going to alter the response body property of the ‘GetProduct’ operation and return a simple text message “Hello World!”.

![Build a REST API process](https://lh5.googleusercontent.com/s9epxTK8K2PF-3WZE6ugOMmySkNKhjO1FlqRnOnIIjiyodxFJEfVME7Q_P2n4gp9jDiM39SckZBC570w7f3S1X3OmnMtXhEeEtRpAJ-IyuVPfB_SRGf0gfLA90tJ_Idj5psD1k8)

![Set Value Properties](https://lh6.googleusercontent.com/Ni4tooZMe2FxYdwi8NBGJvQDJl_CLnRx1540c1MGbN8jflIUa0ruch7LUzT7sOwMGzxSHQRZ6tIr1PVscMQFUBtTTNIrVaJOGg20gT10k6ocFKZpzsxcBKCXT0Dt7vo_Wv5NfDk)

### Testing the service

I can now test out my Linx web service by [debugging](https://linx.software/docs/reference/designer/debugtool/) the service in the Linx Designer. This will spin up a locally accessible web service that I can test out and make requests against as well as seeing the process flow.

Once the service debugging has started, I can make a request to the below endpoint in my browser:

http://localhost:8080/myapi/products/this-is-my-testid

![](https://lh6.googleusercontent.com/9aGYhHS6wYX3v1-s4t6AWaMnWVDBr4WDcNwGPxgaqBljXEZRR3D0sb43aU2VVbKaDfTzFuqMJp2Gi7ztZpW54vnCSxo7k-Quxc97-MpaFECUQapXJbuRbRwiDbtByo_pcva6eQk)

If successful, a string response containing the text “Hello World!” will be returned.

Now that I’ve confirmed the web service is functioning correctly, lets add some real-world functionality.

### Define a ‘product’ object 

First, I’m going to configure the operation to return a ‘product’ object. To do this, I need to define a custom type in Linx which will contain the relevant fields:

{  
“id”: “0bdec814-6f7f-4730-b95a-b1518fbfd6fb”,  
“name”: “Clothing Jeans”,  
“code”: “#693”,  
“price”: 516.43,  
“vendor”: “Mayert and Sons”,  
“last\_updated”: “2020-05-30T22:00:00.0000000Z”  
}

To define such an object to work with in Linx, you are able to either import the above JSON string into Linx and a custom type mapping to those fields will be created. Or you have the option of manually creating the relevant fields using the type editor.

![Custom type mapping](https://lh3.googleusercontent.com/otyQxrkC0g9AUKNI_STUX_ug5HqniY8TUxB-paGbNhbbuCP7o4jh6EePxzgQRkL4T7SpqwcC-lbnu-grxo20tw3l8uZ5DwFGIvaXBf8hWKgV5vf4TduGxrDt6s97-V2uBvvx3Iw)

### Update response type of operation

Once I’ve defined the ‘product’ type, I am able to reference this structure throughout the application. In my case, I am going to be returning this ‘product’ type as the response of our ‘GetProduct’ operation. To do this, I can just open up the operations editor of the SimpleRESTHost and alter the response body type to be of the custom type ‘product’ that I just created.

![REST Wizard](https://lh6.googleusercontent.com/ldpfiXZDm8ciaGz2w7CQDAqmMOmpwJguBvVSm0joAQWYU15qS4S7EfA5F4LjUPFUhM5_-V4BklfL9oTNr6ROIV4iA7A9PWO8negL3cnfS-icStKUDJt3HC_SQF1lSUs9LZRsZnQ)

### Set response fields 

Now if I go back to the SetValue function in the ‘GetProduct’ operation, Linx has picked up the operation changes and now I am able to set the individual fields of the response body using the field editor.

![Setting response fields](https://lh4.googleusercontent.com/q77i0pvQo19I2CgKaamIMLCslP9sd6zlnBDNMqAHscIQFPS6wEZeKnFA2Bdc_zPOoqtYyz5VOd3oMo9KNcUSre-WYaINgClM2JwBjGaKu-tNtf4IBRE1aJORZtqmBBQzRQGiE2g)

To test it out, I’m going to hard code some values for a mock ‘product’ in the SetValue. 

![Value Editor](https://lh3.googleusercontent.com/sPOIORRWsL1DX09uBTDaJ-cezrgTB02bl1SQJi2VKKjFCEoVFzrO_ZqeCgMqXtEcLtvQ0xY4D54bx3pQ8xwmk__yvzCHspobaRf04UZ7cE_inJl5Cea7rl2QqBnj2Rxm71lvD7o)

### Debug service with changes

When I debug my web service again and make a request using a browser or tool such as [Postman](http://www.postman.com). The response data will contain a JSON object containing the fields of my ‘product’.

![Debug REST Service](https://lh5.googleusercontent.com/noP1asKXp5JN8nfbTGdj8cTuCnsXQPQL25nsW7_x9OSO36RYWHpxwZxGf5f8b8iypsTFRSlo0JKZ31RrnXQIY1r6qfFZz5sdkHXVXPKPlo8_Ws23ZXWLEMY1Suncod3h1D4Ahu4)

Now that I’ve confirmed the web service is functioning correctly and the response object has been configured, lets add the final piece to this operation, namely retrieving a particular record from the database.

### Adding an ExecuteSQL function

To execute such a query against our database, I can just use the ExecuteSQL function which is part of the database plugin. I can just add this function to our ‘GetProduct’ operation above the SetValue. 

### Creating a connection to the database 

Next, I first need to create a connection to the database, this can be done with the connection editor. This will build up a connection string which will be used by the ExecuteSQL function when connecting to the cloud database.

![Low-code Execute SQL](https://lh6.googleusercontent.com/e_3pbUmf8zQB9wTisBBXlA-dYuo9JebUtQm1p2u8WRPnlo4Xlc42nVcGkiRa0dQNFE0-oVWdIVrPimO3OlI1sghcYYXhSdUjkzT1gjV9kH3W5Hl-AgBA1iXTRcQA3cCgrOJu4Js)

![Database connector](https://lh3.googleusercontent.com/wDWic8WHNReJNbLNREbY0u7XwfdEpTM9EMYiYvTp9oZWMqw4ZUpfCRqwyMg46I6JxHT5iYDrrK6LkRLuKem-_lA-I2CGcgNzRywUvTbLuRZw83HKI6ruqlSh0iyPAYJQLRd9G4Y)

### Creating a SQL query 

Now that I’ve established a successful connection to the database, lets add a query to filter the ‘products’ for a record matching the {id} parameter passed in with the request URL. With Linx, you are able to auto generate query statements, in my case, I am going to generate a ‘SELECT’ from the ‘products’ table. This will create a basic ‘SELECT \* FROM’ statement. For my particular use case, I am going to add a query condition to the SQL statement which will filter for records with the id field matching the ‘id’ parameter passed in with the request. The id parameter is available as a variable which can then just be dragged into my query. The names of the output fields will be auto-populated by Linx.

![SQL expression editor](https://lh3.googleusercontent.com/DMiQcWIEg9nvPMcCAvZk5j6se9rlVFIvOWmK6NM7JrFT-6FjYh0WNAU4SpB97_uwVmpgiDPUL32PNjnqDDPfLYYASbmoZ1oXs3RHTFyQtjEYPKVa8cuV8d9IbDIdDxxrFFLNFYg)

### Setting the database return type 

Next, I am going to configure the output type of the ExecuteSQL to only return a single row (as product ids are unique), and if none are found then the default value types will be returned. This can be done by setting the output type to ‘first row, else empty’. 

![Database process](https://lh3.googleusercontent.com/YPayz5JS1WYVOjC4jMgqf3-eR3JFaQ-RazrzcxmW73k9Wa8ydEBcETLCgYMC95OEtC1D4IrDrmU_E9ikoysFYtoeBmbgcXXiRmdKSQdAyqZc7GvdbY_MoL9wxYtrq_2eIVMZo6Y)

### Setting the response of the operation 

Now that I’ve setup our database connection and query, I can now return the results of my database query as the response body by referencing the fields returned from the database. To do this, I just need to modify the SetValue and instead of hardcoding values as the response, for each field, I can just reference the appropriate field returned from the database.

![Database response](https://lh5.googleusercontent.com/Lx-rMX28YhHIIV33F7CatWfGa0yE3FVWLYwxvk3OddUzZwpFXDUsosLz9aBvUWj3Vzb_Kua9H3ufu7wIKbqsy-t_Kuttgm6a6rUWgZimmq7yYL26YqeLAoKnP8POpRO9ZC5EZjs)

* * *

## 3. Debug the Service

Now I have a Linx application that contains a web service operation which takes in an {id} of a ‘product’, queries the database for a matching record and returns the result. Let’s take it for a spin!

Using Postman, I can make a request to the endpoint:

http://localhost:8080/myapi/products/{id}

Where {id} is GUID that matches a record in the database.

![Debug and test](https://lh4.googleusercontent.com/I_FK6wOH7Z6UupRE-7veLX-TSXqA1bqe_GQpFtRLwTD56AuKhagGm0KofvYGof_AmAxPGTGJDCSzUOEuMrbCK_ZQsGB8ESEdZkHVXPx8_Gfq2fzefUCujeLJVoFKkzl1KNPheWA)

A ‘product’ is returned containing the details of a matching ‘product’ record from the database.

* * *

## 4. Returning All Products  

Now that I’ve created my ‘GetProduct’ operation and confirmed it is working as expected. Lets follow the same steps but create an operation that returns all of the products from our database.

In this operation, a request will be made to the ‘/products’ path. The database will be queried for all product records, these records will then be returned in the response as a collections of ‘product’ details.

Much like before I can just simply add an additional ‘GetProducts’ operation with the path ‘/products’. In this case, the operation will return a list of ‘product’ in the response body. To configure the operation to do this, set the response body type as ‘List<String>’ and then using the list type editor, set it as ‘List<product>’.

!['Get Products' operation](https://lh3.googleusercontent.com/aUMr4dxkaWMRQTfxUt_t2Uzp_adeXsMj0qOlv1GatpKfYEJewM8c9BXiuXDnvzMDLVvA6pLgDY28D2DNynbhVIZFA3zZ6AnfiT82UgJsYvQlkXr7PRKitA0xGRMschkxI9Z-DDA)

![REST service wizard](https://lh6.googleusercontent.com/7RVj1dqrcAeyTogsR-FLKRU1YA7ZXZYOvk6PspvVk3jCjWrAxf0v4ANAmp9J_WPChbx9KaGKonIBMSncz-VvlMX4XF6N5reDwTw6rUVLMkaDW9hNRS7wuc-22XEVIc93KnF3JnI)

### Retrieving all products from the database 

As I did before, we can add an ExecuteSQL function to the operation and use the autogenerated statement to return all the records from the database, row by row.  You can also copy the ExecuteSQL function from the ‘GetProduct’ operation and alter the query statement and return options properties.

![SQL expression editor](https://lh3.googleusercontent.com/adlUkr3Wq621bC66jAwtTDcrCzpvicbYEBoqDLfl-2tQLh6EMf3udrFHx2eXGAXRdZmMhHwgwRLqSBqphWoM-9Dsr-mZLjX2d0xsHoaYYylGVm16fKl2Gs7aiRm2PWN-7pPnBz4)

### Adding to the products list response 

Since the response body type is a list of ‘product’,  I need to build up the list of products row by row. This is achieved by using an AddToList function instead of a SetValue. For each row returned by the query, the particular ‘product’ details are then added to the response body list.

![Product response list](https://lh5.googleusercontent.com/bG82etcO202p5zcbagNbCF33uexUaAHLx0tzzCfnnhhE1DTmuYJnEHLX2pWK-WHUGvV_5mkGTnyoxTDQyBWaHJASEQTeMH5ZMX6DxWurXh5z0nY7McNcVcAJVINJ-l24GhBig4M)

![Set Value for products list](https://lh3.googleusercontent.com/5Oimb7iT_Jhag63I6EaK90NvYk1_OodUVWMyWsXn5KyiI0IvdJiA2r0isFaeXJbyGBE_ef5BpDII_csOhEtmWOYyJi1XT8zlwRimIrcJo4-yZwYRX3Zu66wbTFKil6MPv8LvqBI)

### Debugging the service 

When a call is made to the ‘/products’ operation, a JSON structured List containing all ‘products’ will be returned.

![Debug the process](https://lh6.googleusercontent.com/-vTh2pR9toIE1THZ2C91rW7HQzpJd9MlkezKkdNRLdQsjdF8c1GIXChpmpy5D_UOtsk_HaFv8TT7YQhPZS3el6Qn5LqIkeZF6PlMOScqNVULnHPtcdaLDh7VDdthLbrVh6rEKB8)

## 5. Adding Authentication 

Now that I’ve got a public and open API, lets add some security to limit who can access the data. In this case I’ll add some basic API Key authentication to the operations. When a request is made, Linx will extract the ‘Authorization’ header from the request, this will then be available to use in my authentication event to validate the API Key against a value stored as a constant (this could also be things such a database record, file record etc.).

To add API Key authentication to an operation, I can just select the ‘API Key’ option in the SimpleRESTHost properties:

![REST authentication](https://lh4.googleusercontent.com/YGMyZLT1kN8cwG6b-6y6Gga5ohxI3EK5BaCn1R_6tgph3nnVqw9s4-obFyQUCkdRdrbHJFu-13Fq_gjW5s9i1tAV7caUYUuOS35Y9lR_FPktKmdvxXBmYzzd0LvssALPrs9KRy4)

This will create an “Authenticate” event which will be visible in the Solution Explorer’. Authentication logic can be added to this event to validate incoming requests before any operation is executed.

### Adding authentication logic 

In my case, I am just going to compare the API Key submitted with the request against a value stored as a Linx application’s $.Settings (or constant). If the value matches, the result of the authentication event is set, if it does not match, then by default the operation will return a (401) – Unauthorized response. 

I first need to create a constant to store our API Key in, this is done by adding a ‘$.Setting’ to the Linx application which will be available to reference across my Linx application. 

![Authentication logic](https://lh3.googleusercontent.com/WZrS_RNz2flY8lmQ9wr9RvMq5nQG3vJuEg5-wTZsh7w8UGZCCuPS2yiRQlacIKgnlKJtVyKQaG5eLELXtQ1jy53GkQgDwR2JDBmwGegfdNIKYe3JMqJ_VRgMM9BGdRc1fhL_WXY)

Then I need to add some decision-making logic to validate the API Key by using an IfElse decision making function.

![Add an API key](https://lh4.googleusercontent.com/bbXfO2qWDUczHwNv3hq6Idyv1C1lD_fqt4lqdNF_3KKgePDWdNDRQr7hMySkhuxoOK7iIoY1MqTVwMoWWwudO4EHSL9jwbH5vvI-H3onpyr4dnlF1TXg7epqnECvmoQe4qq-9YQ)

![Set value](https://lh5.googleusercontent.com/vgojqJhrsVVQfEtxEy0yFIISRG4jmaajuX7uOSDJv9sXmAqXHdNL5oqwVYUqAnrJ4Kc7RDGtDDZ64xuPtov-BbegOseboZc6_wwMhzdg7Q8Hs_uNRGNC9iFqN2fzOlqTSndLo-c)

### Applying the authentication to an operation 

Next, I can attach the security scheme to my operations by editing the particular operation and applying the scheme:

![Apply security via the REST wizard](https://lh4.googleusercontent.com/UVrC5GtDnXjy3dQLLZoytwQcgPw-abtIWbN5RUtAeQ2QQg4kz8Z9W-OQxyG_YkadqkkDOgfENcUnob5bnLf43muFWY--9X2RC3fKYBoZIo06LHfldVnp4syLN-TJBMin5t6r0iI)

### Testing the authentication 

I can test out the authentication scheme by debugging and making a request without an API Key header, I will receive a ‘(401) – Unauthorized’ error.

![Test in Postman](https://lh3.googleusercontent.com/GBqc8-J0cQNCd8a2SHJT1DqeTKnuIFSI-EDF-aWxrRKLb2zhUoSuQTvhbMnUFeHqtmkAVqIszJ1v_SRS8V9Ap5tI4zp5i5PoHbilbEWFkBar_Az0Wk72TdI6HeDX4fuBh6fCGuE)

When I make a request, if I include an API Key which matches the constant in the Linx application in the ‘Authorization’ header, I should be successfully authenticated and the list of products returned.

![Postman](https://lh5.googleusercontent.com/ws7GB7W83R2snG7f5hgnKhB1j3fETctaTsofucc744yVKlIGAIy2tqOkotDTZpWgb_7kKMyteizAF5P0_Dy_PWC_Z4AUiEJXhzV5qgSnGTgP53zdEDgbXHO_Arknq1rwZvlqXWo)

* * *

## 6. Deploying to Production 

Now that I have a functional Linx web service with security applied, lets deploy my web service into production so I can expose it to the external world. This is done by deploying the Linx application to my Linx application cloud server where it will be hosted and activated. Once this is done, requests can be made from anywhere against the API.

### Altering base URL 

First I need to alter to Base URL to host it on the cloud server which can be done with the below setting:

https://+:8080/myapi

The ‘+’ character will grab the cloud server instance name once deployed.

### Deploying to the cloud server 

Next, I can simply deploy to my cloud instance of the [Linx application server](https://linx.software/linx-application-server/) by deploying straight from the Linx Designer. Next, I just need to activate the web service. And now I can make request from anywhere against the API.

![](https://lh5.googleusercontent.com/xCK1l-UvfqcWjPYn-ZVcS1-3kL2EPRBv7HW_8ChG5EGRM4unys-epIevyD_DOXoWQAC5MgZKOSbgAPRvI1E1uJG90Q6EFOZAd10PUKK68ym471nqGM3-mG0dXZG9_flB06NAuLc)

![Linx Server](https://lh6.googleusercontent.com/x8u0Q5WcuDCX_oKCAcISJAoeqJAdrEHmfHGnC3W2yLjTrcCP3kqYiRlSL7GWVDAIrLeKQlVyOdd1jn4yymbq2fe7s1T7elgUfiyDj4UK2AQP2ilBXxcLUJedOKSPXycOE1QqtCg)

![Postman](https://lh3.googleusercontent.com/QcxrR3BjLq42Ftcqh16A1SlCF4JNoml8Gd-kMusDeVoi1KfTSsUPR7h9ztrKFFU4mJwrSPlgyo1Y3LpQmVXyjgB-jO5loQxx5Py1bGOg3IxTX1lteh_pLQbKyiSwzDOm5d_Z4n8)

![Linx application server](https://lh5.googleusercontent.com/kk4Yfhi6b6KZO22fDdjdVYdsmNab46lqFuTVAocFfVEVwxA7piS5VMwG2o54K20ekaO9i-gRN6oKRZonLjTlD9tNUDLIVnQnGLU308HfSLZOEG8czneMxf8WNVjq05CpDCacQuM)

## 7. Generating documentation for our API 

Now that I’ve secured and deployed our API, in order for people to use it, they need to understand the rules. To expose these rules, I can automatically generate the documentation for my Linx API by setting the API Documentation property of the SimpleRESTHost. In my case we are going to generate the documentation in Swagger. 

![API documentation](https://lh6.googleusercontent.com/4GJMhX3vGE2pStetXy-cocB9mCs2Gkhf53Aaeur4M9Tm-lqBdBvHkmHbQ705I8L7qD_J-3ZfUViF698Za1Ij7gJO5t9BBFnqu4ERksW_F57NMeyLJfxXkeIspyVxb1XlW8t_18s)

Once I’ve configured the changes, I need to deploy again to activate the changes. Once deployed, users can make a request to the documentation endpoint which is hosted on: {base URL}/swagger

![Swagger](https://lh3.googleusercontent.com/T5GXVT73wMmOi6aR7mtg5nbcbiMPW1dZlw_FojWA9ZDGuBrDLicpQUdd2cF4mDNIWrCBG50KJr_IOcKOS0hjF_TGzBNiXuwVnP7qnMKHDyNluKCYTLmc2JN-tDJsTbAn2x80zv0)

**You’re done!**  
And that’s how simple it is to build an API using Linx.

The post [The Ultimate Guide to Building a Low-code REST API (How to Guide)](https://linx.software/the-ultimate-guide-to-building-a-low-code-rest-api-how-to-guide/) appeared first on [Linx](https://linx.software).