The console allows API calls to be made easier than with Postman. To do so, a number of fields are enabled that allow you to customize each call.
The different sections of the call through the console are:
– Service
– Authentication
– Headers
– URI Parameters
– Query Parameters
– Form Parameters
Service
This section shows us the service to be called through the console. As an example of this guide, we call the Auto Loan API, specifically, the Vehicle Details service ( /vehicles/{vehicle-id}).
We must choose the environment in which we want to make the call. As we explained in the “Console” section, we recommend making the call in the Sandbox environment to be able to configure the call with different values to those that come pre-set.
Next, we choose the app we’ll use to make the call. The tool will show us the different applications we have created so you can select one. The one we choose must have the API we want to call, otherwise we will get a 403 error as a result of the call.
In the Quickstart guide, we explain how to make an API available in your application.
Authentication
Here we must choose between 2 or 3-legged authentication. This information is found in the API technical documentation in the “Authentication” section.
By default, if you haven’t logged in, the console always sets the API to require 3-legged authentication. In the case of this example, the Auto Loan API requires 2-legged authentication, so we need to change this value. If you have logged in, the value is automatically set.
Headers
We set the HTTP headers of the API call. The values of these headers, both mandatory and optional, can be found under “Header Parameters”. An outline of the possible values is also given.
By default, the console displays the mandatory headers.
The “+” and “x” buttons can be used to add and remove headers, respectively.
URI Parameters
The URI parameters are parameters that may be necessary or optional depending on the service you want to call. In this example, the guide indicates that there is a mandatory parameter that we must report with which we must report the vehicle-id.
For the case at hand, we’ll use the:
– vehicle-id value: 34608
The “+” and “x” buttons can be used to add and remove parameters, respectively.
Query Parameters
The parameters of the query are responsible for defining the query we are making, in this case, the vehicle model id, the model name, the initial commercial year (optional field) and the final year of marketing. All this information is available in the documentation for each API.
Continuing with the example we are using, we enter the following values:
– endYear: 2020
– initYear: 2018
– model.name: GENERICO1
– model.id: 34
This query will return all the requested vehicle information.
Form Parameters
In this section you enter the data of the action you want to perform. For this example, you do not need to enter a value. We leave this section blank.
Run the console
After we have set up the API call through all the sections above, we click the “Send Action” button to run the call.
The “Clear” button is used to clear all call data. The “Reset” button resets all fields to the default values.