Apps are “encapsulated” REST APIs, databases, Web Services and what else you need to connect use when creating your integrations.
So, how should you create and set a new app on LinkApi?
As a first step, in Catalog view, click on New App, and you’ll see the first fields that should be filled. The internal name’s purpose is to label this application when you use it in your project. As each API has its own particularities, we highly recommend consulting the documentation of the App you’re building for information like the base URL, token/authentication, resources names and others.
App internal name *
How your App will be named inside the Catalog directory. Cannot contain spaces or special characters.
Display name *
The official name of your App.
Paste the URL of an image that represents your App.
Application description *
Describe your App in few worlds. This is how the world will see your App, so make it legible.
Base URL *
Your app's base URL that will be reflected in each Resource. You can explicit the version of your app at the end, for example:
This field also accepts custom authentication params inside the URL using braces, like that:
The second configuration tab is about Authentication types. So, whether it is a querystring, a header, a basic or a custom one, this is where you set them. Again, these are information that are found in the APIs documentation. You can customize or add fields using the buttons on the right upper side, if necessary.
Basic authentication only requires Username and Password fields.
Authentication params that need to be sent via header.
Use it when your App don't need an authentication login.
Authentication params that need to be sent via querystring.
Authentication model that allows the user to give access to their data without exposing their password. For example: Facebook login. More info about OAUTH2 apps.
Create any fields your App requires and customize its code. This authentication type will allow you to access the Auth code tab, where you can customize your authentication even more.
Clicking "Customize" on any Auth type will activate the Custom authentication.
Usually, in REST applications, when a get resource is consumed with no parameters received, a big number of paged data is returned. An example: instead of returning 1000 documents, what happens is that the page 0 will contain 100 documents, the page 1 will contain another 100, and so on.
Because of this, we’ve created the optional “Pagination” tab, available when creating and/or editing REST applications, so you can inform which pagination type the application uses.
The next step is defining which are going to be the default parameters in your application. This step is optional. These are the permanent information within your requests, for instance, some querystring pattern or content type. The API documentation will provide those.
The Dafault Params will be set to every Resource you build, so you don't need to register it in every Resource. Just set a default parameter and it will be replicated. You can choose between Querystring or Headers params.
By default, the results are returned in JSON format, however, if you need to receive them in XML, you can set this by adding a header type, choose Accept as the name and application/xml as a value, as shown below:
The final step is when you will define which Resources you are going to use. The LinkApi platform gives you the possible methods for each one of them (get, patch, delete, etc.) to reduce complexities. In order to execute the request, you have to set the credentials (in some cases, the API Key and the App Key), and you can do this by clicking in the message displayed in the upper left part (You can add auth params for test). This message will not show if you set the No Auth option.
Give the Resource a name, select its types and click Add Resource. The entity created will be display below, where you can open and set additional configuration, in the ⚙ Cog button.
The request tab’s purpose is to define which information the consumers of the API have to put in order to execute the request.
Response tab shows you how your app will return the requested information to the user. In this, you can convert the received data to a table and define which ones are Unique Keys.
Code tab allows you to handle any exceptions you need to make within the default information coming from the API.