# Testing the API with Insomnia source: https://developer.mastercard.com/mastercard-benefits-and-experiences-portal/documentation/tutorials-and-guides/test-api-insomnia/index.md ## Prerequisites {#prerequisites} ### For testing with an API testing tool: {#for-testing-with-an-api-testing-tool} 1. Install [Insomnia](https://developer.mastercard.com/platform/tutorial/use-insomnia-rest-client-for-mastercard-apis?lang=#overview). 2. Configure your ennvironment with predefined Mastercard settings, such as `consumerKey`, `keystorePassword`, etc. 3. Download an API collection file: [benefits-and-experiences-portal-collection.yaml](https://static.developer.mastercard.com/content/mastercard-benefits-and-experiences-portal/uploads/tutorial/benefits-and-experiences-portal-collection.yaml) (9KB). ## Instructions {#instructions} 1. Launch Insomnia and switch to its **Dashboard**. 2. Press **Create** to open a drop-down menu, then choose **File** . ![dashboard](https://static.developer.mastercard.com/content/mastercard-benefits-and-experiences-portal/uploads/tutorial/insomnia1.png) 3. In the Open File dialog window, choose the previously downloaded API collection file (the `*.yaml` file). 4. You should see a message notifying you of the successfully imported workplace: ![dashboard](https://static.developer.mastercard.com/content/mastercard-benefits-and-experiences-portal/uploads/tutorial/insomnia2.png) 5. Acknowledge the message and make sure the collections has loaded correctly. In the panel to the left, you should see the name of the folder **API Testing - Benefits Portal** . Under that folder, there should be three `POST` endpoints: * `Search Benefits` for searching benefits by credit card number * `SSO` for generating a single sign-on user token for webviews * `Select Benefits` for selecting (activating) benefits by credit card number. ![dashboard](https://static.developer.mastercard.com/content/mastercard-benefits-and-experiences-portal/uploads/tutorial/insomnia3.png) Proceed to [use cases](https://developer.mastercard.com/mastercard-benefits-and-experiences-portal/documentation/use-cases/index.md) and use sample request and response for your reference if needed.