Access the Plant Applications REST APIs

About this task

The Plant Applications Web Client provides a Swagger-based UI to view and run the Representational State Transfer (REST) APIs.

Starting Plant Applications 2022, the default https port is 443. If you use the default port, you need not include it in the Rest API calls.

You can access the UI from the list of supported Web browsers by entering a URL in the following format: https://<server_name>:<port_number>/<micro_service_name>/swagger-ui.html.

Where:
  • <server_name>: Represents the name of the server on which the Plant Applications Web Client is installed.
  • <port_number>: Represents the network port used by the Plant Applications Web Client.
    Note:

    By default the Web Client installs on port 443. When port 443 is not available, then the Web Client tries to install on port 5059.

    If the Web Client is running on 443, then you do not need to specifically provide the port number in the URL. For example, https://<server_name>/<micro_service_name>/swagger-ui.html.

    If the Web client is running on 5059, then you must provide the port number in the URL. For example, https://<server_name>:5059/<micro_service_name>/swagger-ui.html.

  • <micro_service_name>: Represents the name of the microservice for which you want to run the REST APIs. See Swagger URLs of Rest Services.

For exchanging data between the client-server system, user authentication is required.

Procedure

  1. Access the following URL: https://<server name of web client>:<port number>/<application service name>/swagger-ui.html
    • For Workorder Service: https://webclientservername:5059/workorder- service/apidocs/index.html
    • For Esignature-app-service Service: https:// webclientservername:<port>/esignature-app-service/swagger-ui/

    The Swagger UI appears.

  2. To access the Swagger UIs, you must perform following steps in the Operations Hub Server:
    1. Go to the C:\ProgramData\GE\Operations Hub\uaa-config location.
    2. Using a text editor, update the uaa.yml file by adding the below lines at the end of file with proper indentation.
      cors:
        xhr:
          allowed:
            headers:
              - X-Requested-With
              - Authorization
            methods:
              - POST
    3. Restart the GE Operations Hub UAA Tomcat Web Server service.
  3. Select Authorize.
    You will be prompted to enter the client ID and client secret.
  4. Enter the following values, and select Authorize:
    Field Description
    User Name Enter the Plant Applications login user name.
    Password Enter the Plant Applications login password.
    client_id Enter a client id value that was used during the installation.

    By default <node name of Plant Applications Web Client>_mes.

    client_secret Enter the password. This password is set during the Web Client installation.
    Note: If you are not able to see the username and password fields, refer to Swagger URL Authorization Issue.
    You can now access the REST APIs for the application that you have entered in the URL.
    Important:
    The following REST API microservices are deprecated. These REST API microservices will be permanently removed in the future release.
    • In mes-service:
      • GET /downtime/v1/downtimeRecords
      • GET /downtime/v1/downtimeRecords/{id}
      • GET /downtime/v1/downtimeStatistics
      • GET /downtime/v1/faults
      • GET /downtime/v1/faults/{id}