Apicat Docs
  1. Environments & variables
Apicat Docs
  • What is Apicat?
  • Send requests
    • Create requests
      • Request basics
      • Parameters and body
      • Request headers
      • Request settings
      • Dynamic values
      • HTTP/2
      • SOAP/WebService
    • Authentication and authorization
      • Overview
      • CA and client certificates
      • Authorization types supported by Apidog
      • Digest Auth
      • OAuth 1.0
      • OAuth 2.0
      • Hawk Authentication
      • Kerberos
      • NTLM
      • Akamai EdgeGrid
    • Response and cookies
      • Overview
      • API response in Apidog
      • Create and send cookies
      • Debug requests
    • Dynamic values Modules
      • Airline
      • Animal
      • Color
      • Commerce
      • Company
      • Database
      • Datatype
      • Date
      • Finance
      • Food
      • Git
      • Hacker
      • Helpers
      • Image
      • Internet
      • Location
      • Lorem
      • Music
      • Number
      • Person
      • Phone
      • Science
      • String
      • System
      • Vehicle
      • Word
  • Environments & variables
    • Overview
    • Using variables
    • Environments & services
  • Pre/Post processors
    • Overview
    • Assertion
    • Extract variable
    • Wait
    • Database operations
      • Overview
      • MySQL
      • MongoDB
      • Redis
      • Oracle Client
    • Using scripts
      • Overview
      • Pre processor scripts
      • Post processor scripts
      • Public scripts
      • Postman scripts reference
      • Calling other programming languages
      • Using JS libraries
      • Visualizing responses
      • Script examples
        • Assertion scripts
        • Using variables in scripts
        • Using scripts to modify request messages
        • Other examples
  • Best practices
    • How to handle API signatures
    • How to access OAuth 2.0 protected APIs
    • Apidog collaboration workflow
    • Managing authentication state in Apidog
  • Account & preferences
    • Account settings
    • Generate OpenAPI access token
    • Language settings
    • Hot keys
    • Network proxy configuration
    • Data backup
    • Updating Apidog
    • Deleting account
    • Experimental Features
  • References
    • API-Design First Approach
    • Apidog OpenAPI/Swagger Specificaiton Extensions
    • JSONPath
    • XPath
    • Regular Expressions
    • JSON Schema
    • CSV File Format
    • Install Java Environment
    • Runner deployment environment
    • Apidog flavored Markdown
  1. Environments & variables

Environments & Variables in Apidog

In Apidog, a variable serves as a dynamic placeholder for values that can be utilized across multiple API requests and scripts. When executing a request or script, Apidog references the current value of the variable. By grouping variables into environments, you can easily adapt your testing setup to different work scenarios.

Getting Started with Variables#

Here's a quick guide to creating and using variables in Apidog:
1
Open the default PetStore project, which is pre-installed in your Team space for every user.
2
Locate and click the environment icon ≡ at the top right in your interface.
3
Find the Global Variables section. Create a new variable called my_variable with "123" as its initial value.
image.png
4
Click the Save button.
5
Open the "Find pet by ID" endpoint, and switch to the Run tab.
6
locate the path parameter "PetId", and add {{my_variable}} as the value.
7
Move your cursor over the variable name to view its current value and scope.
image.png
8
Click the Environments dropdown besides the ≡ icon, and switch to Local Mock environment.
9
Click Send to execute the request.
10
You will find the response displayed in the lower half of the interface. By switching to the "Actual Request" tab, you can view the request that was actually sent, with variables replaced by their respective actual values.
For a deeper understanding of variables in Apidog, go to Using variables.

Create and switch environments#

The term "environment" is commonly used in development teams, distinguishing between "development environment," "testing environment," "production environment," and so on. Each environment encompasses one or a set of servers. When the client is in a particular environment, all requests are sent to the servers in that environment. Upon switching environments, requests are directed to a different set of servers.
Learn more about environments and services .
Modified at 2025-06-25 07:57:16
Previous
Word
Next
Using variables
Built with