### Example of Original MSI Installation Properties for Upgrade Source: https://learning.postman.com/docs/introduction/overview/administration/enterprise/managing-enterprise-deployment Provides an example of the public properties (INSTALLDIR and MSIINSTALLPERUSER) that must be re-passed when upgrading the Postman Enterprise app. ```cmd INSTALLDIR=C:\custom and MSIINSTALLPERUSER=1 ``` -------------------------------- ### Duplicate an Example in Postman Source: https://learning.postman.com/docs/introduction/overview/sending-requests/response-data/examples How to create a new example based on an existing one, allowing for quick modifications. This is useful for creating variations of an example without starting from scratch. ```APIDOC 1. Select **Collections** in the sidebar. 2. Select **View more actions** next to an example, and then select **Duplicate**. 3. Make any changes to the example request or response. 4. Select **Save** to save the example. ``` -------------------------------- ### Install Postman CLI on Linux Source: https://learning.postman.com/docs/introduction/overview/postman-cli/postman-cli-installation Installs the Postman CLI on Linux systems. This `curl` command downloads and pipes an installation script to `sh`, which creates `/usr/local/bin` if necessary and installs the `postman` binary in `/usr/local/bin`. ```bash curl -o- "https://dl-cli.pstmn.io/install/linux64.sh" | sh ``` -------------------------------- ### Run HashiCorp Vault Setup Script Source: https://learning.postman.com/docs/introduction/overview/sending-requests/postman-vault/hashicorp-vault This command executes the HashiCorp Vault setup script. Users must provide the Vault cluster URL and can optionally include additional parameters to control script behavior, such as dry-run or suppressing prompts. Ensure Vault CLI is installed and required environment variables are set before execution. ```Shell $ hashicorp-setup-script-postman [options] ``` -------------------------------- ### Try an Example in Postman Source: https://learning.postman.com/docs/introduction/overview/sending-requests/response-data/examples Learn how to open and test an existing example as a new request in Postman, and optionally save it. This process allows you to review request and response details without altering the original example. ```APIDOC 1. Select **Collections** in the sidebar. 2. Select a request, and then select an example to open it. 3. Select **Try** to open the example as a request in a new tab. The request will automatically send in the new tab. 4. Review the request and response details. 5. Optionally, you can select **Save** to save the new request to a new or existing collection in your workspace. 6. Choose a location to save the new request, and then select **Save**. ``` -------------------------------- ### Postman: Manage Environment Variables Source: https://learning.postman.com/docs/introduction/overview/tests-and-scripts/write-scripts/test-examples This snippet shows how to set, get, and clear environment variables in Postman. It includes examples for setting simple key-value pairs, stringified arrays, and objects, and how to parse them back when retrieved. Use try-catch for unknown data sources. ```JavaScript //Set an environment variable postman.setEnvironmentVariable("key", "value"); //Set a nested object as an environment variable const array = [1, 2, 3, 4]; postman.setEnvironmentVariable("array", JSON.stringify(array, null, 2)); const obj = { a: [1, 2, 3, 4], b: { c: 'val' } }; postman.setEnvironmentVariable("obj", JSON.stringify(obj)); //Get an environment variable postman.getEnvironmentVariable("key"); //Get an environment variable whose value is a stringified object //(Wrap in a try-catch block if the data is coming from an unknown source) const array = JSON.parse(postman.getEnvironmentVariable("array")); const obj = JSON.parse(postman.getEnvironmentVariable("obj")); //Clear an environment variable postman.clearEnvironmentVariable("key"); ``` -------------------------------- ### Share an Example in Postman Source: https://learning.postman.com/docs/introduction/overview/sending-requests/response-data/examples Steps to share a Postman example with collaborators directly from the sidebar options, facilitating team collaboration on API development and testing. ```APIDOC You can share examples with collaborators by going to the example you want to share in the sidebar. Select **View more actions** next to the example you want to share, then select **Share**. ``` -------------------------------- ### OpenAPI 3.0: Providing Parameter Examples Source: https://learning.postman.com/docs/introduction/overview/api-governance/api-definition/openapi3 Providing examples for parameters is crucial for API consumers to understand expected data, aiding in mock server generation or collection creation. This snippet illustrates two ways to add examples: using a single `example` property or multiple `examples` with detailed descriptions. ```YAML openapi: '3.0.3' # ... paths: /resources: get: parameters: - name: status description: Filters resources on their status in: query example: done schema: type: string ``` ```YAML openapi: '3.0.3' # ... paths: /resources: get: parameters: - name: status description: Filters resources on their status in: query examples: anExample: summary: An example description: A description of an example value: done schema: type: string ``` -------------------------------- ### Install Postman CLI on Windows Source: https://learning.postman.com/docs/introduction/overview/postman-cli/postman-cli-installation Installs the Postman CLI on Windows systems. This PowerShell command downloads and executes an installation script, which creates the %USERPROFILE%\AppData\Local\Microsoft\WindowsApps directory if it doesn't exist and places the `postman` binary there. ```powershell powershell.exe -NoProfile -InputFormat None -ExecutionPolicy AllSigned -Command "[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://dl-cli.pstmn.io/install/win64.ps1'))" ``` -------------------------------- ### Send a Basic HTTP GET Request Source: https://learning.postman.com/docs/introduction/overview/design-apis/mock-apis/mock-with-examples This snippet demonstrates how to construct and send a simple HTTP GET request to the Postman Echo service. It includes a query parameter for testing purposes, illustrating a fundamental step in interacting with APIs. ```HTTP GET https://postman-echo.com/get?test=123 ``` -------------------------------- ### Install Postman CLI on macOS (Intel) Source: https://learning.postman.com/docs/introduction/overview/postman-cli/postman-cli-installation Installs the Postman CLI on macOS devices featuring Intel processors. This `curl` command downloads and pipes an installation script to `sh`, which creates `/usr/local/bin` if needed and installs the `postman` binary. ```bash curl -o- "https://dl-cli.pstmn.io/install/osx_64.sh" | sh ``` -------------------------------- ### ecs add Command Examples Source: https://learning.postman.com/docs/introduction/overview/insights/reference/agent/ecs-add Practical examples demonstrating how to use the `ecs add` command with various flags for common scenarios like port filtering, interface selection, and host/path exclusions. ```Shell postman-insights-agent ecs add ... --filter "port 80" ... ``` ```Shell postman-insights-agent ecs add ... --interfaces "lo,eth0" ... ``` ```Shell postman-insights-agent ecs add ... --path-exclusions '.*\.png' --path-exclusions '.*\.jpg' ... ``` ```Shell postman-insights-agent ecs add ... --host-exclusions 'deb\.debian\.org' ... ``` ```Shell postman-insights-agent ecs add ... --host-allow 'www\.example\.com' ... ``` ```Shell postman-insights-agent ecs add ... --path-allow '*/admin/*' ... ``` -------------------------------- ### Postman Flows: Get Configuration Block Reference Source: https://learning.postman.com/docs/introduction/overview/postman-flows/reference/blocks/get-configuration Documents the 'Get Configuration' block in Postman Flows, detailing its purpose to retrieve configuration values, its output port behavior, and setup instructions. It also lists other blocks where it can be inserted. ```APIDOC Get Configuration Block: Description: Retrieves the specified configuration's value and sends that value from its output port. Availability: Only in Flows actions. Output: Port: "Select a configuration" Behavior: Sends the selected configuration's value. Setup: Action: Open dropdown and choose a configuration from the list. Population: List populated with configurations created in the action's Settings. Insertable Into: - Create with AI - Evaluate - If - List - Record - Template ``` -------------------------------- ### Install MSI with Multiple Custom Options Source: https://learning.postman.com/docs/introduction/overview/administration/enterprise/managing-enterprise-deployment Illustrates how to apply multiple custom installation options, including string and integer types, during an MSI installation. ```cmd msiexec /i path\to\package.msi MY_STRING_OPTION='hello' MY_INTEGER_OPTION=7 ``` -------------------------------- ### Install Postman CLI on macOS (Apple silicon) Source: https://learning.postman.com/docs/introduction/overview/postman-cli/postman-cli-installation Installs the Postman CLI on macOS devices equipped with Apple silicon processors. This `curl` command downloads and pipes an installation script to `sh`, which then creates `/usr/local/bin` if necessary and installs the `postman` binary. ```bash curl -o- "https://dl-cli.pstmn.io/install/osx_arm64.sh" | sh ``` -------------------------------- ### Retrieve All Postman Environments via API Source: https://learning.postman.com/docs/introduction/overview/design-apis/mock-apis/mock-with-api Explains the use of the Postman API's `GET /environments` endpoint to retrieve a list of all user environments. This is useful for obtaining environment IDs if they are part of the mocking setup. Requires an `X-API-Key` for authorization. ```APIDOC Endpoint: GET https://api.getpostman.com/environments Authentication: Header: X-API-Key (Your Postman API Key) Response: Type: JSON Array of Environment Objects Example relevant field: "environments": [ { "id": "environment_uid", "name": "New Environment", "uid": "environment_uid" } ] Purpose: To find the 'uid' of a specific environment ``` -------------------------------- ### Test Docker Installation Source: https://learning.postman.com/docs/introduction/overview/collections/using-newman-cli/newman-with-docker Verify that Docker is correctly installed and running on your system by executing a simple 'hello-world' container. This command downloads and runs a test image, printing a confirmation message if successful. ```shell docker run hello-world ``` -------------------------------- ### Perform Per-User MSI Installation to Custom Directory Source: https://learning.postman.com/docs/introduction/overview/administration/enterprise/managing-enterprise-deployment Shows how to combine per-user installation with a custom installation directory using both MSIINSTALLPERUSER and INSTALLDIR options. ```cmd msiexec /i path/to/package.msi MSIINSTALLPERUSER=1 INSTALLDIR=%USERPROFILE%\custom ``` -------------------------------- ### Run Postman Collections Programmatically with Newman in Node.js Source: https://learning.postman.com/docs/introduction/overview/collections/using-newman-cli/installing-running-newman This example demonstrates how to integrate Newman into a Node.js project to programmatically run a Postman collection. It shows how to require the Newman module, pass collection options, and handle the run completion callback. ```JavaScript const newman = require('newman'); // require Newman in your project // call newman.run to pass the `options` object and wait for callback newman.run({ collection: require('./sample-collection.json'), reporters: 'cli' }, function (err) { if (err) { throw err; } console.log('collection run complete!'); }); ``` -------------------------------- ### Enable Verbose Logging for MSI Installation Source: https://learning.postman.com/docs/introduction/overview/administration/enterprise/managing-enterprise-deployment Shows how to enable verbose logging for an MSI installation, outputting debug information to a specified log file using the /l*v option. ```cmd msiexec /i path\to\package.msi /l*v C:\log.txt ``` -------------------------------- ### Run an MCP Server Locally with Node.js and npm Source: https://learning.postman.com/docs/introduction/overview/postman-ai-agent-builder/ai-tool-builder/create-mcp-server This snippet provides the necessary commands to install dependencies and start a locally generated Model Context Protocol (MCP) server. The generated server code is in TypeScript. It requires Node.js (v16+ required, v20+ recommended) and npm. ```Shell npm install node mcpServer.js ``` -------------------------------- ### Install Postman Linux Launcher Icon Desktop File Source: https://learning.postman.com/docs/introduction/overview/getting-started/installation/installation-and-updates This command installs the Postman desktop entry file into the user's local applications directory. This allows the Postman application to be launched conveniently from a desktop environment's application launcher or menu. ```Shell install -t ~/.local/share/applications/ //Postman/app/resources/Postman.desktop ``` -------------------------------- ### Postman: Manage Global Variables Source: https://learning.postman.com/docs/introduction/overview/tests-and-scripts/write-scripts/test-examples This snippet demonstrates how to set, get, and clear global variables in Postman, which are accessible across all collections and environments. ```JavaScript //Set a global variable postman.setGlobalVariable("key", "value"); //Get a global variable postman.getGlobalVariable("key"); //Clear a global variable postman.clearGlobalVariable("key"); ``` -------------------------------- ### OpenAPI 3: Provide Examples for API Responses Source: https://learning.postman.com/docs/introduction/overview/api-governance/api-definition/openapi3 This snippet demonstrates how to include examples for API responses in OpenAPI 3 definitions. Examples, whether single (`example` property) or multiple (`examples` property), are crucial for helping API consumers understand expected data structures, generate mock servers, and create collections. ```YAML openapi: '3.0.3' # ... paths: /resources: get: responses: '200': description: A success response content: 'application/json': schema: # ... example: aProperty: example ``` ```YAML openapi: '3.0.3' # ... paths: /resources: get: responses: '200': description: A success response content: 'application/json': schema: # ... examples: anExample: summary: An example description: This is an example description value: aProperty: example value ``` -------------------------------- ### Install Postman Enterprise App on Linux with Snap Source: https://learning.postman.com/docs/introduction/overview/administration/enterprise/managing-enterprise-deployment Instructions for installing the Postman Enterprise application on Linux using Snap, including a pre-installation cleanup step. ```bash sudo snap remove postman-enterprise ``` ```bash sudo snap install /path/to/postman-enterprise.snap --dangerous ``` -------------------------------- ### Postman Flows: Start Block Reference Source: https://learning.postman.com/docs/introduction/overview/postman-flows/reference/blocks/start Detailed reference for the Start block in Postman Flows, covering its purpose, input/output capabilities, and configuration options for receiving and sending data within a flow module or scenario. ```APIDOC Start Block (Postman Flows) Description: The automatic starting point for every new flow module. Triggers connected blocks and can receive/send data. Inputs: - No default input ports. - Can add custom inputs to receive data from: - Scenarios - Flow Module blocks - Input values are sent as a JSON object (key-value pairs). - Adding an input: 1. In the Start block, select "Add input" (plus icon). 2. (Optional) Select the dropdown list to choose a different data block. 3. Enter a name for the input. Output: - Single output port. - Triggers any connected blocks. - Can send a JSON object containing key-value pairs defined by added inputs. Setup: - Appears automatically on every new flow's canvas. - Connected to three buttons: - Add an HTTP Request block. - Open the blocks list. - Explore the Flows Catalog. - Trigger blocks simultaneously: Connect the Start block's output port to any blocks you want to trigger simultaneously. - Receive data with inputs: (See Inputs section for details) Allow input of any type: - Purpose: Deactivates scenarios and causes the Start block to send only received data, or no data. - Steps: 1. Select the Start block. 2. Select "Additional Settings" (gear icon). 3. Select the switch next to "Allow input of any type". ``` -------------------------------- ### Create Postman Linux Desktop Entry File Content Source: https://learning.postman.com/docs/introduction/overview/getting-started/installation/installation-and-updates This configuration defines a desktop entry for Postman on Linux, specifying its name, executable path, icon, terminal requirement, type, and categories for display in application menus. The placeholder `` must be replaced with the actual installation path of the Postman application. ```INI [Desktop Entry] Encoding=UTF-8 Name=Postman Exec=/Postman/app/Postman %U Icon=/Postman/app/resources/app/assets/icon.png Terminal=false Type=Application Categories=Development; ``` -------------------------------- ### Enable Logging for PKG Installations on macOS Source: https://learning.postman.com/docs/introduction/overview/administration/enterprise/managing-enterprise-deployment Demonstrates how to use the `-dumplog` and `-verbose` flags with the `installer` tool to obtain detailed information during a Postman Enterprise PKG installation on macOS. ```bash sudo installer -dumplog -verbose -pkg path/to/app.pkg -target LocalSystem ``` -------------------------------- ### Postman Mock Server: Match Response by Name or ID Source: https://learning.postman.com/docs/introduction/overview/design-apis/mock-apis/mock-with-api Details the use of x-mock-response-name or x-mock-response-id headers to precisely control which saved example the mock server returns. Emphasizes the need for unique example names and mentions retrieving IDs/names via the Postman API's GET /collections/{collectionId} endpoint. ```APIDOC Header: x-mock-response-name Description: Specifies the exact response to return by matching the name of a saved example. Type: string Constraint: Use unique names for all saved examples. Header: x-mock-response-id Description: Specifies the exact response to return by matching the ID of a saved example. Type: string Retrieval: Can be obtained using Postman API's GET /collections/{collectionId} endpoint. ``` -------------------------------- ### Postman Flows: AI Request Block Setup and Variables Source: https://learning.postman.com/docs/introduction/overview/postman-flows/reference/blocks/ai-request Explains the setup options for the AI Request block, including selecting an AI request from a collection and managing variables. ```APIDOC AI Request Block Setup: Select a request: Description: Dropdown list to select an AI Request from available collections in the workspace. Type: Configuration Variables: Description: Lists variables from the selected request. Values can be assigned by connecting other blocks' output ports or inserting data blocks. Supports environment variables via 'Add environment' dropdown. Type: Configuration ``` -------------------------------- ### Install Newman globally using npm Source: https://learning.postman.com/docs/introduction/overview/collections/using-newman-cli/installing-running-newman This command installs Newman, the Postman collection runner, globally on your system using npm. Ensure Node.js v16 or later is installed before running this command to ensure compatibility. ```npm npm install -g newman ``` -------------------------------- ### Check Status of Postman Insights Agent DaemonSet Source: https://learning.postman.com/docs/introduction/overview/insights/get-started/kubernetes/daemonset Use this command to check the status of the 'postman-insights-agent' DaemonSet within the 'postman-insights-namespace'. This helps verify if all assigned pods have started up and if the number of desired and ready pods are equal. ```shell kubectl get daemonsets -n postman-insights-namespace postman-insights-agent ``` -------------------------------- ### Postman Flows Template Block Setup and Variable Creation Source: https://learning.postman.com/docs/introduction/overview/postman-flows/reference/blocks/template Covers the setup process for the Template block, how to specify input type, and methods for creating and referencing variables within the block using curly braces. ```APIDOC Setup: 1. Enter text/JSON in the text box. 2. Select input type (Text/JSON) from the dropdown. Variable Referencing: Use {{variable_name}}. Variable Creation: - Connect a block's output to the 'variable' input port. - Insert a block using 'Add data blocks' icon. - Change inserted block type by selecting its icon. ``` -------------------------------- ### Install Postman Enterprise PKG on macOS Source: https://learning.postman.com/docs/introduction/overview/administration/enterprise/managing-enterprise-deployment Instructions for installing the Postman Enterprise application using a PKG installer on macOS, supporting both system-wide and per-user installations. ```bash sudo installer -dumplog -verbose -pkg path/to/app.pkg -target LocalSystem ``` ```bash installer -dumplog -verbose -pkg path/to/app.pkg -target CurrentUserHomeDirectory ``` -------------------------------- ### Install Postman on Mac using Homebrew Source: https://learning.postman.com/docs/introduction/overview/getting-started/installation/installation-and-updates This command installs the Postman desktop application on macOS using the Homebrew package manager, which simplifies software installation and management on Apple systems. ```Shell brew install --cask postman ``` -------------------------------- ### HashiCorp Vault Setup Script Command-Line Options Source: https://learning.postman.com/docs/introduction/overview/sending-requests/postman-vault/hashicorp-vault This section details the command-line options available for the HashiCorp Vault setup script. These options allow users to customize the script's execution, such as performing a dry run to only print commands or bypassing user input prompts. ```APIDOC Options: -d, --dry-run: Only print commands. --help: Output usage information. -y: Don't prompt for user input before executing each command. ``` -------------------------------- ### Postman API: Get Collection Details Source: https://learning.postman.com/docs/introduction/overview/design-apis/mock-apis/mock-with-api Reference for the Postman API endpoint used to retrieve details of a collection, including the IDs and names of saved examples, which can be used for mock server matching. ```APIDOC Endpoint: GET /collections/{collectionId} Description: Retrieves details of a specific Postman collection. Path Parameters: collectionId: The unique identifier of the collection. Purpose: Used to find example response IDs or names for mock server matching. ``` -------------------------------- ### OpenAPI 2.0: Provide Examples for All API Responses Source: https://learning.postman.com/docs/introduction/overview/api-governance/api-definition/openapi2 Response objects in an API definition should include examples to help consumers understand the data format they will receive. This also aids in generating mock servers or collections. The fix is to add an `examples` field to all response objects. ```YAML swagger: '2.0' # ... paths: /resources: get: responses: '200': description: A success response examples: 'application/json': aProperty: example value ``` -------------------------------- ### Install libgconf-2-4 package on Ubuntu 18 for Postman Source: https://learning.postman.com/docs/introduction/overview/getting-started/installation/installation-and-updates On Ubuntu 18, the 'libgconf-2-4' package is a prerequisite for Postman installation. This command installs the necessary package using the 'apt-get' utility. ```bash apt-get install libgconf-2-4 ``` -------------------------------- ### Perform Silent MSI Installation Source: https://learning.postman.com/docs/introduction/overview/administration/enterprise/managing-enterprise-deployment Illustrates how to perform a silent installation of the Postman Enterprise app using the /qn option, optionally combined with per-user installation. ```cmd msiexec /i path\to\package.msi /qn MSIINSTALLPERUSER=1 ``` -------------------------------- ### Edit an Example in Postman Source: https://learning.postman.com/docs/introduction/overview/sending-requests/response-data/examples Instructions on how to modify an existing example's request or response details directly, or after trying it as a new request. This allows for adjustments like removing sensitive tokens or changing status codes. ```APIDOC To edit an example directly: 1. Select **Collections** in the sidebar. 2. Select a request, and then select an example to open it. 3. Make any changes to the example request or response. 4. Select **Save** to save the example. To edit an example after trying it: 1. Select **Collections** in the sidebar. 2. Select a request, and then select an example to open it. 3. Select **Try** to open the example as a request in a new tab. 4. Make any changes to the new request. 5. Select **Send**. 6. In the response pane, select **View more actions > Update example**. You will receive confirmation once the example is updated. 7. Optionally, you can select **Save** to save the new request to a new or existing collection in your workspace. 8. Choose a location to save the new request, and then select **Save**. ``` -------------------------------- ### Add Examples to Request Bodies in OpenAPI 3.0 Source: https://learning.postman.com/docs/introduction/overview/api-governance/api-definition/openapi3 This resolution ensures that all request body objects in an OpenAPI definition include examples. Providing examples, either using the `example` or `examples` property, helps API consumers understand the expected data format, facilitating mock server generation and collection creation. ```APIDOC openapi: '3.0.3' # ... paths: /resources: post: requestBody: content: 'application/json': schema: # ... example: aProperty: example value ``` ```APIDOC openapi: '3.0.3' # ... paths: /resources: post: requestBody: content: 'application/json': schema: # ... examples: anExample: summary: An example description: This is an example description value: aProperty: example value ``` -------------------------------- ### Run Postman Insights Agent Installation Script Source: https://learning.postman.com/docs/introduction/overview/insights/get-started/ec2 This command downloads and executes the Postman Insights Agent installation script directly onto your EC2 instance. It's the initial step to set up the agent. ```bash bash -c "$(curl -L https://releases.observability.postman.com/scripts/install-postman-insights-agent.sh)" ``` -------------------------------- ### Perform Per-User MSI Installation Source: https://learning.postman.com/docs/introduction/overview/administration/enterprise/managing-enterprise-deployment Demonstrates how to install the Postman Enterprise app for the current user only, rather than system-wide, using the MSIINSTALLPERUSER option. ```cmd msiexec /i path/to/package.msi MSIINSTALLPERUSER=1 ``` -------------------------------- ### Verify OpenSSL Installation on Windows Command Line Source: https://learning.postman.com/docs/introduction/overview/sending-requests/capturing-request-data/capturing-https-traffic This command is used to verify that OpenSSL has been successfully installed on a Windows system and is accessible via the command line. It outputs the installed OpenSSL version, confirming its readiness for generating certificates. ```Shell openssl version ``` -------------------------------- ### Add Comments to a Postman Example Source: https://learning.postman.com/docs/introduction/overview/sending-requests/response-data/examples How to add comments to an example in Postman for collaboration, with an option to watch the collection for changes. This feature enhances team communication and feedback on API examples. ```APIDOC 1. Select **Comments** in the right sidebar and enter your comment. 2. (Optional) Select the **Watch collection** checkbox to be notified when there are changes to the collection that the example is in. 3. Select **Comment** to add your comment. ``` -------------------------------- ### Install Postman Insights Agent Script Source: https://learning.postman.com/docs/introduction/overview/insights/get-started/kubernetes/sidecar This command downloads and executes the Postman Insights Agent installation script directly from the Postman observability releases server. It's the initial step in setting up the agent in your environment. ```bash bash -c "$(curl -L https://releases.observability.postman.com/scripts/install-postman-insights-agent.sh)" ``` -------------------------------- ### Send Asynchronous HTTP Request in Postman Tests Source: https://learning.postman.com/docs/introduction/overview/tests-and-scripts/write-scripts/test-examples Shows how to send an asynchronous HTTP request from within Postman test scripts using pm.sendRequest. The example logs the JSON response of a GET request to a specified URL. ```JavaScript pm.sendRequest("https://postman-echo.com/get", function (err, response) { console.log(response.json()); }); ``` -------------------------------- ### Example JSON Data Structure for FQL Queries Source: https://learning.postman.com/docs/introduction/overview/postman-flows/flows-query-language/get-basic-values This JSON object serves as the sample data for all subsequent FQL (Flows Query Language) examples, demonstrating various data types and structures including nested objects and arrays. ```JSON { "name": "John Smith", "address": { "street": "123 Park Avenue", "city": "Atlanta", "state": "GA", "zip": "12345" }, "phones": [ { "type": "Home", "number": "123-456-7890" }, { "type": "Cell", "number": "098-765-4321" } ], "display name": "myuser123" } ``` -------------------------------- ### Test GET Request with Postman Echo API Source: https://learning.postman.com/docs/introduction/overview/developer/echo-api Instructions to send a basic GET request to the Postman Echo service using Postman, demonstrating how the service returns request details in a JSON response. This method is useful for quick testing without complex setup. ```APIDOC Method: GET URL: https://postman-echo.com/get ``` -------------------------------- ### Comparison of Postman Agents Source: https://learning.postman.com/docs/introduction/overview/getting-started/about-postman-agent A comparative overview of Postman's Desktop, Cloud, Interceptor, and Browser Agents, highlighting their recommendations, CORS handling, supported request types, installation requirements, and specific limitations. ```APIDOC Postman Agent Comparison: Auto-select option: Postman automatically selects the best agent. Agents: Desktop Agent: - Recommended for most users: Yes - Avoids CORS issues: Yes - Send all types of requests: Yes - Requires installing Desktop Agent app: Yes - Safari browser supported: No Cloud Agent: - Avoids CORS issues: Yes - No installation required: Yes - Send HTTP requests only: Yes - Can't access private or local network resources: Yes - Usage limits based on Postman plan: Yes Interceptor Agent: - Avoids CORS issues: Yes - No need to install a separate desktop app: Yes - Send HTTP requests only: Yes - Can't use CA, self-signed, or client certificates: Yes Browser Agent: - No installation required: Yes - Send HTTP requests only: Yes - May encounter CORS issues when sending requests: Yes ``` -------------------------------- ### List Postman Slack App Slash Commands Source: https://learning.postman.com/docs/introduction/overview/integrations/available-integrations/slack/slack-app Use this command in any Slack conversation to display a list of all available slash commands for the Postman Slack application. ```CLI /postman-app help ``` -------------------------------- ### Configure Postman with Proxy Environment Variables for Basic Authentication Source: https://learning.postman.com/docs/introduction/overview/getting-started/installation/proxy These code snippets demonstrate how to create executable files for Windows, macOS, and Linux to launch the Postman desktop app with HTTP_PROXY and HTTPS_PROXY environment variables pre-configured for proxies requiring basic authentication. Remember to replace `USER`, `PASS`, `host`, and `port` with your specific proxy details. ```Batch set HTTP_PROXY=http://USER:PASS@host:port set HTTPS_PROXY=https://USER:PASS@host:port start C:\path\to\Postman.exe ``` ```Shell HTTP_PROXY=http://USER:PASS@host:port HTTPS_PROXY=https://USER:PASS@host:port /path/to/postman ``` -------------------------------- ### Utilize Postman Dynamic Variables Source: https://learning.postman.com/docs/introduction/overview/sending-requests/variables/variables This section provides examples of Postman's built-in dynamic variables, which generate random or specific data at runtime. Examples include generating a GUID, the current Unix timestamp, and a random integer, useful for testing and unique data generation. ```Postman Syntax {{$guid}} ``` ```Postman Syntax {{$timestamp}} ``` ```Postman Syntax {{$randomInt}} ``` -------------------------------- ### Get the time from a date using FQL Source: https://learning.postman.com/docs/introduction/overview/postman-flows/flows-query-language/data-manipulation The $hours(), $minutes(), $seconds(), and $milliseconds() functions return their respective values from a given date. The example below uses the $now() function for the date. ```FQL $hours($now()) & ":" & $minutes($now()) & ":" & $seconds($now()) & ":" & $milliSeconds($now()) ``` -------------------------------- ### Example: Import and Use Postman Logger Package Source: https://learning.postman.com/docs/introduction/overview/tests-and-scripts/write-scripts/packages/package-library Provides a concrete example of importing a package named `postman_logger` from the `@postman` domain. It shows how to declare it as `postmanLogger` and then call its `logger` function with an argument, demonstrating output to the Postman Console and usage of the `pm` object for tests. ```JavaScript // team domain: postman // package name: postman_logger const postmanLogger = pm.require('@postman/postman_logger'); postmanLogger.logger("The test passed") // output in the Postman Console: Logging information to the console, The test passed ``` -------------------------------- ### HashiCorp Vault Setup Script Environment Variables Source: https://learning.postman.com/docs/introduction/overview/sending-requests/postman-vault/hashicorp-vault This section lists the environment variables that can be set to configure the HashiCorp Vault setup script. These variables are crucial for authentication with your Vault instance and for customizing the OIDC identity provider, client, and policy settings. ```APIDOC Environment Variables: VAULT_TOKEN (Required): Authentication token with permissions for OIDC client, provider, auth method, policy, and role creation. VAULT_ADDR (Required): Vault cluster URL (HCP public URL or self-managed address:port). VAULT_NAMESPACE: Namespace where users manage sensitive data. Default: "" OIDC_CLIENT_NAME: Name of the OIDC client application. Default: postman-integration-client REDIRECT_URI: Redirect URIs for OIDC client. Default: http://127.0.0.1:10545/,http://127.0.0.1:10534/ JWT_AUTH_PATH: Path for new JWT auth method. Default: postman-jwt OIDC_ROLE: Role name with permission to authenticate via JWT auth. Default: postman OIDC_POLICY_NAME: HashiCorp Vault policy attached to 'postman' role. Default: postman-integration-policy (allows reading secrets from all engines by default) ``` -------------------------------- ### Postman CLI: Publish API Version (Git Repo - Schema Root File Example) Source: https://learning.postman.com/docs/introduction/overview/postman-cli/postman-cli-options This example shows how to publish an API version for Git-linked repositories where the API uses a schema root file. It demonstrates using the `--api-definition ` option to specify the path to the schema root file. ```Shell postman api publish --name v1\ --release-notes "# Some release notes information"\ --collections \ --api-definition ``` -------------------------------- ### Get Postman Mock Server URL using Postman API Source: https://learning.postman.com/docs/introduction/overview/design-apis/mock-apis/mock-with-api Retrieve the URL of your created mock server by sending a GET request to the Postman API's /mocks endpoint. This URL is essential for sending requests to the mock server and simulating API responses based on your collection's examples. ```APIDOC Method: GET URL: https://api.getpostman.com/mocks Headers: x-api-key: Response: A JSON array of mock servers. Locate the 'mockUrl' for 'testAPImock' or your target mock server. ``` -------------------------------- ### Install Postman Enterprise Windows App to Custom Directory Source: https://learning.postman.com/docs/introduction/overview/administration/enterprise/managing-enterprise-deployment This command performs a system-wide installation of the Postman Enterprise MSI package to a specified custom directory. The `INSTALLDIR` public property is used to override the default installation path, which defaults to "%PROGRAMFILES%\\Postman\\\"Postman Enterprise\"" for system-wide installations. ```Shell msiexec /i path/to/package.msi INSTALLDIR=C:\custom ``` -------------------------------- ### Count Elements in an Array using FQL Source: https://learning.postman.com/docs/introduction/overview/postman-flows/flows-query-language/get-basic-values Use the '$count()' function in FQL to determine the number of elements in a list (array). For example, '$count(phones)' returns '2'. ```FQL $count(phones) ``` -------------------------------- ### Syntax Examples for Specifying Allowed External Packages in Postman Source: https://learning.postman.com/docs/introduction/overview/administration/managing-your-team/manage-team-workspaces This section provides examples of the syntax used to specify allowed external packages from registries like npm and JSR in Postman. It demonstrates how to use exact versions, major version wildcards, and full registry/scope wildcards for package specification. ```Package Specification Syntax npm:ajv@8.12.0 ``` ```Package Specification Syntax npm:lodash@4.* ``` ```Package Specification Syntax jsr:*@* ``` ```Package Specification Syntax npm:@types/*@* ``` -------------------------------- ### Install External Newman HTML Reporter Package Source: https://learning.postman.com/docs/introduction/overview/collections/using-newman-cli/newman-custom-reporters Use this command to install an external Newman reporter, such as the HTML reporter, via npm. This makes the reporter available for generating reports from your Newman collection runs, either globally or locally depending on your Newman installation. ```Shell npm install newman-reporter-html ``` -------------------------------- ### Newman Command Line Options Reference Source: https://learning.postman.com/docs/introduction/overview/collections/using-newman-cli/newman-options Comprehensive reference for Newman command-line options, categorized by their purpose: Basic, Setup, Request, and SSL configurations. Each option includes its short and long forms, along with a detailed description of its functionality. ```APIDOC Newman CLI Options: Basic Options: -h, --help: Output usage information. -v, --version: Output the version number. Setup Options: -e, --environment [file|URL]: Specify the file path or URL of environment variables. -g, --globals [file|URL]: Specify the file path or URL of global variables. -d, --iteration-data [file]: Specify the local file path to a data file (JSON or CSV) to use for each iteration. To learn more, see Data file example. -n, --iteration-count [number]: Specify the number of times for the collection to run. Use with the iteration data file. --folder [folderName]: Specify a folder to run requests from. You can specify more than one folder by using this option multiple times, specifying one folder for each time the option is used. --working-dir [path]: Set the path of the working directory to use while reading files with relative paths. Defaults to the current directory. --no-insecure-file-read: Prevents reading of files located outside of the working directory. --export-environment [path]: The path to the file where Newman will output the final environment variables file before completing a run. --export-globals [path]: The path to the file where Newman will output the final global variables file before completing a run. --export-collection [path]: The path to the file where Newman will output the final collection file before completing a run. --postman-api-key [api-key]: The Postman API key used to load resources using the Postman API. Request Options: --delay-request [number]: Specify a delay (in milliseconds) between requests. --timeout [number]: Specify the time (in milliseconds) to wait for the entire collection run to complete execution. --timeout-request [number]: Specify the time (in milliseconds) to wait for requests to return a response. --timeout-script [number]: Specify the time (in milliseconds) to wait for scripts to complete execution. SSL Options: --ssl-client-cert [path]: The path to the public client certificate file. Use this option to make authenticated requests. --ssl-client-key [path]: Optionally, you can add the path to the private client key that verifies certificate ownership. --ssl-client-passphrase [passphrase]: Optionally, you can add a secret passphrase to protect the private client key. --ssl-client-cert-list [path]: The path to the configuration JSON file containing the SSL client certificate list. Use this option to set several SSL client certificates according to a URL or hostname. To learn more, see an example client certificate list. This option has a higher priority over the --ssl-client-cert, --ssl-client-key, and --ssl-client-passphrase options. If there is no URL match in the SSL client certificate list, these options are used instead. --ssl-extra-ca-certs [path]: The path to the file that has one or more trusted CA certificates in PEM format. You can use this option when you don't want to use the --insecure option. ``` -------------------------------- ### Install Local Newman Custom Reporter from Directory Source: https://learning.postman.com/docs/introduction/overview/collections/using-newman-cli/newman-custom-reporters This command installs a custom Newman reporter directly from a specified local directory path. It is useful for developing and testing custom reporters before publishing them to npm, allowing for local integration with Newman. ```Shell npm install ``` -------------------------------- ### Run Postman Collections with Postman CLI Source: https://learning.postman.com/docs/introduction/overview/postman-cli/postman-cli-options Examples demonstrating how to run a Postman collection using the Postman CLI, either by providing a folder/file path or a collection ID. ```CLI postman collection run /myCollectionFolderName/myCollectionFile.json postman collection run 12345678-12345ab-1234-1ab2-1ab2-ab1234112a12 ``` -------------------------------- ### View Newman Command Line Help Source: https://learning.postman.com/docs/introduction/overview/collections/using-newman-cli/newman-options Shows the command to display a list of all available command-line options and usage information for Newman. ```Shell newman run -h ``` -------------------------------- ### Get the length of a string in Postman FQL Source: https://learning.postman.com/docs/introduction/overview/postman-flows/flows-query-language/data-manipulation The `$length()` function returns the length of the specified string. This example returns the length of the string in the first `description` key-value pair in the `payments` array. ```FQL $length(payments[0].description) ``` -------------------------------- ### Postman CLI: Publish API Version (Non-Git Repo Example) Source: https://learning.postman.com/docs/introduction/overview/postman-cli/postman-cli-options This example demonstrates how to publish an API version using the `postman api publish` command for repositories that are not linked with Git. It shows how to specify the API ID, version name, release notes, multiple collection IDs, and the API definition ID. ```Shell postman api publish --name v1\ --release-notes "# Some release notes information"\ --collections \ --api-definition ``` -------------------------------- ### Extract Entire JSON Object using FQL Source: https://learning.postman.com/docs/introduction/overview/postman-flows/flows-query-language/get-basic-values Enter the name of an object in the JSON file to retrieve all the data within that object. For example, 'address' returns the full address object. ```FQL address ``` -------------------------------- ### Get substring before first pattern in Postman FQL Source: https://learning.postman.com/docs/introduction/overview/postman-flows/flows-query-language/data-manipulation The `$substringBefore()` function returns the substring before the specified occurrence of a pattern. If the pattern is not found, it returns the entire string. This example finds the substring before 'subscription'. ```FQL $substringBefore(payments[0].description, "subscription") ``` -------------------------------- ### Add Examples to All Request Bodies in OpenAPI 2.0 Source: https://learning.postman.com/docs/introduction/overview/api-governance/api-definition/openapi2 This rule requires that all schema objects within body parameters in an OpenAPI 2.0 definition include an example. Providing examples helps API consumers understand the expected data structure, facilitates client code generation, and aids in setting up mock servers or Postman collections. ```YAML swagger: '2.0' # ... paths: /resources: post: parameters: - in: body name: body schema: type: object example: aProperty: example value ``` -------------------------------- ### Postman Sandbox API: Example Usage of pm.vault Methods Source: https://learning.postman.com/docs/introduction/overview/tests-and-scripts/write-scripts/postman-sandbox-api-reference An example demonstrating the asynchronous usage of `pm.vault` methods in Postman scripts to interact with vault secrets. It shows how to retrieve, set, and unset a secret key, emphasizing the need for the `await` operator. ```JavaScript console.log(await pm.vault.get("secretKey")); await pm.vault.set("secretKey", "newValue"); await pm.vault.unset("secretKey"); ``` -------------------------------- ### Extract Entire JSON Array using FQL Source: https://learning.postman.com/docs/introduction/overview/postman-flows/flows-query-language/get-basic-values Enter the name of an array in the JSON file to retrieve all the data within that array. For example, 'phones' returns the complete array of phone objects. ```FQL phones ``` -------------------------------- ### Postman CLI: Publish API Version (Git Repo - Schema Folder Example) Source: https://learning.postman.com/docs/introduction/overview/postman-cli/postman-cli-options This example illustrates how to publish an API version for Git-linked repositories where the API uses a schema folder. It demonstrates using the `--api-definition ` option to specify the path to the schema directory instead of an ID. ```Shell postman api publish --name v1\ --release-notes "# Some release notes information"\ --collections \ --api-definition ``` -------------------------------- ### Postman Mock Server Request Elements Source: https://learning.postman.com/docs/introduction/overview/design-apis/mock-apis/matching-algorithm Describes the configurable variables and optional headers that an incoming request to a Postman mock server can include, which are used by the matching algorithm to find the closest matching example. ```APIDOC Incoming Mock Server Request: requestMethod: string (GET, POST, PUT, PATCH, DELETE) Description: The HTTP method of the incoming request. requestPath: string (/, /test, /test/path, /test/path/1) Description: The path of the incoming request. requestHeaders: object Description: Headers of the incoming request. Optional Headers: x-mock-response-name: string Description: Specifies the example to be returned by its name. x-mock-response-id: string Description: Specifies the example to be returned by its unique ID (UID). UID Format: - requestBody: string/object Description: The body of the incoming request. requestParams: object Description: Query parameters of the incoming request. ``` -------------------------------- ### Automate User Provisioning with Postman SCIM API Source: https://learning.postman.com/docs/introduction/overview/developer/postman-api/intro-api The SCIM API supports System for Cross-domain Identity Management (SCIM) to automate team provisioning. It allows organizations to deploy Postman at scale and control access with an identity provider, integrating onboarding processes to automatically provision users and groups. ```APIDOC SCIM API: Purpose: Automate provisioning of your team using SCIM (System for Cross-domain Identity Management). Functionality: - Integrate with identity providers for user and group provisioning. - Automate onboarding processes. - Control access to Postman at scale. ``` -------------------------------- ### Extract Top-Level Field using FQL Source: https://learning.postman.com/docs/introduction/overview/postman-flows/flows-query-language/get-basic-values To access a top-level field in a JSON structure using FQL, simply enter the field's name. For example, 'name' retrieves 'John Smith'. ```FQL name ``` -------------------------------- ### Install Postman Collection Transformer Source: https://learning.postman.com/docs/introduction/overview/getting-started/importing-and-exporting/importing-data This command installs the Postman Collection Transformer globally using npm, which is required to convert Postman collections between different formats. ```Shell sudo npm install -g postman-collection-transformer ``` -------------------------------- ### Convert a number into a string with FQL Source: https://learning.postman.com/docs/introduction/overview/postman-flows/flows-query-language/data-manipulation You can convert a number into a string with the $string() function. The example below gets the number value from the 'amount' key in the first object in the 'payments' array and converts it into the string "110.48". ```FQL $string(payments[0].amount) ``` -------------------------------- ### Join an array of strings into a single string in Postman FQL Source: https://learning.postman.com/docs/introduction/overview/postman-flows/flows-query-language/data-manipulation The `$join()` function creates a single string from an array of strings. This example gets the array from the `associated_usernames` key and returns the array's values as a single string. ```FQL $join(customer_info.associated_usernames) ``` -------------------------------- ### Postman Flows Select Block API Documentation Source: https://learning.postman.com/docs/introduction/overview/postman-flows/reference/blocks/select Detailed documentation for the Postman Flows Select block, including its purpose, input/output specifications, setup instructions, and integration with other blocks. ```APIDOC Select Block: Description: Extracts a specific piece of information from JSON data received from another block. Useful for isolating and working with data from an HTTP Request block's response. Input: Port: Connects to any block that sends JSON data. Type: JSON data Output: Port: Sends the selected data. Type: Varies based on selected data (symbol next to port changes). Setup: Method 1: Create with blocks list. Method 2: Drag and drop output data from an HTTP Request or Display block (automatically selects dragged data). Configuration: - Run flow to populate fields from connected block. - If connected to HTTP Request with saved response, fields are visible before running. - Select "Enter path..." to view data fields. - Choose desired field to send from Select block. - Select symbol next to output port to preview data. - Run flow to update preview after field change. Related Blocks (Can send JSON data to Select block): - HTTP Request - Create with AI Related Blocks (Select block can be inserted into): - Create with AI - Evaluate - If - List - Record - Template ``` -------------------------------- ### Display Postman Insights Agent EC2 Help Options Source: https://learning.postman.com/docs/introduction/overview/insights/get-started/ec2 Run this command to view all available configuration parameters and options for the Postman Insights Agent when setting it up on an EC2 instance. This provides details on various flags and their usage. ```bash postman-insights-agent ec2 --help ``` -------------------------------- ### Get substring after first pattern in Postman FQL Source: https://learning.postman.com/docs/introduction/overview/postman-flows/flows-query-language/data-manipulation The `$substringAfter()` function finds a pattern and returns the substring that appears after it. This example returns the substring that follows 'recurring' in the `description` key-value pair in the first object of the `payments` array. ```FQL $substringAfter(payments[0].description, "recurring") ``` -------------------------------- ### Postman CLI: Lint API Definition Example Source: https://learning.postman.com/docs/introduction/overview/postman-cli/postman-cli-options This example demonstrates how to use the `postman api lint` command to lint an API definition. You can specify the definition either by its file name or by its unique API ID. ```Shell postman api lint my-definition-file.json postman api lint 12345678-12345ab-1234-1ab2-1ab2-ab1234112a12 ``` -------------------------------- ### Postman Browser Agent Capabilities Source: https://learning.postman.com/docs/introduction/overview/getting-started/about-postman-agent Outlines the functionalities and limitations of the Postman Browser Agent, including supported request types, installation requirements, and potential CORS issues. ```APIDOC Postman Browser Agent: Purpose: Send HTTP requests. Installation: No installation required. Supported Request Types: HTTP requests. Unsupported Request Types: WebSocket, Socket.IO, gRPC, MQTT, GraphQL requests. Limitations: May experience CORS limitations of browsers. ``` -------------------------------- ### Postman Mock Server Example Response with Template Helper Source: https://learning.postman.com/docs/introduction/overview/design-apis/mock-apis/create-dynamic-responses An example of a Postman mock server response body that utilizes the `{{$body 'username'}}` template helper to dynamically extract the username from the incoming request. It also includes `{{$randomUUID}}` to generate a unique identifier, showcasing dynamic response generation. ```Postman Templates { "username": {{$body 'username' 'postman'}}, "id": {{$randomUUID}} } ``` -------------------------------- ### Capture all traffic with apidump Source: https://learning.postman.com/docs/introduction/overview/insights/reference/agent/apidump Example demonstrating how to capture all network traffic from a collection and send it to the Insights Agent by specifying the project ID. ```shell postman-insights-agent apidump --project ``` -------------------------------- ### Postman Mock Server Example Response with Wildcard Source: https://learning.postman.com/docs/introduction/overview/design-apis/mock-apis/matching-algorithm This JSON snippet demonstrates a typical response from a Postman mock server when a request to a dynamic URL segment (e.g., /users/{{userId}}) is matched. It shows a static 'name' and a hardcoded 'id' for illustration. ```json { "id": 2, "name": "Carol" } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.