How to set up Postman (API Development Environment)?¶
Postman is a popular API development environment, that is, a tool that is used (among other useful features) to ease the interaction with API calls to remote sites. In this tutorial, we show the few steps necessary to set Postman to connect to the Open Data Hub datasets in both the mobility and tourism domains.
In the remainder of this tutorial, we will use as example the E-charging station dataset, located at https://swagger.opendatahub.com/?url=https://mobility.api.opendatahub.com/v2/apispec#/Mobility%20V1%20-%20Emobility/ for the mobility domain and the Accommodations dataset, located at https://tourism.api.opendatahub.bz.it/#Accommodation.
Initial Setup¶
After Postman has been launched, click on the New button, then on Request to start the configuration of the Open Data Hub endpoints, like shown in Figure 41.

Figure 41 Start of a new request creation.¶
In the dialog window that opens, write the URL of the endpoint in the Request name textfield and assign it in the ODH collection, see Figure Figure 42.
Hint
If no collection has already been created, create one by clicking on + Create collection, then write ODH and confirm.
Click on
to start querying the endpoint.Repeat the procedure for the Accommodation dataset and for any other dataset you want to query.

Figure 42 Defining a new endpoint in the mobility domain.¶
It is now possible to start querying the endpoints, by providing next to the GET button the corresponding call, like shown in Figure 43 for the E-charging station dataset and in Figure 43 for the Accommodation dataset. However, while the former images shows a set of results, on the latter appears the message Authorization has been denied for this request. and the status 401 Unauthorized.
![]() Figure 43 Querying the E-charging station endpoint.¶ |
![]() Figure 44 Querying the Accommodation endpoint.¶ |
The reason is that the data contained in that dataset have not (yet) been published as open data, therefore authentication is necessary. This is where Postman proves useful, since it can request authentication tokens (OAuth2 in the case of Open Data Hub), store them, and use them whenever the are needed.
Getting a new Authorisation Token¶
To request a new authorisation token, click on Authorization right below the GET request, then select OAuth 2.0 as the Type.
Now, in the right-hand side of the window, write the URL that manages the tokens (for the tourism domain, this is https://tourism.opendatahub.bz.it/token and click on the button (Figure 45).

Figure 45 Requesting an access token.¶
In the dialog window that opens fill in all the necessary fields, like shown in Figure 46, selecting Password Credentials as the Grant Type, then click on . Make sure you have received the username and password to obtain the token, and give it a name easy to remember.

Figure 46 A filled-in token request.¶
If your credentials are correct and the request is successful, the dialog window will be replaced by another one containing the access token and a few details about it, including its validity and expire date, see Figure 47 and Figure 48.
![]() Figure 47 An access token.¶ |
![]() Figure 48 Information about an access token¶ |
It is now possible to select the token: Select Opendatahub Tourism from the Available Tokens drop-down menu (see Figure 45), click on Body and repeat the GET request. You should be able to see now the data in the dataset, like shown in Figure 49.

Figure 49 Access to data requiring authorisation.¶
Data Exporting¶
By default, queries to the Open Data Hub return data in JSON format and postman does not need any setup for that. It is however possible, for some datasets in the Tourism domain–check Exporting and saving data section for the list, to have postman receive data in CSV. The required set up is shown in Figure 50: in the Header tab under the query, add a key Accept with value text/csv.

Figure 50 Exporting data from the Tourism domain in CSV format.¶