Build and publish an API from scratch

Build and publish an API from scratch

Summary

In this article you would find how to use the platform to build, publish and manage your first API.

In order to follow these steps you need a data source. If not, you can use this example.

Example

In this article we will use an example from an Excel file. Remember that you can use different types and formats of data sources.



The aim is to expose an API with a GET method to search for employees according to date of birth, first name, last name, copyright and date of recruitment.



Create an API from scratch

Configure data source

To set the data source you must go to Workspace > data > From file.

Drag or select the file from your computer, and click Continue.



In the second step, you must complete the item and description so that you can then recognize your data source. In addition, you can select a category to organize your data sources.




Create data view

Data views allow you to select, transform your data and configure parameter validations.

Once the data source is created, select Create View > Using a Wizard.



When you create the data view, this screen would be displayed. For Excel files, such as this example, you could select the table or sheet on which the data view would operate.





Select the entire table by clicking on the cell in the upper-left corner.





Select the first row as headers and edit their names. Header selection is important to differentiate it from the rest of the data and to be able to do a different treatment when constructing your API response.




Add data filters over data view columns. For example, select Column B, type of operation and operator Parameter.

It then defines the name of the parameter, which would be the name of the API method. You can add a description and a default value.

In addition, you can add validation rules on values, to indicate whether it should be text, number or date, with different configuration options in each case.


If you want to set up a wildcard as the default value, you must enter an asterisk value in square brackets: [*]


Once you have selected the entire table, the headers and added the data filters would display all the settings on the left.


Now, click Continue and modify metadata: in this case, we modify the metadata of the data source to clearly represent the configuration of the data view.





In this example we will use a single source of data for API environments, but remember that you can configure different data sources for each environment by setting up the data view. Knowset up the multi-environmental.



For more information on data views, access tothis section.


Configure APIs, version and method

Create APIs

To create an API you must go to APIs > New APIs.

Enter a name and description, select an icon and category.


Define SLOs


Defines limits, maximum response time, cache and the maximum number of rows. Then save your API.


Create version

Once you have created the API, create a verse.




Add methods



Now you can add a method to your API version. By adding the method you should select the data view, configure the request type and path, add a description, data dictionaries and others configurations.




You can define multiple output formats for your API method. In addition, you can select the RAW format that would not make changes to the response given by the data source.




You can also define the privacy of your method.



For more information, go to this section.

Publish APIs

Publish the version of your API so that it is available on the developer portal and can start running.



Sharing access to methods

If you defined private methods, you should share them with users who correspond so that they can access the documentation on the portal and can start using them.






Developer portal

Try published API

Once you've published your API version, go to the portal and try the methods to validate that it works as you expect.




For more information you agree tothis section.



Manage APIs

Control of changes

If you make any changes to the resources of the Workspace (data sources, data views or APIs) would be generated draft versions that you should publish so that the changes applied impact on the portal and gateway. For more information, read this article.

Management of environments

If you want to set up different environments for your APIs methods you can do so by setting up the data view. Read set up the multi-environmental article.

Version

You can add new versions to your API as you need it. Also you can unpublish the old versions if you want to deprecate them.

Statistics panel

In Workspace you can access the Statistics section to learn about the APIs statistics by response codes, users and APIs in a period of time. 





Administrative APIs

The Administrative APIs would allow you to know the statistics, documents audit and service levels of your APIs. Learn more about in this section.

Statistics

If you want to integrate statistical data into your systems or visualizations software you can use the Statistics API, available in the Administrative APIs portal.

Audit

You can know the details of the requests received and responses submitted through the Audit API available on the Administrative APIs portal.

Monitoring

If your account has enabled monitoring methods, you can know their availability levels using the monitor API on the Administrative APIs portal.






    • Related Articles

    • Manage your already built APIs

      Summary In this article, you will find how to use the platform to manage your already built REST/JSON APIs and use the security, statistical, audit, monitoring, and other capabilities. To follow these steps, you need: An endpoint of a REST/JSON API ...
    • Create a Vor-Tex account

      Signup in Vor-Tex at https://workspace.vor-tex.io/signup/ You should first enter your email. You would then receive this message and an email at the address entered with a link to continue the registration process. You should complete the form to ...