Apidog Docs
πŸ‡ΊπŸ‡Έ English
  • πŸ‡ΊπŸ‡Έ English
  • πŸ‡―πŸ‡΅ ζ—₯本θͺž
HomeLearning CenterSupport CenterAPI References
HomeLearning CenterSupport CenterAPI References
Discord Community
Slack Community
X / Twitter
πŸ‡ΊπŸ‡Έ English
  • πŸ‡ΊπŸ‡Έ English
  • πŸ‡―πŸ‡΅ ζ—₯本θͺž
  1. Apidog CLI
  • Apidog Learning Center
  • Get started
    • Introduce Apidog
    • Basic concepts in Apidog
    • Navigating Apidog
    • Quick Start
      • Overview
      • Specify a new endpoint
      • Make a request to the endpoint
      • Add an assertion
      • Create a test scenario
      • Share your API documentation
      • Explore more
      • Send a request and save as an endpoint
    • Migration
      • Overview
      • Manual import
      • Scheduled import
      • Import options
      • Export data
      • Import from...
        • Import from Postman
        • Import OpenAPI (Swagger) spec
        • Import cURL
        • Import Markdowns
        • Import from Insomnia
        • Import from apiDoc
        • Import .har file
        • Import WSDL
  • Design APIs
    • Overview
    • Create a new API project
    • Endpoint basics
    • Components
    • Common fields
    • Global parameters
    • Endpoint change history
    • Batch endpoint management
    • Configure multiple request body examples
    • Schemas
      • Overview
      • Create a new schema
      • Build a schema
      • Generate Schemas from JSON etc.
    • Security schemes
      • Overview
      • Create a security scheme
      • Use the security scheme
      • Security scheme in online documentation
    • Advanced features
      • Custom endpoint fields
      • Import endpoints as test steps
      • Endpoint status
      • Appearance of parameter lists
      • Endpoint unique idenfication
  • Develop and Debug APIs
    • Overview
    • Generate requests
    • Send requests
    • Endpoint cases
    • Dynamic values
    • Validate responses
    • Design-first Mode & Request-first Mode
    • Generate code
    • Environments & variables
      • Overview
      • Using variables
      • Environments & services
    • Vault secrets
      • Overview
      • HashiCorp Vault
      • Azure Key Vault
      • AWS Secrets Manager
    • Pre/Post processors
      • Overview
      • Assertion
      • Extract variable
      • Wait
      • Database operations
        • Overview
        • MongoDB
        • Redis
        • Oracle Client
      • Using scripts
        • Overview
        • Postman scripts reference
        • Pre processor scripts
        • Post processor scripts
        • Public scripts
        • 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
    • Dynamic values Modules
  • Mock API data
    • Overview
    • Smart mock
    • Custom mock
    • Mock priority sequence
    • Mock scripts
    • Cloud mock
    • Self-hosted runner mock
    • Mock language (Locales)
  • Automated tests
    • Overview
    • Test reports
    • Test scenarios
      • Create a test scenario
      • Pass data between requests
      • Flow control conditions
      • Import endpoints/endpoint cases from other projects
      • Sync data from endpoints/endpoint cases
      • Export test scenarios
    • Run test scenarios
      • Run a test scenario
      • Data-driven testing
      • Run test scenarios in batch
      • Scheduled tasks
      • Manage the runtime environment of APIs from other projects
    • Test APIs
      • Integration testing
      • Performance testing
      • End-to-end testing
      • Regression testing
    • Apidog CLI
      • Overview
      • Installing and running Apidog CLI
      • Apidog CLI Options
    • CI/CD
      • Overview
      • Integrate with Jenkins
      • Integration with Gitlab
  • Publish API Docs
    • Overview
    • API Technologies Supported
    • Quick share
    • View the API documentation
    • Publish docs sites
    • Folder tree settings
    • Custom layouts
    • Visibility settings
    • Endpoint SEO settings
    • Custom domain
    • Embedding values in document URLs
    • Documentation Search
    • Integrating Google Analytics with Doc Sites
    • CORS Proxy
    • API Versions
      • Overview
      • Create API versions
      • Publish API versions
      • Share endpoints with API versions
  • Send requests
    • Overview
    • gRPC
    • Use request proxy agents for debugging
    • SOAP/WebService
    • GraphQL
    • WebSocket
    • Socket.IO
    • SSE debugging
    • Create requests
      • Request History
      • Request basics
      • Parameters and body
      • Request headers
      • Request settings
      • HTTP/2
    • 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
      • Save the request as an endpoint
  • Branches
    • Overview
    • Create a new sprint branch
    • Test APIs in a branch
    • Design API in a branch
    • Merge sprint branches
    • Manage sprint branches
  • Apidog MCP Server
    • Overview
    • Conntect API Specification within Apidog Project to AI via Apidog MCP Server
    • Conntect Online API Documentation Published by Apidog to AI via Apidog MCP Server
    • Conntect OpenAPI Files to AI via Apidog MCP Server
  • Best practices
    • How to handle API signatures
    • How to access OAuth 2.0 protected APIs
    • Apidog collaboration workflow
    • Managing authentication state in Apidog
  • Administration
    • Onboarding Checklist
      • Basic Concepts
      • Onboarding Guide
    • Managing Teams
      • Managing Teams
      • Managing Team Members
      • Member Roles & Permission Settings
      • Team Activities
      • Team Resources
        • General Runner
        • Team Variables
        • Request Proxy Agent
      • Real-time Collaborations
        • Team Collaboration
    • Managing Projects
      • Managing Projects
      • Managing Project Members
      • Notification Settings
      • Project Resources
        • Database Connection
    • Managing Organizations
      • Single Sign-On (SSO)
        • SSO Overview
        • Configure Microsoft Entra ID
        • Configure Okta
        • Configure SSO for an Organization
        • Managing user accounts
        • Mapping Groups to Teams
      • SCIM Provisioning
        • Intro to SCIM Provisioning
        • Microsoft Entra ID
        • Okta
      • Organization Resources
        • Self-hosted Runner
  • Billing
    • Overview
    • Credits
    • Unable to use credit cards?
    • Managing subscriptions
    • Upgrade plan
  • Data & Security
    • Where is Apidog's data stored, and how is data security ensured?
    • How is user data stored? Will this data be public? Or will it be private? Will all data be stored in the cloud?
    • When sending requests, do they go through the Apidog server? Is data security ensured?
  • Add-ons
    • API Hub
    • Apidog Intellij IDEA plugin
    • Browser Extension
      • Chrome
      • Microsoft Edge
    • Request Proxy
      • Request proxy in Apidog web
      • Request proxy in shared docs
      • Request proxy in Apidog client
  • Account & preferences
    • Language settings
    • Data backup
    • Network proxy configuration
    • Hot keys
    • Updating Apidog
    • Generate OpenAPI access token
    • Deleting account
    • Account settings
  • 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
  • Apidog Europe
    • Apidog Europe
  • Support Center
  1. Apidog CLI

Apidog CLI Options

Basic Apidog CLI syntax#

Online execution:
apidog run --access-token <value> [options]
Use the Apidog access token along with the ID of a specific test scenario or test scenario directory. For example:
apidog run --access-token $APIDOG_ACCESS_TOKEN -t 637132 -e 358171 -d 3497013 -r html,cli --database-connection ./database-connections.json
Local execution:
apidog run <collection> [options]
Specify the URL or file path of the Apidog test scenario. For example:
apidog run examples/sample.apidog-cli.json -r cli,html

Options#

OptionDescription
--access-token <accessToken>Set authentication token for online execution
-t, --test-scenario <testScenarioId>Specify test scenario ID to run
-f, --test-scenario-folder <folderId>Specify test scenario directory ID to run
-r, --reporters [reporters]Specify test report types (default: ["cli"])
--out-dir <outDir>Output directory for test reports (default: "./apidog-reports")
--out-file <outFile>Output filename for test reports
--out-json-failures-separated <outJsonFailuresSeparated>Export failures as separate JSON file
-e, --environmentSpecify runtime environment
-n, --iteration-count <n>Set number of iterations
-d, --iteration-data <path>Set data for case iterations (JSON or CSV)
--variables <path>Environment/global variables using from files in the specified path, instead of use initial values of environment/global variables.
--global-var <value>Set global variables (key=value format)
--env-var <value>Set environment variables (key=value format)
--external-program-path <path>Specify file path for external programs
--database-connection <path>Specify file path for database configuration
--ignore-redirectsPrevent automatic redirects
--silentPrevent console output
--color <value>Enable/disable colored console output
--delay-request [n]Specify delay between requests (ms)
--timeout-request [n]Specify request timeout (ms)
--timeout-script [n]Specify script execution timeout (ms)
-k, --insecureDisable SSL verification
--ssl-client-cert-list <path>Specify client certificate config path
--ssl-client-cert <path>Specify client certificate path (PEM)
--ssl-client-key <path>Specify client certificate private key path
--ssl-client-passphrase <passphrase>Specify client certificate passphrase
--ssl-extra-ca-certs <path>Specify additional trusted CA certificates
-b, --bigintEnable bigint compatibility
--upload-report [value]Upload test report overview to cloud
--preferred-http-version <preferredHttpVersion>Set preferred HTTP protocol version
--verboseDisplay detailed request and response information
--lang <language>Set CLI language (en)
-h, --helpDisplay help information

Uploading files in CLI#

When working with APIs that require file uploads, it's important to understand that while Apidog only stores the local file path, while the actual file remains on your local computer. This can cause issues when executing tests via CLI on a different machine, as it won't be able to access the file using the stored path.
To resolve this issue, follow these steps:
1
Copy the required file to the machine running the CLI beforehand.
2
Copy the file path on the CLI machine.
3
In the Apidog test scenario, locate the step details for the file upload request and click the "Batch Edit" button.
CleanShot 2025-03-06 at 10.46.53@2x.png
4
Replace the file field parameter value with the file path on the CLI machine(e.g., /opt/apidog/runner/yourfilename.jpg).
CleanShot 2025-03-06 at 10.48.01@2x.png
After this configuration, the file can be correctly sent to Apidog through the CLI.
Note: If you want to run this test scenario locally again, you'll need to modify the file path in the parameter value back to the path on your local machine.

Using database operations in CLI#

When your test scenarios include database operations, you need to take a few extra steps because database configurations are saved locally, not in the cloud. This means you can't directly run the CLI in cloud mode for these scenarios. Here's how to handle this situation:
1
For test scenarios that include database operations, you'll see a prompt in the command line generation interface: "Download the database configuration file."
2
Download this file and place it in the directory where you plan to run the Apidog CLI.
3
The automatically generated command line will include the --database-connection option. You can use this command line as is to run your tests.

Uploading local CLI test reports to the cloud#

To upload your local CLI test reports to the cloud, you can add the --upload-report parameter at the end of your CLI command. Here's how to do it:
1
Add the --upload-report parameter to your CLI command:
apidog run --access-token $APIDOG_ACCESS_TOKEN -t 637132 -e 358171 -d 3497013 -r html,cli --upload-report
2
This command will run your tests and automatically upload the test report to the cloud after completion.
3
To view the uploaded report:
Go to the "Test Reports" section in your Apidog dashboard.
Look for the "Team Reports" column.
4
Note: For reports uploaded via CLI, the "Tester" field will be displayed as empty.

Using external scripts/programs in CLI#

You can reference external scripts or programs when running the Apidog CLI by adding their path at the end of the command. Here's how to do it:
--external-program-path ./scripts
In this example, the CLI is instructed to reference programs located in the ./scripts directory. If no hierarchy is specified, the default is the current CLI execution directory.
There are two main approaches to managing these external scripts:
1.
Local Path
To avoid confusion in managing local scripts, it's recommended to:
Organize all script files by category
Place them in a specific directory
Specify the corresponding local path in the CLI command
2.
Cloud Code Repository
Alternatively, you can:
Host script files in a cloud-based code repository
Set up pull commands in your CI/CD workflow to fetch external scripts to the local environment
Specify the actual path of the external scripts in the CLI command

SSL#

Client certificate#

Apidog CLI supports passing in client certificates.

Using single SSL client certificate#

--ssl-client-cert
Specify the path of the public SSL client certificate.
--ssl-client-key
Specify the path of the private SSL client certificate (optional).
--ssl-client-passphrase
Specify SSL client passphrase (optional).

Using SSL client certificates configuration file (supports multiple certificates)#

--ssl-client-cert-list
Specify the path of the JSON file of the SSL client certificate list. For example:ssl-client-cert-list.json
This option supports setting different SSL client certificates based on URL or hostname. It takes precedence over the --ssl-client-cert, --ssl-client-key, and --ssl-client-passphrase options. These options will be used as fallback options if there is no match for the URL in the list.

HTTP/2#

The CLI can be configured to use specific protocol versions for sending requests by using the --preferred-http-version parameter.
Protocol version parameter values:
1.
"HTTP/2" - HTTP/2 Application-Layer Protocol Negotiation (ALPN), supported only for HTTPS requests.
2.
"HTTP/2-with-prior-knowledge" - HTTP/2 with prior knowledge
3.
"HTTP/1" - HTTP/1.1
The parameter supports the following configurations:
1.
Setting different protocol versions for HTTPS and HTTP requests:
--preferred-http-version="https=HTTP/2,http=HTTP/2-with-prior-knowledge"
2.
Setting the same protocol version for both HTTPS and HTTP:
--preferred-http-version="HTTP/1"
3.
Setting HTTP/2 for both HTTPS and HTTP (unsupported values will be automatically ignored):
--preferred-http-version="HTTP/2"

FAQ#

Q: How to handle the error message Invalid character in header content["Authorization"]?
A: If you're certain that running test scenarios in the Apidog client or web interface doesn't produce any errors, please check if you've set INITIAL values for variables in your environment.
Previous
Installing and running Apidog CLI
Next
Overview
Built with