Access REST APIs

Before you begin

Install Plant Applications Web Client.
Note: The list of REST APIs that you can access depends on the roles and assignments assigned to the UAA user group to which you belong.

About this task

This topic describes how to access the REST APIs for Plant Applications Web Client.

Procedure

  1. Access a node on which Plant Applications Web Client has been installed.
  2. Access the following URL: https://<server name of web client>:<port number>/<application service name>/swagger-ui.html
    Note: You can find all the application service names in the following link: API Endpoint Documentation. You can select the individual links to access detailed API documentation.
    https://webclientservername:5059/ncm-app-service/swagger-ui.html
    For Workorder Service:https://webclientservername:5059/workorder- service/apidocs/index.html
    Note: All the Plant Applications Web Client applications run behind reverse proxy, which uses the port number 5059.
    The Swagger UI appears.
  3. Only for Work Order Service: To access the Swagger UI for Work Order Service, 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.
  4. Select Authorize.
    The Available authorizations window appears.
  5. In the Available authorizations window, scroll down to the resource_owner (OAuth2, password) section, enter the following values, and then select Authorize:
    Field Description
    username Enter the Plant Applications Server username.
    password Enter the Plant Applications Server password.
    client_id Enter a value in the following format: <node name of Plant Applications Web Client>_mes. For example, if the node name is wcserver, enter wcserver_mes.
    client_secret Enter plantappssecret as the client secret.
    Note: In any case, if you are unable 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.