This walk-through demonstrates how to add an HTTP Authorization header to the unauthenticated endpoint in our previous Flow. Adding the Authorization header enables you to invoke an API endpoint that is protected by HTTP Basic Authentication.
If you are familiar with API gateways, you can protect the API with basic authentication and test. For the purposes of this Flow, however, setting up an API gateway is out of scope. Because the Amazon PetStore API ignores the Authorization header, you can still work through this tutorial without setting up an API gateway and use the unauthenticated endpoint.
Prerequisite: This tutorial builds on the Petstore Flow that you created the Call an unauthenticated API tutorial. Be sure that your previous Flow is working correctly.
- In the Admin Console, go to Workflow > Workflows console.
- At the top navigation bar, select Settings.
- Under Connections for the HTTP PetStore connection that you just created, click the Reauthorize icon.
- Change Auth Type to
- For username, enter
admin; for password, enter
Note: Because the actual API is not authenticated, the values don’t matter.
- To apply the modifications to the connection settings, click Reauthorize.
Test the flow
- In Postman, copy the URL and then paste it into the Flow Test window.
- Enter your parameters:
- url = http://petstore-demo-endpoint.execute-api.com/petstore/pets
- key1 = type
- value1 = Dog
- key2 = page
- value2 = 2
- Click Test.
- In the executed Flow, check your outputs. Verify that the body matches the details from Postman.