# Postman
source: https://developer.mastercard.com/open-finance-europe/documentation/unlicensed/aiia-data/testing/postman/index.md

Postman is a great tool for exploring and testing RESTful APIs without clients having to communicate with it.

A [Postman collection](https://www.getpostman.com/collection) and an [Environment](https://learning.getpostman.com/docs/postman/environments_and_globals/manage_environments/) is available so you can explore details of our APIs with minimum setup.

#### Running the collection {#running-the-collection}

Follow these steps to set up and run the Postman collection:

1. Start by pressing the "run in Postman". It will guide you to create a postman account and let you use the Postman collection.

Click: [![](https://static.developer.mastercard.com/content/open-finance-europe/uploads/postman-button.svg)](https://god.gw.postman.com/run-collection/26779181-1d6e0d10-6801-491e-a507-eae59c689c81?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D26779181-1d6e0d10-6801-491e-a507-eae59c689c81%26entityType%3Dcollection%26workspaceId%3Ddc9c22f1-d88f-417d-8a88-662dba528689#?env%5BMastercard%20Open%20Banking%20EU%20Environment%20-%20Demo%5D=W3sia2V5IjoiYmFzZV91cmwiLCJ2YWx1ZSI6Imh0dHBzOi8vYXBpLXNhbmRib3guYWlpYS5ldSIsImVuYWJsZWQiOnRydWUsInR5cGUiOiJ0ZXh0Iiwic2Vzc2lvblZhbHVlIjoiaHR0cHM6Ly9hcGktc2FuZGJveC5haWlhLmV1Iiwic2Vzc2lvbkluZGV4IjowfSx7ImtleSI6ImNsaWVudF9pZCIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6InRleHQiLCJzZXNzaW9uVmFsdWUiOiIiLCJzZXNzaW9uSW5kZXgiOjF9LHsia2V5IjoiY2xpZW50X3NlY3JldCIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6InRleHQiLCJzZXNzaW9uVmFsdWUiOiIiLCJzZXNzaW9uSW5kZXgiOjJ9LHsia2V5IjoiY2xpZW50X3JlZGlyZWN0X3VyaSIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6InRleHQiLCJzZXNzaW9uVmFsdWUiOiIiLCJzZXNzaW9uSW5kZXgiOjN9XQ==)

2. The collection should be imported into Postman now. You can verify this by clicking on `Collections` in Postman and checking whether you have a collection named `Mastercard Open Banking EU`. If it is not there, try importing it again while running Postman beforehand. Note that sometimes it might not be imported if Postman was closed before.

3. An environment called `eu Mastercard Open Banking EU - Demo` is also imported. You can switch to it by clicking on the drop-down in the top left of the Postman window and selecting the environment with the aforementioned name.
   ![Environment Drop-down](https://static.developer.mastercard.com/content/open-finance-europe/uploads/unlicensed/environment_dropdown.png)

4. Update the environment with your client id and client secret (which you can get at the [Developer Portal](https://devportal.openbanking.mastercard.com/#/apps)). To do that, open the environment quick look (the button with the eye icon next to environment drop-down). Here you should see three variables, `client_id`, `client_secret` and `client_redirect_uri`. While hovering over their `Current Value`, click on the **Edit** button and update those values to your actual API Keys.

![Environment Expanded](https://static.developer.mastercard.com/content/open-finance-europe/uploads/unlicensed/environment_expanded.png)

5. You have to disable `Automatically follow redirects`. Go to the Postman settings page to do this.

6. Make the first request to `OAuth2 Connect`. The response will be 302 redirect. Go to response view at the bottom, click on the `Headers` tab, copy the url in the `Location` header tab and navigate to it in the browser. This will start the Connect Flow. When complete, you will be redirected to your configured redirect url with a query parameter called `code`, see example below, you need the `code` in the next step.

    http://localhost:4200/callback \
    ?code=ugAAAAVDaXBoZXJ0ZXh0AIAAAAAAZ3802y%2Bk5MC%2F8Y%2B.... \
    &consentId=0a752eb6-54b3-4f37-baf5-87182c4a1a9a

7. URL [decode](https://www.urldecoder.org/) the `code` you got from the previous step. The decoded code is needed in the request body for `Code Exchange` request. This will exchange the `code` for an `access token`. The `access token` is automatically stored in the postman environment.
   ![Environment Drop-down](https://static.developer.mastercard.com/content/open-finance-europe/uploads/unlicensed/code_exchange.png)

8. The rest of the requests should be automated enough to not require manual input.

You can refer to our [Tutorials and Guides](https://developer.mastercard.com/open-finance-europe/documentation/unlicensed/aiia-data/tutorials/index.md) for additional details on the API endpoints and their usage.
