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 streamline API testing and ensure consistency. Environment settings can be categorized into Parameters, Authorization, and Endpoint URL based on their use. Below are some examples.
Parameters Environment Settings
Example:
Suppose 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 for authentication.
Authorization Environment Settings
Example:
You can store credentials for Basic Authentication in environment settings. For instance, a variable called basicAuth with the value Base64Encode(username:password).
Request Header
Authorization: Basic {{basicAuth}}
This approach keeps sensitive information secure and makes it easy to update credentials when needed.
Endpoint URL Environment Settings
Example:
Suppose you have an environment variable called baseURL, representing 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 environments (development, staging, production) without modifying each request.
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, e.g.,
{{variableName}}.
Using environment settings in eZintegrations makes your API testing more efficient, maintainable, and adaptable to different 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. Unsaved changes will be lost.
- Newly created Environment Settings are retained only while the login session is active.