Authenticate with the API

The IPFusion API can be configured to use a secured connection.

Before setting up authentication for the API, the API Server must be installed on the machine whose Runtime will be connected to in the API connection.

Configure Project

The project must first be configured with the API security settings.

To configure the project settings for API authentication:

  1. In Designer, go to Project Settings > API.
  2. In the API Server Configuration, enter the desired Username and Password to be used for authenticating with the API.
  3. In the Workstations settings, check the Workstations which run the API server.
  4. Save and publish the project.

Get Bearer Token

The bearer token is required to authenticate with the API and access all of its features. Below will show how to get this through swagger.

Note: The bearer token expires after two hours.
To get the a bearer token:
  1. Open swagger at http://{machinename}:8080/docs (or https://{machinename}:8612/docs for a secured connection) in a browser.
  2. In the Security section, select the POST /api/Auth/Login request and click Try it out.
  3. In the parameters, replace the "string" values with the username and password configured in the project settings, then click Execute.
  4. The response body contains the token required for the API access. Copy this value.
    Note: Occasionally the token may be cut off by the download button. If this occurs, you may need to download the token to ensure you get the full string.
  5. At the top of the page, click Authorize.
  6. Paste the bearer token and click Authorize.

You are now logged in and can access the API features.

If after authenticating, you receive Unauthorized messages, try reloading the page and authenticating again. Ensure the bearer token is entered correctly.