Build a new connector with Postman
4. Authentication using API keys
If the application you're connecting to doesn't support OAuth 2.0, you may need to authenticate using an API key instead. An API key is a unique identifier that associates and authenticates any requests make with your account. This allows Digital Assistant to access private details in external applications without needing a user's password. Postman connectors that make requests to services which require authentication using an API key must send the API key alongside every request.
In this example, we will authenticate with IEX Cloud using an API key, enabling us to create API requests to IEX Cloud as a logged-in user. To do so, we must provide Postman with our API key in advance of making any requests.
The API key connector template generator should be used to create a basic connector that uses API keys for authentication. You will need to specify where the API key should be added to the request, as well as the API base URL, the API key parameter name and the API key itself.
Different applications typically expect the API key to be sent in a specific way. Ensure you consult the API documentation of the service you're connecting to to understand the format that application expects.
For IEX Cloud, the API key is sent in the query parameters:
Click Download to create a new collection, then Import your collection into Postman.
We can now make a test request to the API to check that the API key has been configured correctly. To do so, add a new request to your collection by clicking the three dots menu and selecting Add Request.
As the API key for IEX Cloud is sent in the query parameters of the request, we can see that it has automatically been added by Postman into the Query Params section.
Enter a URL into the Request URL field. For this example, we will request the current stock value and related information for Apple. Click Send to make the request.
If the request completed successfully, the response will be displayed in the Body tab of the response panel.