Environment Settings in eZintegrations
In eZintegrations, environment settings are used to store and manage dynamic values that can be reused across multiple requests and collections. These settings are helpful for streamlining your API testing and ensuring consistency in your requests. Environment settings can be categorized into different types, such as Parameters, Authorization, and Endpoint URL, based on their use. Below are some examples.
Parameters Environment Settings
Example:
Let’s say you have an environment variable called apiKey, which stores an API key. You can use this variable in your requests as shown below:
Request URL
https://api.example.com/data?apikey={{apiKey}}
Request Headers
Authorization: Bearer {{apiKey}}
In this example, the {{apiKey}} variable is used to pass the API key both in the URL and as a header value for authentication.
Authorization Environment Settings
Example:
You can store credentials for Basic Authentication in environment settings. For instance, you might have a variable called basicAuth with the value Base64Encode(username:password).
Request Header
Authorization: Basic {{basicAuth}}
This approach allows you to keep sensitive information secure and makes it easy to update credentials if they change.
Endpoint URL Environment Settings
Example:
Suppose you have an environment variable called baseURL, which represents the base URL for your API. You can use it in requests as follows:
Request URL
{{baseURL}}/endpoint
By setting the baseURL variable, you can easily switch between different environments (such as development, staging, and production) without modifying all your requests.
How to Create and Manage Environment Settings in eZintegrations
- Open eZintegrations and navigate to Add Integration Bridge.
- Select an API from Data Source and click the + button to add Environment Settings.
- Create a new environment or select an existing one.
- Add settings with their names and values, and categorize them as needed (Parameters, Authorization, Endpoint URL).
- Reference these settings in your requests using double curly braces, such as
{{variableName}}.
By using environment settings in eZintegrations, you can make your API testing more efficient, maintainable, and adaptable to different testing scenarios and environments.
You can create Environment Settings in:
- Data Source API
- Operations API
- Data Target APIs
- Marketplace APIs
Important Notes
- All Environment Settings are saved only when the Integration Bridge is saved. If it is not saved, the Environment Settings will be lost.
- Newly created Environment Settings are retained only while the login session remains active.
