Connect to Local APIs

SwaggerHub Explore supports access to local APIs through a distributed agent. The agent is a lightweight application that runs on your workstation to enable access to APIs that are private or deployed on your local environment. You may also be able to access APIs under development, for example with SwaggerHub Enterprise plan (on-premise installation), an agent allows you to access Mock / testing servers.

Note that you may still need an API token or authorization credentials to access non-public APIs.

This video demonstrates using agents to access local APIs:

 

Downloading and Installing the Agent Software

Important

Safari browser does not support agents.

To download the agent for your platform:

  • Open the Connection Execution dialog. To do that, click Cloud Icon Green Enabledin the top right corner of the window.

  • Choose your operating system.

  • Click Download. The file containing the executable agent will then be downloaded.

  • Run the installer for the agent software.

  • Respond to prompts from the agent installer to install the agent.

  • Run the agent.

Running the Agent

The agent software is located where you installed it. You can double check that the agent software is running in the usual way for your platform.

If the agent is not running, you will not be able to access local APIs.

Restarting the Agent

The agent must be restarted when you restart your workstation. That is, installing the agent does not insert the agent into your workstation’s startup sequence, so when you shut down your computer, the agent software stops and is not automatically restarted.

Selecting Local API Access

You can switch to local API access by choosing the Local option on the Connection Execution dialog. If the agent is not running (e.g., it has stopped, or you did not restart the agent after rebooting your workstation),the message Status: unavailable will appear on the dialog.

Automatic switching between Local and Cloud APIs

You can switch automatically between cloud APIs and local APIs by enabling the Auto option on the Connection Execution dialog. If the agent is not running (e.g., it has stopped, or you did not restart the agent after rebooting your workstation), this option will automatically enable cloud APIs.

Status of Local vs Cloud API Access

In the top right corner of the Explore window, you can hover over the icon to see what access is currently active -- the icon indicates your API access status:

  • Cloud Icon Green Enabled(green/Cloud) indicates cloud API access

  • Cloud Icon Red Disabled(red/Cloud) indicates no cloud availability (no Internet access)

  • Local Icon Green Enabled(green/Local) indicates that local access is enabled and available (agent is running)

  • Local Icon Red Disabled(red/Local) indicates that local access is enabled but not available (agent is not running)

  • If Auto is enabled, a green/Local icon appears if the agent is running. If local access is not available (agent is not running), then this will display either green/Cloud (if the Internet is enabled) OR red/Cloud (no Internet).

Updating the Agent Software

If a new version of the agent software is available, simply download the new version and install it as described above.

See Also

Work with SwaggerHub Explore

Publication date: