Test the REST API Using Postman

Web API provides most of its function through a REST APIs that integrates with third-party services. This guide explains how to use the test utility, Postman to call these REST APIs.

Postman is not a product of Mitsubishi Electric Iconics Digital Solutions. Updates to Postman may change these steps. If you cannot find a setting described here, see Postman's documentation.

These are the prerequisites to test REST APIs with Postman:

  • Web API service is running
  • Simulator Point Manager is running
  • Postman is installed
  • Optional: IIS is running as a reverse proxy
  • Optional: IIS is using self-signed certificates or certificates from a verified certificate authority

To test Web API via Postman, follow these steps:

  1. Start the Web API service and confirm basic Swagger functionality by following the steps in: How to get detailed API documentation of the calls

  2. In Postman, go to File > Settings.

    Postman - Settings 1

  1. If you are using the default self-signed certificate, disable SSL certificate verification.

    Postman - Settings 2

  1. Enable Send Postman Token header and Automatically follow redirects.Postman - Settings 3

  1. Check that your Proxy settings are appropriate for your server. In most cases, you should enable Use system proxy.

    Postman - Settings 4

  1. Select Import to read all REST APIs from Swagger.Postman - Import 5

  1. In the text field, enter this url: https://your host name/fwxapi/swagger/v1/swagger.json

    Notes:

    • For HTTPS to work, you need either a self-signed certificate or a certificate from a verified certificate authority
    • When using certificates, you need to use the exact host name or IP address provided by the certificate, not localhost.

    Postman - Import 6

  2. Select Import.

    Postman - Import 7

    When the import is finished, Postman will create a tree with all imported REST APIs.

    Postman - Import 8

  3. Set the default variable baseUrl to https://hostname which will be used across all REST APIs.

    Postman - Collection Configuration 1

  4. Go to the Collections tab, expand IcoWeb APIService 1.0 > fwxapi > rest > v1 > Data, and double-click GET Reads a value of a point. Set the pointName parameter to svrsim:sin.

    Postman - Collection Configuration 2

  5. Go to the Authorization tab and set the following values:

    • Token name: any identifying name, for this example: Web API Token
    • Grant Type: set to Authorization Code (with PKCE)
    • Callback url: http://localhost
    • Auth url: https://your hostname/fwxserverweb/security/connect/authorize
    • Access Token url: https://your hostname/fwxserverweb/security/connect/token
    • Client ID: in_house_client
    • Code Challenge Method: SHA-256
    • Scope: fwxserver
    • Client Authentication: Send as Basic Auth Header

    Postman - Collection Configuration 3

  6. Select Get New Access Token. Sign in with your administrator account from GENESIS security.

    Postman - Collection Configuration 4

  7. If the authentication was successful, Postman will display the token details. Select Use Token.

    Do not share the access token text! It can be used to authenticate with your administrator credentials.

    Postman - Collection Configuration 4

  8. Go to the Settings tab and set the following:

    • HTTP version: HTTP/1.x
    • Enable Automatically follow redirects
    • Enable Encode URL automatically

    Postman - Collection Configuration 4

  1. Select Send and check the response panel. It should show an HTTP status of: 200 OK

    Postman - Collection Configuration 4