Skip to main content

Environments

What are variables in Sparrow?

Variables in Sparrow are reusable values defined as key-value pairs that can be used across API requests, such as user IDs, tokens, or other data.

What is the purpose of environments in Sparrow?

Environments in Sparrow allow you to create different sets of variables for different stages of API development, such as development, testing, or production.

What is the difference between global and local environments?

Global environment variables are available across all workspaces and environments, while local environment variables are specific to a particular environment or workspace.

Why should I use environments in API development?

Environments help you quickly switch between different sets of variables based on the context (e.g., development vs. production), ensuring accurate API testing and minimizing manual changes.

How do variables help with API requests?

Variables reduce redundancy and errors by allowing you to reuse values like authentication tokens or user IDs across multiple API requests.

How do I add a global environment variable in Sparrow?

Navigate to the Collections tab, select Environments from the sidebar, choose Global Variables, and add the variable name and value. Click "Save" to store it.

Where can global environment variables be used?

Global environment variables can be used anywhere within Sparrow, regardless of which environment or workspace is selected.

Can I add multiple global environment variables?

Yes, you can add as many global environment variables as needed. A new field is created automatically as you enter each variable.

How do I delete a global environment variable?

Click the delete icon next to the variable you wish to remove in the Global Environment section.

How do I create a local environment in Sparrow?

Click the "+ Add Environment" button in the Environments tab to create a new local environment. Enter variable names and values, then click "Save."

What is the difference between global and local environment variables?

Local environment variables are specific to a particular environment and cannot be used across other environments, unlike global variables which are accessible everywhere.

How do I switch between local environments in Sparrow?

To switch environments, select the desired environment from the dropdown list in the Collections panel of the REST API tool.

How do I rename or delete a local environment?

Right-click on the "three dots" icon next to the local environment, and choose either "Rename" or "Delete" from the menu.

Can I create multiple local environments?

Yes, you can create multiple local environments by clicking the "+ Add Environment" button, and they can be managed individually.

How can I add a new variable while making an API request?

If a variable is not available in the list, you can type it in the request, and Sparrow will prompt you to add the variable to the selected or global environment.