Postman is a free collaboration platform for API development. Using Postman you can send requests and view responses
According to the RINF Application Guide, the access to the RINF data is controlled, in the sense that an authentication is required before accessing the data through the RINF application and therefore through the RINF API.
If you don't have a RINF account, you should start by requesting your user account.
The API uses authorization to ensure that client requests access data securely.
To implement the authentication between different applications and the RINF API, we use the token-based authentication approach
Bearer tokens allow requests to authenticate using an access key. The token is a text string, included in the request header. In the request Authorization tab, select Bearer Token from the Type dropdown list. In the Token field, enter your API key value—or for added security, store it in a variable and reference the variable by name.
The Token-Based Authentication works as follows:
$.ajax({ url: "https://rinf.era.europa.eu/api/token", type: "POST", data: $.param({ grant_type: 'password', username: 'john.doe@mycompany.com', password: '******************' }), headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, success: function (response) { //keep the username to the session storage sessionStorage.setItem('userName', $("#username").val()); //keep the access token to the session storage sessionStorage.setItem('accessToken', response.access_token); //get the token type and store it to the session storage sessionStorage.setItem('tokenType', response.token_type); // display a message or do something else } });
$.ajax({ url: 'https://rinf.era.europa.eu/api/OperationalPoints', type: 'GET', //make sure you place the authorisation token in the header of the request headers: { Authorization: sessionStorage.getItem('tokenType') + ' ' + sessionStorage.getItem('accessToken') }, success: function (response) { //get the response data and do smething with it }, error: function (response) { //if there is a fail in getting the response, there will be a message } });